Hacker News new | ask | show | jobs
by ozgrakkurt 9 days ago
You can write code that compiles slow in pretty much any language.

You can maybe even do it in C if you are generating code using scripts or abusing macros.

On the other hand, you can write sane C++ (without stdlib) and clang or gcc is able to compile it extremely fast. Because clang and gcc are really fast.

You can write a rust program without dependencies and it would be extremely hard to make it compile slow unless you are abousing generics or procedural macros. But you can write a 100 line webserver using some framework like axum and it will compile really slow. This is not because Rust is slow to compile or rust compiler being slow.

On the other hand you can write a zig file with a single test and compiling it using Release mode takes 3+ seconds on a modern computer because Zig compiler is extremely slow when using LLVM backend. This is also obviosly not because Zig is a slow language to compile since their own backend (non LLVM) has super fast compilation.