4 ms·
I’ve been coding JS for a decade. Nowadays I wish JS was simpler. I’m fine with ES6 syntactic sugar. I just want the language to do be stricter, safer and faste
by nojvek 6y ago
I’ve been coding JS for a decade. Nowadays I wish JS was simpler. I’m fine with ES6 syntactic sugar. I just want the language to do be stricter, safer and faster. I don’t want to transpile TS into JS. Just make JS strict with monomorphic types.
One thing that really impressed me is how crazy fast golang is. Not just at runtime but compile time too. Esbuild is like 20x faster than webpack. That’s nuts. I see a webserver running on 512MB ram and single core, serving 10s of thousands of requests a second without batting an eye. Just rock solid reliability and performance.
I want to build web apps with low memory, cpu, and bandwidth profile. Give us a simpler language that doesn’t need crazy complicated hotspot profiling JITs. Just make the default, simple thing insanely fast.
Give us better fundamental primitives that don’t need a gajillion build tools.
The JS ecosystem is so complicated nowadays. It just seems we’re patching shit on top of each other without reasoning from first principles.
Disclaimer: I am not saying this specific improvement isn't worth it. I love v8, but I feel we can make magnitudes of higher performance gains by removing things and simplifying such that you don't even need top level complex optimizations.
- marton78 6y agoI think what you want it wasm. You just need to wait for a simple language which compiles to it - or learn rust.
- pwdisswordfish6 6y ago> I want to build web apps with low memory, cpu, and bandwidth profile. Give us a simpler language that doesn’t need crazy complicated hotspot profiling JITs. Just make the default, simple thing insanely fast. What makes you think it isn't? What if I told you that people were creating Electron-style apps over a decade before Electron ever existed? Go use Firefox 0.8 or Netscape 6. Pretty much every part of the UI on your screen that you'll interact with is backed by JavaScript. Keep in mind that this was 15–20 years ago, pre-Windows Vista, where main memory wasn't measured in gigabytes. And that was all pre-JIT! Here's a screenshot of the file listing for the version of AOL Instant Messenger that was built into Netscape Navigator: https://imgur.com/a/ztaMVon https://imgur.com/a/ztaMVon And a shaky cellphone video of someone using it over 10 years later, before AOL shut down the network: https://www.youtube.com/watch?v=apyR0bPnFAo https://www.youtube.com/watch?v=apyR0bPnFAo > Esbuild is like 20x faster than webpack. The problem is webpack and the development style favored by the NodeJS/NPM community. It's filled with bad practices, and they all do it because either no one knows better, or they don't care. JS is not inherently slow. It's exceptionally fast, even. Contrary to popular belief, though, how you write code still matters. The myth of the sufficiently smart compiler (including JITs) is that: a myth.
- crazypython 6y ago> Esbuild is like 20x faster than webpack. Just serve your ESM modules directly from the filesystem. You don't need webpack or snowpack. Build in 0 seconds. You also don't need a transpiler like Babel if you drop support for IE11. Almost all ES6 features– such as classes, proxies, arrow functions, and async are supported by modern browsers and their older versions. As long as you avoid features like static, private, and ??=, you get instant compile times. It's not 2015. You don't need a transpiler to write modern JavaScript. As of writing, the latest version of Safari is 14 and the latest version of Chrome is 88. These features fully work in Safari 13 and Chrome 70, which have less than 1% of marketshare. > The JS ecosystem is so complicated nowadays. It just seems we’re patching shit on top of each other without reasoning from first principles. I agree. I don't use any third-party JavaScript dependencies, except for the occasional framework. You can rewrite many third-party libraries yourself and more specialized to your usecase quickly. Third-party JS libraries tend to have poor performance.
- joquarky 6y ago> I just want the language to do be stricter, safer and faster. I don’t want to transpile TS into JS. Just make JS strict with monomorphic types. You can accomplish a little bit of this with an IDE that supports JSDoc syntax. It will get type hints from your JSDoc definitions and show warnings or errors when you violate those definitions.