By being more conservative, you can achieve more with less resources.
The difference is that a "systems programming language" has the capability of being used low level if needed while a "shit scripting language" such as javascript does not. Basically what I am saying here is that Javascript is an underwear taint-stain for modern computer science. With any luck it will be rid of this world in 20 years and you javascript programmers can stop torturing yourselves with new "hot libraries" and "ECMA transpilers" every 2-4 years.
Is that supposed to be an endorsement?
foo = (string, number) => string + number
Now go write that in your preferred language! "You have " + messages + " new messages"Glorious!
This is type safe.
print!("You have %d new messages", messages)
Was that supposed to make me want to abandon all type safety and embrace a GC'd language that runs in a VM?If you want GC there are any number of good languages to pick with it (e.g. OCaml).
> Also when something goes wrong with types in JavaScript the worst case scenario is "2"+2 turns into "22" witch is easy to avoid, compared to a silent overwrite/overflow.
It's memory-safe but it's not safe. What if an error like that happens in your permission-checking code? I agree that silent overwrites and silent overflows should not happen and that language that have those things are bad, but that doesn't make silent type errors any better.
Um, yeah. I think that's a fair comparison. And anyone who's had to debug or maintain a large system written in assembly/javascript knows why that's a bad idea.
> even Rust has runtime GC
Only in an extremely narrow sense; there's no tracing GC, only reference counted types. And they're not used very often.And yet Javascript can't access a network socket or my flash storage in any useful portable way.
Javascript is hampered by everybody trying to bolt on "security" after the fact and basically hobbling usage of the language.