‹ BackHN Continuity

Thread

The JavaScript Midlife Crisis

56 points · 75 comments · maroun-baydoun

  1. agentultra · · focus · HN ↗
    You can wait for slow programs that use a ton of excess memory, sure.

    Or, you can have fast programs that use memory efficiently.

    You just can’t do it in JavaScript. You can get really performant with JavaScript with careful engineering for sure… but there’s a big wall of diminishing returns even with all of the JIT compilation and tracing garbage collection.

    Nothing stopping those same JS developers from learning some Zig or Rust or whatever. It might actually be easier to learn than memorizing all of JavaScript’s implicit coercion rules.

    But if that’s too much to ask then stay in JS land and make sure there are JS devs to write tools for!

    1. suplexer · · focus · HN ↗
      Instead of writing utilities, libraries, guidelines, build-time transformations, etc to help (or even) force JS devs to stay on the happy path, the industry "experts", large companies, and thought leaders chose to go the exact opposite route with React and adjacent tools. The results speak for themselves...

      Even the V8 team gave up on documentation: <a href="https:&#x2F;&#x2F;v8.dev&#x2F;blog" rel="nofollow">https:&#x2F;&#x2F;v8.dev&#x2F;blog

      There is nothing stopping JS devs from working with byte buffers with near-zero overhead.

      1. agentultra · · focus · HN ↗
        Yeah, you can go pretty far with JS performance. I’ve been a fan. I find it’s harder to maintain than C, Zig, C++, Rust, etc. It’s really easy to break performant JS code. No types, allocations are hard to control without extreme discipline. It’s so flexible and you have to give up a lot of that to get performance out of JS.

        React is a whole beast.

        It would be neat to see some JS devs killing some benchmarks.

        1. suplexer · · focus · HN ↗
          Yea, it does require great discipline but I&#x27;ve been surprised by the lack of tools to help with writing high performance js.

          Surely there can be some middle ground were you just want some small part of your app to run faster without including another tech ecosystem (locked within a Wasm sandbox).

Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.