3 ms·
Supposing you got interested because of the speed it claims, comparisons on the site shouldn't be taken at face value. Fixing any errors* and for N=2 (2K prints
by forgotpwd16 6y ago
Supposing you got interested because of the speed it claims, comparisons on the site shouldn't be taken at face value. Fixing any errors* and for N=2 (2K prints), the times for some of the languages (running ten times and taking the average) are:
C 0.24s (gcc 9.3.0, gcc $file)
C++ 0.96s (gcc 9.3.0, g++ $file)
Go 0.12s (go 1.15.2, go build $file)
Nim 0.44s (nim 1.2.6, nim c $file)
V 1.37s (v 0.1.29, v $file)
Zig 16.9s (zig 0.6.0, zig build-exe $file)
I guess Zig does some optimizations but not sure how to turn them off. Someone should do an analytical comparison for all of them and different values of N.
*The generated V test doesn't work with the latest version as `;` between expressions throws a bad token error and zig requires `a` to be `.{a}`.
- nurettin 6y agoWhat I look for in a language (in no particular order): - Yes, fast compilation. - Generics, templates or a decent macro system - Defer, finally or scope based resource allocation - Some way of handling coroutines (async/await or channels) - Supports Linux AIX/x64, Win64, ARMv7/8, Darwin - Tooling for OSX, Android, Linux, Windows - Supports clojures, blocks or at least inline functions - Supports ranges, lazy iterations, generators or at least yield FPC actually comes close, except it doesn't have clojures coroutines or generics.
- TurboHaskal 6y agoIt's actually disappointing to see so many people looking for a cleaner C++ with faster compilation times, or a Go with generics and manual memory management, yet completely overlooking FPC.
- pjmlp 6y agoIt does have generics.