News for hackers. Stuff that matters.
Re:Nim 2.0 thoughts by eikenberry on Saturday May 15, 2021 @02:50PM (#27167840)
How is the compiler, speed wise? One thing I really like about Go and really don't like about Rust are their relative compiler speeds. I think it makes a big different for the language and Nim has a chance to get this right as they didn't make the mistake of using LLVM and it's bad compiler UX.
Re:Nim 2.0 thoughts by nimmer on Saturday May 15, 2021 @03:25PM (#27168106)
Nim compiles to C and then runs GCC (not LLVM) to compile the binary. Overall, it's much faster than Go and Rust.
Re:Nim 2.0 thoughts by isubasinghe on Saturday May 15, 2021 @07:43PM (#27169961)
I get that Nim can be faster than Go but I don't see how it can be faster than Rust, could you please elaborate as to why?
Re:Nim 2.0 thoughts by FridgeSeal on Saturday May 15, 2021 @09:12PM (#27170376)
They probably mean the compilation is much faster than Rust.
Re:Nim 2.0 thoughts by nimmer on Sunday May 16, 2021 @07:30AM (#27172926)
I was referring to compilation time... given the question.
Re:Nim 2.0 thoughts by iamcreasy on Saturday May 15, 2021 @08:43PM (#27170246)
Is transpiled C readable?
Re:Nim 2.0 thoughts by nimmer on Sunday May 16, 2021 @07:28AM (#27172921)
It is. It's just not very pleasant to read due to the autogenerated variable names.
Re:Nim 2.0 thoughts by planetis on Sunday May 16, 2021 @04:57AM (#27172296)
If you disable all runtime checks, like integer overflows, range checks, etc..., stack traces and debug information (-d:danger) it's readable yes.
Re:Nim 2.0 thoughts by mrweasel on Saturday May 15, 2021 @03:43PM (#27168288)
For my small learning projects, on old hardware, I’d say about the same as Go.
Re:Nim 2.0 thoughts by TylerE on Saturday May 15, 2021 @03:18PM (#27168038)
Pretty good. The actual compilation is via clang, so there's a lot of heavy lifting done by that.

So basically nim actually compiles .nim -> .c -> binary

Re:Nim 2.0 thoughts by elcritch on Saturday May 15, 2021 @06:48PM (#27169684)
It’s good to note that the C/C++ generated by Nim compiles much faster than normal C/C++ code since they don’t include a lot of headers.