5 ms·
I don't see any explanation of why this language exists. Does it do something better than any other language?
by Isinlor 4y ago
I don't see any explanation of why this language exists.
Does it do something better than any other language?
- vladharbuz 4y agoMy two cents: low-level programming languages (e.g. with manual memory management) are essential for tasks like writing operating systems, video games, real-time audio applications and other such things. There are few low-level programming languages available currently. The most used is C, and while it has its wonderful parts, C can also cause a lot of headaches and bugs. Whether C++ is a good replacement is a can of worms I won't get into. Hare attempts to improve upon C while still remaining a very simple language, with much better error handling, support for arrays and slices, a rich but still minimal standard library, more concise and powerful function return values using tagged unions, improved memory safety, and other things you can find here: * https://harelang.org/blog/2021-02-09-hare-advances-on-c/ https://harelang.org/blog/2021-02-09-hare-advances-on-c/ * https://harelang.org/tutorials/introduction/ https://harelang.org/tutorials/introduction/ Disclaimer: I worked on Hare and this is just my personal opinion. I hope everyone can judge whether or not they like Hare for themselves by playing with the language!
- kaba0 4y agoNot trying to take away anything, but just from the top of my head: Zig, Rust, Odin, Beef lang and then don’t forget about those that even precede C like Fortran or Pascal.
- cestith 4y agoI think any discussion of small, performant, fairly memory-safe languages could include Forth or Factor. Speaking of the Pascal family, we could also stand for someone to put time into a more modern Oberon or a standard subset of Ada.
- gautamcgoel 4y agoI don't think Factor is actively maintained.
- throw10920 4y agoAs someone who thinks that Forth is an underappreciated language that is very good at some things, it's definitely not "memory-safe". Small and performant, absolutely! (good for bootstrapping a memory-safe language, also yes)
- ddevault 4y agoIt's difficult to compare Hare to every other language project at once, but the rationale is ultimately the same: we think we can fill different niches than the others. If I were to speak generally about Hare compared to other efforts, I would focus on its simplicity and stability goals. It's the only new language in this space that's arguably simpler than C, in my opinion, and the goal is to provide a small, stable foundation that can be depended on for a long time, much like C is. Unlike many other languages in this space, its trade-offs also tend to position it to do anything C can already do - Rust has famous issues with linked lists, ownership when linking to things like libwayland, and they have their hands full getting into Linux; Go's runtime and GC rules it out for many applications; and so on.
- triyambakam 4y agoCould you share any of your thoughts on comparing Hare to Zig? Zig seems to have the most similar goals to Hare but I think Zig is already quite complicated.
- ddevault 4y agoHare is much simpler than Zig. The Hare compiler is 1/10th the size of the Zig compiler. The standard libraries, which I reckon are pretty comparable in terms of features, are again separated by an order of magnitude in size. Zig is also (presently) based on LLVM, which heaps on another huge pile of complexity, whereas Hare is based on qbe: 13,000 lines of C89. Bootstrapping Hare is also significantly easier and much faster than Zig. Hare's design is a lot different from Zig's as well. Hare lacks comptime and generics, and does not target non-free platforms like Windows and macOS. However, the target audience and supported use-cases for the two languages is similar. It mostly comes down to a matter of preference for most people.
- anonymoushn 4y ago> The standard libraries, which I reckon are pretty comparable in terms of features, are again separated by an order of magnitude in size. I would be extremely surprised if this were the case, especially given that the Zig standard library is full of generics.
- deleted 4y ago[deleted]