Viewing a single comment thread. View all comments

3

musou wrote

javascript is an OK language to use for some things, but it has a lot of annoying aspects that make it difficult or just unsuitable for many kinds of programming. for example, there is still no real integer type in JS, which means arithmetic is potentially subject to floating point rounding errors, so it's very easy to shoot yourself in the foot if you're having to operate on, e.g. amounts of money, or other applications where precision is absolutely critical.

it's also the case that most (but not all) js libraries and frameworks are written without much regard for mutable state - which makes sense given that the original context for the language is inside the browser, where the Document Object Model basically treats the entire content of a web page as a giant global variable that can be accessed and mutated from anywhere in your program. this can make large js applications, even those not running in a browser, very difficult to debug when something goes wrong.

it also lacks good language-level primitives for concurrency compared to some other languages, which is something that is becoming increasingly important as CPU clock speeds aren't really going to be getting much faster anymore, and program authors need to spend more time making sure they're making good use of all the CPU cores available. i spend most of my programming time writing code that targets the erlang VM, and the lack of a first-class primitive datatype to represent processes/threads is the feature i miss most of all when working in JS.

2

twovests wrote

Ooh I have nothing to add but I appreciate this perspective, esp. as someone who hasn't done anything real with concurrency

2

bea wrote

there is still no real integer type

the language always had proper signed and unsigned 32bit int support, though tbf it was boxed in 64bit floats, now we have BigInts

lacks good language-level primitives for concurrency

I guess "good" is the key word there but just in case I'll mention that we have: Workers in the browser and Worker Threads in Node.