8 votes

ECMAScript 4: The missing version

3 comments

  1. [2]
    overtowed
    (edited )
    Link
    As someone who uses a lot of JS, there's a lot I like in ES4, but I'm also happy with how things evolved over the years without it. Just an ignorant take here: this reminds me of a political deal...

    As someone who uses a lot of JS, there's a lot I like in ES4, but I'm also happy with how things evolved over the years without it.

    Just an ignorant take here: this reminds me of a political deal where all parties get some pork for their constituents. Everyone gets some of what they wanted, but in the end it looks bloated and wasteful from a lot of angles.

    It's impossible to know where we'd be today had ES4 been adopted. People more informed than me probably have opinions worth listening to.

    You could tell a story that the web would be far ahead today, having innovated past its early awkward years into a language that helps everyone make great stuff. Think of all the more interesting problems the language designers could be working on. The web flourishes even more in the long term.

    I think the opposite story is also plausible - that we'd have an even more bloated web, with certain decisions blocking or worsening important innovations like ES modules and WASM. We politicked ourselves into a corner, and we can't break backwards compatibility to free ourselves. The web stagnates even more in the long term.

    One concrete example of what I think improved over time is the module/package system. It doesn't look like ES4 allowed loading modules/packages from URLs, which isn't very webby. Maybe a followup implementation would have come. But would it have ever supported tree shaking, or would it be stuck without good static analysis like CommonJS? That's no trivial point.

    Losing ES4 allowed the language's users to vote with their feet about which type system they want. I think it's working out quite well with TypeScript, for all of its problems and frictions, which are numerous and painful without a doubt.

    Standards are difficult and messy and full of unwanted compromise, but IMO they're critical to getting our technology to work for us in the long term, rather than other powers.

    3 votes
    1. Akir
      Link Parent
      That's a bit sad, personally speaking. I don't think that having a programming language fall to the whims of the commons is a good thing. Programmers always want to be using whatever's new and...

      Losing ES4 allowed the language's users to vote with their feet about which type system they want.

      That's a bit sad, personally speaking. I don't think that having a programming language fall to the whims of the commons is a good thing. Programmers always want to be using whatever's new and shiny. And when it comes to the history of Javascript, nobody was willing to wait. Far before they were standardized, there were libraries to add new features and APIs to the language. That's when frontend codebases started to really bloat. The author says it best:

      Perhaps if ES4 landed, fewer people would need complex build tools like Babel, Webpack and Typescript.

      And while I don't think that accommodating programmers is a bad thing by any means, it seems that JS has a lot of 'cruft' in the language design, with a number of features being essentially forgotten about because they were implemented poorly or are simply unpopular.


      On a different line of thought, I'm sure you have probably heard a lot of outsiders saying that they wish that we could start all over again with web applications without the weight of HTML/CSS/JS. If XHTML and ES4 happened, I think they would be the happy web developers of today.

      Natively being able to use types and a better Class-based inheritance system are two features that would make JS more appealing to an "old school" type programmer like myself. As it is, I'm waiting for the tooling for WASM to get good enough that I can run Python, Java, Rust, or whatever language of my choice for frontend development.

      2 votes
  2. nothis
    Link
    Wait, javascript was about the get int?

    Wait, javascript was about the get int?