Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

JavaScript is two languages:

1) JavaScript, the original assembly language of the internet, does not need new language features.

2) JavaScript, the front-end web development language is a fractal of infinitely many sub-languages that transpile back to ES5.

The proposal, as I read it, is: Let's stop adding front-end web features to the assembly language; it doesn't get easier, better or faster if we change the underlying, slowly adopting and hard-to-optimize foundation.

When you want a new language feature, add it to the fractal part that transpiles back to the part well-supported and highly optimized in existing runtimes. The only loss is that you need to transpile, so your build pipeline becomes non-trivial. But it's either "code assembly" or "get a modern build tool".



This isn’t really true on a practical level any more. ES6 support is very widespread (97% of all web users according to caniuse.) That even includes module import syntax!

There are still some new language features that need to be transpiled, but most projects do not need to worry about transpiling cost/let/arrow functions/etc.

I mean even newer features like nullish coalescing and optional chaining are at 93-94% support.

At the end of the day, I would say tools like babel for transpiling are less and less important. Yes, you still use a bundler because the web has a lot of runtime constraints other native applications don’t have (gotta ship a tiny bundle so the page loads fast), but it’s better for the language features to be implemented in the VM and not just faked with more JS.


Interesting.

I did assess the ES6 coverage of ~97% a month ago.

I just evaluated that while it sounds high, 3% of people is a lot of people to cut off if your JavaScript is essential.

E.g. Firefox sits at ~2.7% browser market share. (Not incidentally the part that doesn't support ES6, but it's a demography the size of my own.)


> 3% of people is a lot of people to cut off if your JavaScript is essential

These are probably the 3% that won’t affect your business much. They’re more likely to be on older hardware and also have less discretionary income. Or browsing on really weird hardware that is also unlikely to lead to a sale.


People with "less discretionary income" still deserve to access the web in a way that isn't broken. This might come as a surprise nowadays, but the web can be useful for more than just selling things.


I have a $30 cell phone that runs the latest version of Chrome.


I'm just responding to the premise of the parent comment; I don't have any strong sense one way or another whether it's accurate or not.


I always assumed it was people browsing on work computers that they don't control.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: