5 ms·
Has anyone tried both C3 and Hare[1]. How do they fare? There seems to be quite the overlap between the two. [1] https://harelang.org/ https://harelang.org/
by plainOldText 1y ago
Has anyone tried both C3 and Hare[1]. How do they fare? There seems to be quite the overlap between the two.
[1] https://harelang.org/ https://harelang.org/
- mustermannBB 1y agoProblem with Hare is that it is (or at least was last time I checked) Linux/Unix only and so by design. That kinda makes it DOA for many.
- plainOldText 1y agoIndeed. There’s a port for macOS though. And yet out all these newer C-like languages, it looks like Hare probably takes the crown for simplicity. Among other things, Hare uses QBE[1] as a backend compiler, which is about 10% the complexity of LLVM. [1] https://c9x.me/compile/ https://c9x.me/compile/
- sitkack 1y agoQBE is an art project. Read the source.
- orthoxerox 1y agoI tried. It's not at Arthur Whitney's levels of terseness, but compared to the source of, say, Redis it's a pain to read.
- lerno 1y agoThe downside of QBE is that it then requires an assembler and a linker. And QBE's only input and output is still text. Plus the "frontend -> QBE -> assembler -> binary" process is slower than "frontend -> LLVM -> binary". And LLVM is known for being a fairly slow compiler.
- stevefolta 1y agoThe downside of QBE is that it doesn't have a way to generate debug symbols. But I still love and use it.
- YorickPeterse 1y agoThe most recent release has the ability to generate basic debugging information (see "new experimental dbgfile and dbgloc directives. " from the release notes) as Hare needed that (and IIRC a Hare contributor added it). Unfortunately, there's no documentation on it, and last I checked to see how to use it I had to go spelunking in the Hare source code.
- atiedebee 1y agoIt's funny how they say they are at 10% of the code of LLVM in their marketing, when it is actually closer to 0.1%. Throwing LLVM version 20.1 through wc (just the subdirectory llvm/lib) results in 2.3 million lines for all .c and .cpp files. QBE was around 14k last time I checked.
- alpaca128 1y agoThat and no multithreading.
- amelius 1y agoThere's also Zig in the C-alternatives space. https://ziglang.org/ https://ziglang.org/
- mapcars 1y agoThere is also Odin: https://odin-lang.org/ https://odin-lang.org/ Would be nice to have a list of these and comparisons
- uecker 1y agoThere is also C23 and at some point C2Y. C23 got typeof, constexpr constants, enums with underlying type, embed, auto, _BitInt, checked integers, new struct compatibility rules, bit constants, nullptr, initialization with {}, and various other improvements and cleanups. Modern C code - while still being simple - can look quite different than what people might be used to. C2Y already already got named loops, countof, if with declarations, case range expressions, _Generic with type arguments, and quite a lot of UB removed from the core language. (our aim is also to have a memory safe subset)
- eacnamn 1y agoWhat's the state of things regarding statement expressions? Are there any intentions of adding them? I think I've read Meneide make an offhand comment about that.
- uecker 1y agoThis is being discussed. It has some weird corner cases and limitations though. But since it is widely used and supported, I think there is a good chance that some harmonized version of it will be standardized.
- ksec 1y agoInteresting C2Y. I am wondering how long would it take for GCC and LLVM to implement it once it is out. At this point may be C2Y will get to be the BetterC, given adoption or any other alternative will take far longer than expected.