5 ms·
I've been closely following and evaluating the train of C replacement languages that was (I believe) started by Jonathan Blow and Jai. Zig is one of the strong
by stephc_int13 1y ago
I've been closely following and evaluating the train of C replacement languages that was (I believe) started by Jonathan Blow and Jai.
Zig is one of the strong contenders, but Odin is IMO following a saner path, Carbon and D should be mentioned and I think there are a few others.
My initial reaction to new programming languages is naturally skeptical, but I really liked the way the designers behind those efforts approached it, trying to solve frequent C/C++ pain points and adding a few fresh ideas.
But overall, after a few years, I am sticking with C and orthodox C++, the cost/benefit ratio is simply not worth the effort, none of them are really mature and the problems they try to solve are not painful enough.
My current take on this is to view Jai/Zig/Odin/etc. as attempted C forks, quite often motivated by hubris and coming with the usual inconvenience of forks, a lot of wasteful/redundant efforts put into small islands, each ruled by their own "benevolent" kings.
An other analogy that can be made is the many attempts at replacing keyboards layouts. Dvorak etc. They probably have their merits, but the adoption was limited to a few enthusiasts for the same reasons that C is unlikely to get replaced by any of those forks.
- 90s_dev 1y ago> My current take on this is to view Jai/Zig/Odin/etc. as attempted C forks, quite often motivated by hubris and coming with the usual inconvenience of forks, a lot of wasteful/redundant efforts put into small islands, each ruled by their own "benevolent" kings. Didn't Rust do the same thing? We only call efforts wasteful until they become mainstream, then in retrospect we call it excitement driven prudence. Anyway, is there an "Odin for C programmers" short guide, so I can learn it more quickly?
- stephc_int13 1y agoRust is a bit different, more like a C++ replacement and heavily focused on so-called memory safety, but with IMO many bad design decisions, while I consider Zig/Jai/Odin as merely "meh" I think that Rust is bad.
- cadu2 1y agoCan you comment you some of these decisions in Rust that you feel are bad? I enjoy the language and have done quite a bit of work with it so I might be blinded/biased. I feel some warts here and there (async fns, anyone?), but overall the thing works and `cargo` is really a blessing.
- stephc_int13 1y agoHorrendous compilation time. Unnecessary complexity everywhere, basically C++ but worse.
- bonzini 1y agoThere's a lot less complexity in Rust than C++. Compilation times are mostly due to lack of compiled code reuse, which is bad but not unsolvable.
- const_cast 1y ago> There's a lot less complexity in Rust than C++. Eh, I don't know, I don't think so absolutely. I think in the general "application" paths yes there's less complexity but as a language overall, no. The thing is Rust has all the same capabilities of C++, that is to say, everything. With that same strong emphasis on free abstractions - meaning, abstractions that do not cost anything more than if you wrote the implementation yourself. Templates and stuff are a rabbit hole but if you go down the path of procedural macros and generics in Rust it's more of the same. It gets crazy, wild, and super complex. But most people don't have to worry about that, because these sort of "squeeze every last bit of juice" features are most useful for library authors.
- pdpi 1y agoWhat about Rust's memory safety story justifies the "so-called" qualifier?
- stephc_int13 1y ago
- andrewmcwatters 1y agoI feel many of your sentiments, and suspect that many C successors fail, because they don't want to just look like an evolution of C in the same way C with Classes did. No one is out here building C with Safety.
- pjmlp 1y agoWG14 could design such an evolutionary path, it has been obvious since 1980's, however they clearly aren't interested.
- andrewmcwatters 1y agoYeah, it's really disappointing. I think the general attitude is to use calls to functions that are safe and to use instrumentation, which I get, but it results in these piecemeal fixes over the years.
- pjmlp 1y agoIf only such functions would exist, instead of pointer + length.
- heresie-dabord 1y ago> the problems they try to solve are not painful enough. The lack of safety is not painful enough? There is an entire industry (i.e. job sector, training, expertise) that evolved to try to thwart bad actors abusing unsafe languages.
- wolvesechoes 1y agoBut neither Zig nor Odin solve this problem. The only serious attempt is Rust.
- bnolsen 1y agoRust is super heavy handed in how it does it.
- stephc_int13 1y agoSee. Rust fans are often naïve believers in silver bullet solutions. Computer security and exploitation is a complex and difficult topic. Bad actors are looking for vulnerabilities to build exploits, some are related to memory corruption but many of the most sophisticated ones are not. All programs are potentially unsafe, regardless of the language. Using a language like Rust can help to some extent, but it won't be sufficient if the programmer is too ignorant about code hardening. You can't replace experts with the flip of a switch.
- pjmlp 1y agoC replacement languages have been a thing for decades, since 1978 if we don't count its predecessors, unfortunately UNIX/C is hard to beat, thankfully there is also Typescript for C, aka C++.
- pron 1y agoI am similarly sceptical, but that's not to say these new languages cannot teach us much. I don't know if Zig or Rust would ever become as popular as C++ -- the odds are certainly stacked against them -- but they both have novel approaches that could, perhaps, introduce some ideas into programming that one day may make an impact.
- bnolsen 1y agoOdin just hasn't been in the same league performance wise as rust, c, c++, zig. For these types of languages it's important.