Hacker News new | ask | show | jobs
by kajiryoji 1650 days ago
I see nim being compared with the same languages as zig. Does anyone has any opinios regarding how nim vs zig?
3 comments

They have the same amount of letters in their name, both have "i" as the second letter.

Zig is (a much) better C. Few solid features.

Nim is a better (Pascal+python+lisp)/3. Lots of features. Some are solid.

They kind of occupy two different niches, IMHO. I see Nim more as a competitor to Go, whole Zig wants to replace C mostly and somewhat competes with Rust in that regard.
zig's IR is llvm, while Nim's IR is C/C++/javascript. C supports more platforms than llvm.

zig: no macros plz

nim: macros are amazing

FWIW, there’s nlvm which is a fork of Nim that emits LLVM IR directly.
Zig has a work in progress C backend so it does not only generated llvm IR. Also to ve more specific Zig is macros are awesome but best implemented as C++'s comptime.