4 ms·
I've touched Zig a few times over the last year or so, and I like it, but I am still itching for something else that is not as complex as Rust, but not too clos
by eggy 5y ago
I've touched Zig a few times over the last year or so, and I like it, but I am still itching for something else that is not as complex as Rust, but not too close to C. I am now playing with Scala Native[0] just to see how it works on the low-level stuff. Zig is amazing especially since you can use the compiler as an alternative C compiler too[1].
I like Lisp and APL, so I have been learning April[2], a subset of APL in Lisp. It is very cool, if you like Lisp and APL. The game in Zig in the article reminds me of the Dyalog APL simulation of a boat navigation app developed in Finland using APL[3].
[0] https://github.com/scala-native/scala-native https://github.com/scala-native/scala-native
[1] https://andrewkelley.me/post/zig-cc-powerful-drop-in-replacement-gcc-clang.html https://andrewkelley.me/post/zig-cc-powerful-drop-in-replace...
[2] https://github.com/phantomics/april https://github.com/phantomics/april
[3] https://www.dyalog.com/case-studies/simulation.htm https://www.dyalog.com/case-studies/simulation.htm
- MisterTea 5y ago> ...something else that is not as complex as Rust, but not too close to C. Go might be what you want. It's boring which means it just works with healthy tooling and libraries. I call it the true successor to C with a 1990s bell labs feel.
- LeonenTheDK 5y agoInterestingly two of the creators of Go did work at Bell Labs. https://en.wikipedia.org/wiki/Ken_Thompson https://en.wikipedia.org/wiki/Ken_Thompson https://en.wikipedia.org/wiki/Rob_Pike https://en.wikipedia.org/wiki/Rob_Pike
- eggy 5y agoFunny you should say that. I barely touched Go, but I felt immediately at home with it from my C experience. Boring is good most of the time. I don't know about Go routines, etc., but the GC differentiates it from C, Zig, Rust, and Scala Native (AOT). I hear a lot of good things about Go including salaries ;)
- donpdonp 5y agoAlso consider https://vlang.io/ https://vlang.io/ - its similar to Go with some new ideas.
- hermanradtke 5y agoI think V is still too new and trying to find its footing.
- eggy 5y agoI had tried vlang last year in June. Has it changed much? It seems to be syntactically close to Rust and Zig. I tried building it with MSVC back then, and it failed (closed issue #5399). I'll have to try again, since they seemed to have fixed it on March 27, or at least showed it compiling correctly in the same manner I had tried.
- dilawar 5y agoHave a look at nim.
- eggy 5y agonim is good, and I was onboard when it was nimrod (liked that name better!). It's very good. Here's where my supposedly polyglot objectivity falls prey to subjective syntax like/dislike. I am not a fan of python's syntax, so nim resonated the same with me. I really love APL/J and Lisp. If Haskell had more uptake in the pragmatic world with a cohesive ecosystem, and more libraries, I would probably be all in. Nim has the ability to --gc:none, so maybe I should take a look again. I found a few libraries, but there didn't seem to be many in machine learning/optimization.
- int_19h 5y agoD, perhaps?
- eggy 5y agoD seems to have a lot of strengths as being less complex than C++, and I have heard great things about it. It seemed to be a better C++ rather than a low-level C. Is that mostly a true statement? Is Bartosz Milewski still a member of the design team?
- int_19h 5y agoThe way I'd describe it is, it can easily be as low-level as C - stack-allocated arrays, unions, pointer arithmetic etc, even inline assembler - but the object-oriented layer on top of that is more similar to C# or Java than to C++; hence why I thought about it when you mentioned Scala. It's in a spot similar to Go, in that it doesn't have a VM, but is normally used with a garbage collector (the core language can do without it - the libraries are another matter, though). However, unlike Go, it doesn't adopt the "less features and more boilerplate is better" approach to PL design. OTOH it does have templates (not just generics) every bit as powerful as C++ ones and then some - but also with fewer footguns, and overall easier and more pleasant to use. You might also find it interesting that the D compiler has a mode that is specifically called "BetterC", which basically removes all features that are dependent on the D runtime library (GC etc): https://dlang.org/spec/betterc.html https://dlang.org/spec/betterc.html
- eggy 5y agoThanks for the informative reply. I'll have to try the BetterC mode. Scala Native allows you to do all the low-level stuff in the syntax of Scala with Java and C libs available that logically work at that level. Obviously, JVM-dependent libs will not work when you're bit banging with Scala Native. I just picked up the, "Systems Programming with Scala Native" book, which is promising for what I want to do. I just don't have any experience with it on real systems project yet...