4 ms·
Just curious why Zig was chosen compared to the other languages out there for high performance computing like Go, Rust, Nim etc. Was it just because you were fa
by cercatrova 4y ago
Just curious why Zig was chosen compared to the other languages out there for high performance computing like Go, Rust, Nim etc. Was it just because you were familiar with Zig or were there deeper reasons related to the programming language?
- com2kid 4y agoOf the languages you mentioned, Go and Nim both have runtimes, for a product focused on performance above all else, that is just asking to leave performance on the table. As for Rust and Zig, IMHO, programming in Zig is more fun, so if I was OP, I'd also have gone for Zig.
- winrid 4y agoThe nim runtime overhead is very small. In my tests it was very easy to out perform the latest Node and Java runtimes with shorter, and still type safe, code.
- generichuman 4y agoIt is _really_ small, especially if you're using the ARC. I have some criticism for the language itself around personal preferences, such as "concepts need to be finished ASAP", "don't depend on libc" (Zig is doing a much better job here) and some syntax pet-peeves. Nim needs to be more popular IMO. Well, the same goes for D too. Sigh.
- himujjal 4y agoI would have used Nim for just about everything, had there been: 1. Support for cyclic imports 2. Official WASM support. I know nlvm exists. But those are two separate runtimes to be managed for long time.
- sekao 4y agoI believe cyclic imports are coming. And Nim does supports wasm...you can target it with `--cpu:wasm32`. You most likely want to pair that with emscripten as in https://github.com/treeform/nim_emscripten_tutorial https://github.com/treeform/nim_emscripten_tutorial
- himujjal 4y agoYeah. checked out wasm part. But man. I am not going to go into Nim without cyclic imports. I was writing a compiler I remember where I hit the 5k LOC mark in Nim. And then the errors and stuff. It was a terrible experience putting all the types into one file, the functions into others etc etc. The DevExp is bad that way. Other than that, I don't see much issues with Nim to be fair. Its quite a good language that ticks all boxes
- winrid 4y agoI want to use D for a new company idea I have. The library situation just isn't there though, which is always the problem.
- generichuman 4y agoIts interoperability with C and C++ is top notch, if you're willing to work with libraries in those languages.
- winrid 4y agoThat's what I've been hearing. Some problems are - vibe.d does not look nearly as performant or supported as, say, Drogon, which is what I was seriously considering using (I love the idea of using C++ with modern move semantics and coroutines to make async code easy). I know and love Java and Node a lot - just want to try not using a VM for a bit :)
- socialdemocrat 4y agoI have seen several others remark that when you really need to squeeze performance Zig does better. Currently writing a small Zig project, I can totally see that. Although frankly I will probably stick to Go. Zig is a lot more work in my view as it os very low level. However that is also what helps you squeeze out performance. With Zig you really get a fine grained control of memory management and it is a lot easier to push anything you can to be computed at compile time rather than runtime.
- Jarred 4y agoI’m very productive in Zig. I had trouble being productive in other languages while also writing performant code