6 ms·
zig , ocaml, odin many system languages are making the headlines lately its very hard to pick one to learn not sure how to deal with this, learn them all, be
by systems 3y ago
zig , ocaml, odin
many system languages are making the headlines lately
its very hard to pick one to learn
not sure how to deal with this, learn them all, bet on one, what should we do
- leosanchez 3y agoocaml is a systems language ?
- golergka 3y agoIs ocaml a system language?
- avbanks 3y agoYes believe it or not ocaml is a systems language.
- systems 3y agoyes it can be used to create systems and backend tools - it is used to create an OS https://github.com/mirage - it is used to create a transpiler https://melange.re/v2.2.0/ - it was used to create Rust first compiler ocaml is surely a systems language
- Rendello 3y agoThe predominant OCaml shop is Jane Street, they have a good podcast where they talk to those involved in their infrastructure. A lot of the episodes go into the tradeoffs between the GC'd and functional OCaml vs languages like C++ and Rust: https://signalsandthreads.com/ https://signalsandthreads.com/
- Buttons840 3y agoThere's nothing "system" about a compiler. What language hasn't been used to create a compiler or two? If languages used to create compilers are system languages, then all languages are system languages. Writing a OS is more "system", and certainly those using the Mirage operating system use OCaml as a system language.
- actionfromafar 3y agoSo sad IncludeOS https://github.com/includeos/IncludeOS https://github.com/includeos/IncludeOS is no longer developed.
- akprasad 3y agoIt depends on what you mean by "system language." For me, this category mainly includes languages that provide fine-grained control over memory management (C, C++, Zig, Rust, ...), so I personally wouldn't include OCaml.
- thefaux 3y agoThis question reminds me of is golf a sport or a game? A colloquial definition of systems language seems close to: "exposes low level details and doesn't have garbage collection." By this definition c, c++, zig and rust are system languages, java and ocaml are not. Go is debatable (and people do debate this). Personally though, I prefer to think of what types of _systems_ I can build with a language. I can design a framework in a high level language which then transpiles to, say, c. I consider this high level language to be a systems language because it facilitates a system (the framework). Others will disagree but it comes down essentially to a semantic question over what counts as a system language. That debate doesn't seem especially fruitful to me.
- lmm 3y agoIf Go is a "system language" then OCaml certainly is. It's suitable for writing system tools in, and people do. TBH the whole concept is pretty meaningless though.
- kazinator 3y agoShell is a systems language; people boot systems with it, including embedded.
- oconnore 3y agoI think the two main ones are Rust and Zig. This may be controversial (but it seems very obvious to me) that: Rust is created in the same spirit that created and evolved C++: create a complex and featureful language that enables compiling your solution from a high level representation in an expressive/safe/performant way. Zig is created in the same spirit that created and evolved C: create a simple language that allows you to directly and transparently represent and reason about what you want to have happen. You'll probably think that one of these statements is more biased than the other, and that probably reflects your own preferences :)
- throwawaymaths 3y agoI think a stronger statement is that zig is explicitly created to out-C c. Even the high level comptime stuff evolved out of simplification and explicit-ification of some opaque things that c (and especially c++) compilers might do.
- FoodWThrow 3y agoThere's something to be said about philosophy of simplicity in C. However, C pretty clearly evolved into the opposite direction. This is nearly all due to compiler developers, and the fact that C has to cater to so many different hardware requirements. Unlike C++, ISO C is nothing more than culmination of features that more than 1 compiler has implemented (and doesn't interrupt the compilation process of a micro-controller firmware that was released literally 40+ years ago). Anything else, is GNU C. And it is so incredibly complex and obtuse at times that clang still can't compile glibc after years of work. Zig was not created with the same spirit that created and evolved C. Zig was created with the idea of a simple C, one that does not match reality, and frankly leans more on Go rather than C. Zig, Odin, V, nearly all these better-C languages are more inspired by Go itself, than what C actually is. What they want from C is just the performance; that's why they're so focused on manual memory management one way or another.
- throwawaymaths 3y agoZig borrows some ideas from go. Probably defer is the big one, but if you watch "the road to zig 1.0" you will understand that zig is not really a go derivate. Most things in zig are directly addressing issues in c. If you squint zig's error return fusion looks a bit like go's tuple error return but it actually is more "first-classing certain c conventions" than "adopting a go pattern". Same goes for slices.
- brabel 3y agoI was in the exact same situation. I know Rust but don't want to use it for everything... had a look at: Zig - attempts to stay simple, like C, but with warts fixed and with cool compile-time programming. Its biggest strength seems to be not the language itself, but the compiler and build system which can cross-compile seamlessly, including C code. Nim - a systems-language that looks like Python and tries to be fun to write. Has macros that may remind you of Lisp macros. Compiles to C or JS. D - older but very cool as well... I was surprised to find out its metaprogramming capabilities are as good as Zig's or Nim, and that is has a lot of cool features not seen in mainstream languages, like contract programming and executable documentation. Much more mature than the previous ones. Also seamlessly compiles and imports C. Odin - really reminds me of Go. It's used in production to create fluid simulation for Holywood movies apparently. Very minimalistic language but I couldn't see what it brings to the table that the ones above do not. It's kind of similar also to Jai which is also upcoming but focusing on game programming from what I understand... that's still not even publicly available yet. Which one to choose really depends on your taste, hope my descriptions above help, even if they're pretty rough simplifications. If you want the most popular language in this area, that's undoubtedly Rust though.
- generichuman 3y ago> its very hard to pick one to learn If you don't know it already, you learn C, as well as you can. It is not a hard language to learn, but it has a lot of footguns. That's why you learn it along with tools like Valgrind & sanitizers. Then you look at Rust. That's somewhat harder to learn, but nails some important details you need to think about while writing C. It will make some things obvious that you'd need to learn by shooting yourself in the foot repeatedly in C. You don't need to use Rust once you got what you need out of it education-wise, but a lot of people like and use it. At this point it is kind of unimportant what other "systems" language you decide to learn, but here's my opinion of some of them: - Personally I like Odin's ergonomics. It is incredibly convenient. You can just jump in and start writing OpenGL code without dealing with wrappers and all that. Included vendor libraries take care of a lot. - I also like the explicitness of Zig. It seems like it'll be the most popular one in the future, most likely not because of the language itself but because of the tooling. By the way the reason I say "not because of the language" is that the maintainers seem uninterested in having some way to constrain generics. The language sorely needs some sort of comptime interface / traits / concepts, anytype-everything is not nice. In 10 years someone will come up with a Boost-like library that implements just that in userspace and it'll be horrible. - Ocaml is garbage collected Rust, or rather, Rust is non-garbage-collected Ocaml. It is underrated. Jane Street people are adding borrow checker to it. Could be more popular in the future. Also, all languages are "systems" languages depending on how you wield them. No need to bikeshed about Ocaml's "system"ness status. - D is pretty cool. Very fragmented library ecosystem if you want to do betterC or no-gc though. Be prepared to just use C or C++ libraries, which it can talk to pretty easily. - Nim is a nice language. Does reference counting so it has a low memory footprint compared to other GC'd languages. It compiles to C so technically it is the most portable language in this list. You can easily run it on microprocessors that others won't run on. Try it, you'll very quickly land on "like it" / "don't like it" territory depending on your programming style. - Jai is non-existent right now. Doesn't warrant a discussion until Jon Blow feels it is ready for prime time. But since that's his strategy, expect something practical and polished. If it sucks, two possibilities: 1) he didn't deliver and it won't get drastically better or 2) your use case was not in consideration. - C3, it exists, it is usable, it is like a halfway between C and D. I didn't spend much time on it yet. - Free Pascal: I didn't use it but just putting it here because this list is getting long & it kind of deserves a shout. Lazarus looks nice. - Go: Use Java or C# instead, they can compile to native now. - C++: It exists, it is used everywhere, it sucks. As opposed to most other languages on this list, it wasn't designed. It kind of picked up random features along the way because they looked good. You kind of design it by picking up a subset and putting up with its weirdnesses. Don't use it if you can help it. If you have to use it you most likely didn't have a choice in the first place.
- trevor-e 3y agoI've been having the same dilemma, right now my focus is: - Typescript for anything related to webdev, not a huge fan of the language but can't deny the ecosystem for productivity - Rust for systems-level projects - Crystal for quick scripts, although I'm still on the fence here