Constrained languages are easier to optimize

11 PaulHoule 4 7/27/2025, 9:21:13 AM jyn.dev ↗

Comments (4)

habibur · 3m ago
Brings back nostalgic memories from Java days in the 2000s. "Java will be faster than C" for exactly the same reasons laid out in the article.

And here we are, 20 years later.

holowoodman · 43m ago
But the potential of easy optimization does not mean that they will be optimized. Compilers for higher-level languages are full of broken promises around their potential. "Faster than C because we can optimize" is never really realized, except in maybe one benchmark that only works in that one exact scenario and nowhere in my code...
Ygg2 · 37m ago
> Compilers for higher-level languages are full of broken promises

Sometimes because C is lingua franca of low level.

Some noalias optimizations Rust had didn't work in LLVM, because no one bothered using it before in C.

This goes even further to hardware. C-like null terminated string search SIMD is faster than a saner (pointer + len ) string view. So it's faster to append null to end of string view than to invoke the SIMD on string slice.

greatgib · 1h ago
Thank you Captain Obvious!

But easier to optimize doesn't necessarily means that they could be optimized to be more performant than less constrained languages.

No comments yet