Comments by "Christian Baune" (@programaths) on "Haskell Is Faster Than C | Prime Reacts" video.
-
Why do seniors tend to forget that code is written for being used?
We use Java because the JVM keeps stats on the code being run and can prune code that is seldom used, reorganize conditional so the hot path is the one that will be continuous in memory,
JVM will also do escape analysis so you can create objects; the executed code will not have those objects.
You can't write "fast code" because pattern usage changes. You want something that can monitor its use and rewrite it.
In that sense, everything that is compiled AOT is "slow." So, C is slow according to that standard.
Using C would be shooting in our foot on a multitenant system, where code should espouse how it's used.
Unless we can see that, for some reason, the software is always used in the same way, then we can beat the JVM by fine-tuning.
To better understand, it's like stating that a drag race car is faster because you always used it in a straight line.
Then someone else will tell you that the Veron is faster than the drag car because when there are a few turns, the drag race car does shit.
Then someone else comes with a panda and tells you it's much better in the city.
That's compiled languages.
Now, imagine a car that could do all of this because it would see that you're in a city and reconfigure its cartography and the type of tire to suit the environment.
Now, the downside of that car would be that sometimes, it would be adapting, especially if you are in a continuously changing environment.
Luckily for you, the environment doesn't change that fast in real life. So, you would beat the 3 other cars.
And sure, those cars would kick your ass in the first few seconds for a given task with a specific usage. I think the trade is worth ^^
And for those at the back of the room, this doesn't argue against compiled language. This shows that each has a specific use.
And so, no, it's not always a skill issue. It's a seniorism issue ^^
1