V8 revs up

Issue #252.January 8, 2024.2 Minute read.
Bytes

Today’s issue: 2023’s JavaScript Prom Queen, high schoolers accidentally breaking NPM, and bringing React Native to the Black Mirror snorkel mask.

Welcome to #252.


Eyeballs logo

The Main Thing

A guy in a tiny car with a huge engine

Street legal and ready to mingle

V8 revs up

It’s easy to take JavaScript engines for granted. We know they parse, compile, and execute our code, but only a cursed blessed few of us work on projects that require you to regularly think about how the low-level sausage gets made.

But while you were (probably) not paying attention, V8 recently introduced some major improvements that are already making the web faster and safer.

  • Maglev — A brand new mid-tier optimizing JIT compiler that sits between V8’s existing Sparkplug and TurboFan compilers. It’s designed to fill the performance gap between these two compilers by generating “good enough code, fast enough.” It’s already improved performance by 6-10%.

  • Turboshaft — A new internal architecture for TurboFan, the top-tier optimizing compiler we just mentioned. This makes it faster and easier to extend with new optimizations, paving the way for future perf gains in 2024.

  • Faster HTML Parser — They added a faster HTML parser to Blink, Chromium’s rendering engine. This increased Chrome’s Speedometer score by 3.4%, and caused WebKit to integrate the same changes.

The V8 team also made some significant updates to the WebAssembly side by shipping Wasm Garbage Collection after multiple years of work.

This gives much better support for garbage collecting languages like Java, Python, C#, and others — allowing them to be compiled to Wasm, where they run about twice as fast as when they’re compiled to JavaScript.

Bottom Line: *Slaps hood* Listen to that engine purr.

        

Nylas logo

Our Friends
(With Benefits)

Boss baby sitting in his high chair in a suit

Me trying to act normal during the executive roundtable

Check out the hottest AI and API predictions for 2024 from tech leaders

Want to learn about how some of the world’s fastest-growing tech companies are leveraging APIs in 2024?

Then sign up for Nylas’ free executive roundtable discussion on January 11th. Executives from Snyk and Common Room will join Nylas’ CEO and CTO to talk about where they think the API landscape is headed in 2024.

They’ll dive deep on gen AI, security, DevEx, and performance, while providing lots of real-world examples of how their companies are leveraging APIs to scale their businesses in innovative ways.

Check it out. It’s an interactive session, so you’ll get a chance to ask questions from leaders of some of the largest and fastest-growing tech platforms in the world.


Pop Quiz logo

Pop Quiz

Sponsored by Datadog

In this free Frontend Monitoring Brief, they show you how Datadog provides a single source of truth for all your frontend monitoring data, and why that’s so helpful.

What does this function do?

const surprise = (...fns) => input => fns.reduce(
  (acc, fn) => fn(acc), input
)

Cool Bits logo

Cool Bits

  1. The 2023 JavaScript Rising Stars report just came out, which shows which JS projects that got the most GH stars last year. Can you guess who took home the #1 spot? We’ll reveal it in the last cool bit.

  2. A pseudonymous high school student wrote this article about how they accidentally broke NPM. You break it, you bought it - just like GitHub.

  3. Convex is the fastest way to build an AI application in 2024. It lets you coordinate chains of LLMs and easily read and write into the Convex database to coordinate your application logic, without building extra endpoints. [sponsored]

  4. What PWA can do today is a PWA that can be installed on your phone or desktop to show you which features are supported by your device. Very meta.

  5. Vue 3.4 just launched with a rewritten template parser that’s 2x faster, a few API improvements, and a refactored reactivity system that makes effect triggering more accurate and efficient.

  6. You won’t get far into modern UI development before you hear the word “declarative” – but what does that really mean? In this free preview of react.gg – we dive into the wondrous world of imperative vs declarative programming.

  7. CarbonQA created a high-quality QA services for dev teams that provides a team of dedicated, US-based QA testers, so you can always catch bugs before they break prod. [sponsored]

  8. Oskar Kwaśniewski wrote about Bringing React Native libraries to Apple Vision Pro. It’s very timely since Apple just announced the official launch for their Black Mirror snorkel mask next-gen AR/VR device.

  9. Antirez wrote this insightful article about LLMs and Programming in the first days of 2024.

  10. Without further ado, your 2023 JavaScript #1 Rising Star/Prom Queen/Benevolent Overlord is shadcn/ui, who added a whopping 39.5k GitHub stars last year. Should shadcn/ui be unable to fulfill her duties as Miss JS Universe, her crown will be given to Bun, who was this year’s runner-up and the winner in 2022.


Pop Quiz logo

Pop Quiz: Answer

Sponsored by Datadog

What does this function do?

const surprise = (...fns) => input => fns.reduce(
  (acc, fn) => fn(acc), input
)

It’s a pipe function that allows you to chain multiple operations together by taking a series of functions as arguments and applying them in a specific order to the input.

Wow, words.

Instead of doing something like this.

const toUpperCase = str => str.toUpperCase()
const removeSpaces = str => str.replace(/\s/g, "")
const addExclamation = str => str + "!"

toUpperCase(removeSpaces(addExclamation("Subscribe to Bytes")))

You can do something like this.

const pipe = (...fns) => input => fns.reduce(
  (acc, fn) => fn(acc), input
)

const formatString = pipe(toUpperCase, removeSpaces, addExclamation)

formatString("Subscribe to Bytes") // SUBSCRIBETOBYTES!

There’s currently a perpetual TC39 proposal for adding a true Pipe operator (|>) to JavaScript.