|
|
|
|
|
by Animats
264 days ago
|
|
In a compiled language, it takes one or two machine instructions to test assert!(b >= a);
Works in C, C++, Go, Rust...Amusingly, nowhere in the original article is it mentioned that the article is only about Javascript. Languages should have compile time strong typing for at least the machine types: integers, floats, characters, strings, and booleans. If user defined types are handled as an "any" type resolved at run time, performance is OK, because there's enough overhead dealing with user defined structures that the run time check won't kill performance. (This is why Python needs NumPy to get decent numeric performance.) |
|
It seems like the point of the article was to not do that though, contrary to my own opinion, and I just wonder why...