Upgrade to Pro — share decks privately, control downloads, hide ads and more …

🇺🇸 JSConf North America 2025

🇺🇸 JSConf North America 2025

Compilers, User Interfaces & the Rest of Us

Compilers have long been seen as one of the most complex topics in computer science. Nowadays, web frameworks are evolving from runtime libraries into optimizing compilers and reshaping how we build user interfaces. Different topics in front-end development—e.g. reactive programming—are now experiencing this era fueled by static-analysis-driven insights.

This talk will explore how modern UI compilers are redefining performance and developer experience. We’ll discuss how some compilers are designed and different open-source solutions—including the React Compiler, Million.js, Svelte, and Marko—, as well as enterprise apps, and the growing role of compilers in automating things.

By the end of the session, you'll probably be optimistic about a future where compilers understand our entire code and offload a huge part of our mental burden related to manual tasks!

Avatar for Matheus Albuquerque

Matheus Albuquerque PRO

October 14, 2025
Tweet

More Decks by Matheus Albuquerque

Other Decks in Programming

Transcript

  1. COMPILERS, USER INTERFACES & THE REST OF US • OCTOBER

    14, 2025. Hello, Chesapeake Bay! 👋 🇺🇸
  2. Matheus Albuquerque ↝ 👨💻 STAFF SWE @ MEDALLIA ↝ ⚡

    GOOGLE DEVELOPER EXPERT ↝ 𝕏 YTHECOMBINATOR
  3. “So here’s my advice for anyone who wants to make

    a dent in the future of web development: time to learn how compilers work.” Compilers are the New Frameworks • Tom Dale, 2017
  4. “The thing that has made reactive programming interesting again are

    compilers.” Marko: Compiling Fine-Grained Reactivity • Ryan Carniato, 2022
  5. ↝ LINTERS: ESLint (2013), TSLint (2015), Biome (2023), Oxlint (2023)…

    ↝ FORMATTERS: Prettier (2017), dprint (2020), Biome (2023)… ↝ BUNDLERS: Webpack (2012), Rollup (2015), Vite (2020), esbuild (2020), Rspack (2022), Rolldown (2023)… COMPILERS & STATIC ANALYSIS…
  6. ↝ TRANSPILERS: Babel (2014), SWC (2020)… ↝ TYPE CHECKERS: TypeScript

    (2012), Flow (2014)… ↝ MINIFIERS: UglifyJS (2010), Terser (2018)… ↝ CSS TOOLING: PostCSS (2013), CSSO (2015), cssnano (2015), LightningCSS (2022)… COMPILERS & STATIC ANALYSIS…
  7. MY GOALS FOR TODAY… Bridge the gap between foundational computer

    science concepts and practical front-end development. Open your mind to—or even empower you with—tools to tackle a variety of complex challenges.
  8. THIS SECTION PRESENTS… #1 MODERNIZING LARGE CODEBASES REACT • JSCODESHIFT

    + CODEMODS #2 UNDERSTANDING MILLIONS OF LOC USER-GENERATED CONTENT (UGC) • BABEL • CHEERIO #3 GENERATING THOUSANDS OF LOC CODE-GENERATED TYPESAFE APIS
  9. MODERNIZING LARGE CODEBASES REACT: INTERNALS AND ADVANCED PERFORMANCE PATTERNS/ 📅

    2018 📅 2023 📅 2025 📅 2022 COMPILERS, USER INTERFACES & THE REST OF US
  10. MODERNIZING LARGE CODEBASES REACT: INTERNALS AND ADVANCED PERFORMANCE PATTERNS/ 📅

    2018 📅 2023 📅 2025 📅 2022 COMPILERS, USER INTERFACES & THE REST OF US
  11. JSCODESHIFT: HELLO WORLD export default function transformer(file: FileInfo, api: API)

    { const j = api.jscodeshift; const root = j(file.source); const variableDeclarators = root.findVariableDeclarators('foo'); variableDeclarators.renameTo('bar'); return root.toSource(); }
  12. JSCODESHIFT: HELLO WORLD export default function transformer(file: FileInfo, api: API)

    { const j = api.jscodeshift; const root = j(file.source); const variableDeclarators = root.findVariableDeclarators('foo'); variableDeclarators.renameTo('bar'); return root.toSource(); }
  13. JSCODESHIFT: HELLO WORLD export default function transformer(file: FileInfo, api: API)

    { const j = api.jscodeshift; const root = j(file.source); const variableDeclarators = root.findVariableDeclarators('foo'); variableDeclarators.renameTo('bar'); return root.toSource(); }
  14. STATIC ANALYSIS ENABLED… GRADUAL ROLLOUT OF TWO ENTIRELY DIFFERENT BUILDS

    OF THE SAME CODEBASE, WITH: ↝ DIFFERENT VERSIONS OF DEV DEPENDENCIES. ↝ DIFFERENT VERSIONS OF APP DEPENDENCIES. ↝ DIFFERENT STRATEGIES USED FOR BUNDLING AND SERVING.
  15. UNDERSTANDING MILLIONS OF LOC REACT: INTERNALS AND ADVANCED PERFORMANCE PATTERNS/

    📅 2024 📅 2025 COMPILERS, USER INTERFACES & THE REST OF US
  16. HYRUM'S LAW & ME — BASICS OF THE G2 +

    MEDALLIA INTEGRATION • G2 DOCUMENTATION
  17. CASE STUDY: FINDING PATTERNS const selector = 'span.validation'; $(selector).each((_, element)

    = > { const $element = $(element); if ($element.text().trim() === 'Required') { console.log('Pattern found: Required field'); } });
  18. CASE STUDY: FINDING PATTERNS const selector = 'span.validation'; $(selector).each((_, element)

    = > { const $element = $(element); if ($element.text().trim() === 'Required') { console.log('Pattern found: Required field'); } });
  19. CASE STUDY: EXTRACTING JS BLOCKS $('script').each((_, element) = > {

    const scriptContent = $(element).html(); if (scriptContent) { analyzeJavaScript(scriptContent); } });
  20. CASE STUDY: EXTRACTING JS BLOCKS $('script').each((_, element) = > {

    const scriptContent = $(element).html(); if (scriptContent) { analyzeJavaScript(scriptContent); } });
  21. E.G. STRING UNIONS TO ENUMS AFTER BEFORE enum UserStatus {

    Active = Inactive = Pending = } enum UserRole { Admin = User = Moderator = } type Status = "active" | "inactive" | "pending"; interface User { status: "ACTIVE" | "INACTIVE" | "PENDING"; role: "admin" | "user" | "moderator"; }
  22. E.G. STRING UNIONS TO ENUMS AFTER BEFORE enum UserStatus {

    Active = "active", Inactive = "inactive", Pending = "pending" } enum UserRole { Admin = "admin", User = "user", Moderator = "moderator" } type Status = interface User { status: "ACTIVE" | "INACTIVE" | "PENDING"; role: "admin" | "user" | "moderator"; }
  23. E.G. STRING UNIONS TO ENUMS sourceFile.getTypeAliases().forEach(typeAlias = > { const

    typeNode = typeAlias.getTypeNode(); if (typeNode & & typeNode.getKind() === SyntaxKind.UnionType) { const unionType = typeNode as UnionTypeNode; const literals = unionType.getTypeNodes().filter(node = > node.getKind() === SyntaxKind.LiteralType); if (literals.length > 2) { / / Creating the enum const enumName = `${typeAlias.getName()}Enum`; const enumDecl = sourceFile.addEnum({ name: enumName, members: literals.map(lit = > ({ name: toPascalCase(lit.getText().replace(/['"]/g, '')), value: lit.getText() })) }); / / Removing old type alias typeAlias.remove(); } } });
  24. STATIC ANALYSIS ENABLED… ↝ METRICS AROUND USER-GENERATED CONTENT BASED ON

    PLUGIN COMPOSITION. ↝ ACTUAL DATA IS THE SINGLE SOURCE OF TRUTH AND CONSISTENCY IS GUARANTEED ACROSS ALL ENDPOINTS AND THE REACT APP. ↝ RAPID ITERATION WITH INSTANT TYPED APIS AND ENHANCED DX WHEN IMPLEMENTING NEW METRICS.
  25. MILLION LINT: COMPILER function App({ start }) { const [count,

    setCount] = useState(start); useEffect(() = > { console.log("double: ", count * 2); }, [count]); return <Button onClick={() = > setCount(count + 1)}>{count}</Button>; } — MILLION LINT IS IN PUBLIC BETA • 2024
  26. MILLION LINT: COMPILER function App({ start }) { Million.capture({ start

    }); const [count, setCount] = Million.capture(useState)(start); useEffect( () = > { console.log("double: ", count * 2); }, Million.capture([count]), ); return Million.capture( <Button onClick={() = > setCount(count + 1)}>{count}</Button>, ); } — MILLION LINT IS IN PUBLIC BETA • 2024
  27. MILLION LINT: COMPILER [ 'src/App.jsx': { components: { App: {

    renders: [{ count: 7, time: 0.1 }, . . . ], instances: 3, count: 70, time: 1, location: [13, 0, 23, 1], } } } ]; [ { kind: 'state', count: 7, time: 0.1, changes: [{ prev: 0, next: 8 }, . . . ], } ]; — MILLION LINT IS IN PUBLIC BETA • 2024
  28. ↝ IT'S USED TO DETERMINE IF VARIABLES (OR MEMORY LOCATIONS)

    REFER TO THE SAME UNDERLYING DATA. ↝ IT HELPS COMPILERS OPTIMIZE CODE BY REORDERING INSTRUCTIONS, ELIMINATING REDUNDANT CALCULATIONS AND AVOIDING UNINTENDED SIDE EFFECTS. ALIAS ANALYSIS
  29. function example(arr) { arr[0] = 10; const value = arr[0];

    return value; } ALIAS ANALYSIS DOES VALUE ALWAYS EQUAL 10?
  30. ALIAS ANALYSIS: REACT COMPONENTS function Component({ a, b }) {

    const x = []; x.push(a); const y = x; y.push(b); return <Foo x={x} />; } function Component({ a, b }) { > = > = } — ALIAS ANALYSIS IN THE REACT COMPILER • SATHYA GUNASEKARAN, 2024
  31. ALIAS ANALYSIS: REACT COMPONENTS function Component({ a, b }) {

    = = } function Component({ a, b }) { const x = useMemo(() = > { const x = []; x.push(a); return x; }, [a]); const y = useMemo(() = > { const y = x; y.push(b); return y; }, [x, b]); return <Foo x={x} />; } — ALIAS ANALYSIS IN THE REACT COMPILER • SATHYA GUNASEKARAN, 2024
  32. ALIAS ANALYSIS: EX. #2 function Component({ a, b }) {

    const x = []; x.push(a); const y = x; y.push(b); return <Foo x={x} />; } function Component({ a, b }) { > = > = } ❌ — ALIAS ANALYSIS IN THE REACT COMPILER • SATHYA GUNASEKARAN, 2024
  33. ALIAS ANALYSIS: EX. #2 function Component({ a, b }) {

    = = } function Component({ a, b }) { const x = useMemo(() => { const x = []; x.push(a); const y = x; y.push(b); return y; }, [a, b]); return <Foo x={x} />; } — ALIAS ANALYSIS IN THE REACT COMPILER • SATHYA GUNASEKARAN, 2024
  34. ALIAS ANALYSIS: EX. #2 function Component({ a, b }) {

    = = } function Component({ a, b }) { const x = useMemo(() => { const x = []; x.push(a); const y = x; y.push(b); return y; }, [a, b]); return <Foo x={x} />; } ✅ — ALIAS ANALYSIS IN THE REACT COMPILER • SATHYA GUNASEKARAN, 2024
  35. ↝ IT AIMS TO ADDRESS THE OVERHEAD OF ALLOCATING THE

    CLOSURES AND DEPENDENCY ARRAYS. ↝ THE COMPILER CAN INLINE THE CONDITIONAL CHECKS FOR THE DEPENDENCIES, CACHING THE VALUE AND REUSING THE CACHED VALUE IF THE DEPENDENCIES ARE THE SAME. SSA FORM: OVERVIEW
  36. SVELTE COMPILERS, USER INTERFACES & THE REST OF US 2016

    ⚡ PERFORMANCE ⚙ CODE EXTRACTION
  37. SVELTE ↝ TRACKS VARIABLES AND DETERMINES THEIR SCOPES. ↝ IDENTIFIES

    DEPENDENCIES AND DETECTS REACTIVE STATEMENTS AND EVENT HANDLERS. ↝ SCOPES STYLES TO COMPONENTS AND OPTIMIZES CSS FOR PERFORMANCE. ↝ …AND MUCH MORE!
  38. SVELTE: $$invalidate* ↝ EVERY VARIABLE THAT HAS BEEN REASSIGNED OR

    MUTATED AND REFERENCED IN THE TEMPLATE WILL HAVE THE $$invalidate FUNCTION INSERTED RIGHT AFTER THE ASSIGNMENT OR MUTATION. ↝ IT MARKS THE VARIABLE DIRTY AND SCHEDULES AN UPDATE FOR THE COMPONENT.
  39. JAXER: CODE EXTRACTION < ! - - Database, file, and

    socket access from JavaScript - - > <script runat="server"> var resultSet = Jaxer.DB.execute("SELECT * FROM myTable"); var newPrice = resultSet.rows[0].price; </script> < ! - - Directly call server-side functions from the browser - - > <script runat="server-proxy"> function getPriceFromServer() { return 42; } </script> <button onclick="alert(getPriceFromServer())">Price</button> < ! - - Share validation code on the browser and server - - > <script runat="both"> function validateCreditCard(number) {} </script>
  40. JAXER: CODE EXTRACTION < ! - - Database, file, and

    socket access from JavaScript - - > <script runat="server"> var resultSet = Jaxer.DB.execute("SELECT * FROM myTable"); var newPrice = resultSet.rows[0].price; </script> < ! - - Directly call server-side functions from the browser - - > <script runat="server-proxy"> function getPriceFromServer() { return 42; } </script> <button onclick="alert(getPriceFromServer())">Price</button> < ! - - Share validation code on the browser and server - - > <script runat="both"> function validateCreditCard(number) {} </script>
  41. #1 of 2 Compilers are no longer just for systems

    programming. COMPILERS, USER INTERFACES & THE REST OF US
  42. #2 of 2 Understanding compilers can make you a better

    JavaScript developer. COMPILERS, USER INTERFACES & THE REST OF US