4 ms·
TypeScript is not a feature of JavaScript, and the ability to have single-threaded IO event loops is far, far, far from something modern, unique or remarkable a
by mixedCase 4y ago
TypeScript is not a feature of JavaScript, and the ability to have single-threaded IO event loops is far, far, far from something modern, unique or remarkable about a language, the fact that it's limited to single-threads actually makes it something you really do not want to bring up as a "pro" but rather as "it's something you'll have to keep in mind".
- hombre_fatal 4y agoTypescript is certainly a feature of the Javascript ecosystem. Typescript's success and maturity easily puts it ahead of other dynamically-typed languages that tried to bolt on static typing support. Not including TS with JS just seems like a pointless "well actually" quibble. Single-threaded + async-everything is a unique and powerful feature of Javascript. You might not like it every time, but it's useful most of the time. Most other languages make it easy to write single-threaded but blocking code where you need to reach for an extra solution to write async code, and not everyone needs to even use the same solution, and it doesn't necessarily work with the default blocking ecosystem. We take that for granted in Javascript. Once again, this is a very tired thread. Sometimes you just have to admit there are trade-offs and that you aren't going to have a taste for every decision on every trade-off every time. And that's okay. Nobody in this thread is even interacting with TFA.
- actionfromafar 4y agoIt’s a feature which follows from how web browsers work. I agree with above comments that you could have taken any language. But you have a point, making async mandatory is a powerful thing. This could have been done to any language tho, Java, TCL, Scheme, whatever.
- blacksqr 4y agoTcl already has built-in event loop and async programming features.
- actionfromafar 4y agoYes, sure. Many languages have them now. (I'm not sure what TCL looked like in 1995. SUN actually had an idea to promote TCL for both frontend and backend work, but then Java happened.)
- blacksqr 4y agoTk debuted in 1993, so I presume Tcl's event loop features were in place by then. IMO Tcl would have been a vastly preferable choice for a browser scripting language. Text is its native data type, and would have minimized impedance mismatches with other functional areas of the text-based HTML/HTTP environment. Also it would have been far easier for newbies to get started with web script hacking. At the time JavaScript seemed like alien algebra to a lot of non-computer science majors.