(no title)
norswap | 1 year ago
- You need strong performance, your choices are:
* C: nope, unless it's super simple library-type code, must integrate as easily as possible with everything C compatible
* C++: unless you have ecosystem lock-in, avoid this mess, stuck in an evolutionary rut where they can't undo bad decisions and keep adding more complexity (mostly good stuff, but total complexity too high)
* Zig: better than C & fully compatible with it
* Rust: ecosystem tailwinds, bit better safety than Zig, steeper learning curve and uglier code
* Go: ok but GC probably means not the best perf
* Java: JIT means it can handily beat non-painstakingly hand-optimized C code in some particular cases (requires a lot of wisdom to choose this for perf)
* something that will incur a lot of pain in some other way like Fortran, Forth or Ada
- You need to export to C code (all of the above have options to import from C code with C/C++/Zig being the easy choices) * C: ez
* Zig/C++: harder but still ez, need to write some wrappers when using features nont in C
All in all, for new system or high-perf work with no ecosystem tie in, it's probably a battle between Rust and Zig. I think I'd use Zig on aesthetic grounds — find it less painful to use than Rust, and I'm not too worried about missing on the extra safety. The converse decisions seems reasonable too.
No comments yet.