Hacker News new | ask | show | jobs
by tester756 1043 days ago
>while also having high runtime efficiency as a requirement (the reason why C/C++ are such prominent languages for compilers

I'd want to believe that compiler engineers really put effort into compilers performance, but I just don't buy it.

LLVM, GCC, MSVC, etc, etc all of them touch C/C++ and are slow as hell

For compilers written in other languages I'd say that still LLVM is the bottleneck

>It avoids the cost of automatic memory management and provides low-level control.

What "low-level control" do you need? It is not firmware development.

Btw: Microsoft rewrote their C# compiler from C++ to C#.

2 comments

Any compiler that gets used at runtime (branded JIT, usually) ends up growing performance hacks or being written from scratch to run quickly. Javascript is prone to using multiple compilers based on how frequently code was executed. That's also what the whole -O0 -O3 -flto -thin-lto -pgo etc flags are about, granting permissions to burn different amounts of time during compilation.

It's really easy to accidentally write code that walks off a performance cliff on unexpected input, but that's likely to get hacked around if someone reports it as slow compilers do annoy people.

Ehh, I don't think we were talking about just JITs.

JITs are just some part of what's under the general "compilers" term

Did Microsoft rewrite their C++ compiler in C#?
They did in the past, in something like LLVM, but based on MSIL, it was called Phoenix done by Microsoft Research.

In any case, it wouldn't make sense from having a bootstraped compiler point of view.