4 ms·
I keep seeing Nim and it looks really productive and very interesting! Does anyone know how it compares to Zig?
by jswny 6y ago
I keep seeing Nim and it looks really productive and very interesting! Does anyone know how it compares to Zig?
- entha_saava 6y agoZig is mainly focused on low level programming - every function that allocates takes an allocator argument, there are lot of builtin functions to do low level bit twiddling, doesn't hide any control flow, etc.. Nim is mainly a productivity language. You have GC by default, extensive stdlib, lot of syntax sugar and metaprogramming features. You can create untraced pointers and do manual memory management. Thus, among the new crop of compiled programming languages Productivity languages with GC: Crystal, Nim, Go, Swift (automatic refcounting, not GC) Manually memory managed, low level: Zig, Rust, Odin. Nim can do manual memory management as well but doesn't seem to be primary use case.
- cercatrova 6y agoEven though Rust has manual memory management, I'd say it can be pretty high level due to its functional programming features that are nearly equivalent to Haskell or OCaml.
- entha_saava 6y agoTrue. But rust's aim (at least as its original author envisioned) is for low level systems programming where having automatic memory management is not desired. The aim of safety in low level programming is nice, but that comes with tradeoffs. Eg: not allowing certain patterns and thinking about memory / ownership even when not required. Some vocal minority of rust fanboys herald it like these are not a problem and rust is right tradeoff for every programming task, as if when crab god doesn't like the way you structured your program there is fundamental mistakes in your programming and you should have fixed them anyway. That kind of dishonest, blanket statements are what leads to Rust Evangelism Strike Force memes.
- remix2000 6y agoZig supports zero-effort C binding by reusing existing C headers instead of wrapping them^. The only other language known to me having such feature while not actually being a superset of C is Terra†. I feel like we are still several light years away from the Holy Grail of programming languages, which would retain full compatibility while also being extremely productive. Walter Bright (the creator of DLang) once stated that the least age to develop a feasible programming language is 40-ish+, so hopefully generation raised in the world of modern computing will manage to find the ultimate syntactic solution. ^) https://ziglang.org/#Integration-with-C-libraries-without-FFIbindings https://ziglang.org/#Integration-with-C-libraries-without-FF... †) http://terralang.org/ http://terralang.org/ EDIT: replaced nasty star parsed as markup with a caret. Sorry.
- doteka 6y agoNot sure the age of the original author is very relevant. GvR was 35 when he started work on Python. Chris Lattner was 31 with Swift, Brendan Eich was 33 with JS. These are some of the most used languages today. I’d say it’s more a matter of being in the right place at the right time to serve a particular use case.