51 ms·
The Hare programming language
- Atalocke 4y agoA big part of any new language taking off is a rich ecosystem. If you're looking for a lib to color your terminal output, consider mine? [0] 0. https://github.com/tristanisham/color https://github.com/tristanisham/color
- onion2k 4y agoWouldn't it be faster to write things in Tortoise?
- pastrami_panda 4y agoProbably, but in Tortoise stack overflow is a real issue.
- ithkuil 4y agoThe Tortoise stack is infinite
- pwdisswordfish9 4y agoIt’s hard being a full-stack Tortoise developer.
- bb010g 4y agoBut at least once you're there, it's Tortoise all the way down.
- Isinlor 4y agoI 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)
- icy 4y agoHow does this compare to Zig? They seem to share the same problem space.
- ddevault 4y agoHare is much simpler than Zig and has a much different design, things like Zig's comptime is absent in Hare. Hare also has, in my opinion, a more fleshed out standard library than Zig. However, they don't compete in some respects: Zig targets nonfree platforms like Windows and macOS, and being based on LLVM gives Zig a greater range of platforms/architectures OOTB. Andrew might be able to expand on this.
- icy 4y agoGotcha. One thing that I really liked about Zig is its effortless interop with C. How does Hare compare in that regard?
- ddevault 4y agoHare uses a superset of the C ABI and interop with C should be relatively straightforward. You can see an example with SDL2 here: https://git.sr.ht/~sircmpwn/hare-examples/tree/master/item/sdl2.ha https://git.sr.ht/~sircmpwn/hare-examples/tree/master/item/s... We have some planned improvements which will make this easier still. We'd like to improve the build driver's ability to link with C libraries via pkg-config, and automatically rig it up when you depend on C interop modules like hare-sdl2. Code generation to automatically provide bindings going either direction is also something we'd like to work on. Zig goes, imho, a little bit too far. Hare has no intention of providing a built-in C toolchain, and does not treat C as more special than any other language for interop. It's a question of scope.
- turminal 4y agoIt's trivial for Hare programs to interop with C. All the programmer has to do is specify the libraries they want to link to. Going the other way and calling Hare code from C is not that smooth yet, but there are plans to improve that in the future.
- dvh 4y agoWhy is opening file in "os" namespace but closing file in "io" namespace?
- ddevault 4y agoThe I/O namespace provides an I/O abstraction that only knows about I/O operations, like read and write, rather than I/O objects. https://docs.harelang.org/io https://docs.harelang.org/io There's also an "fs" module which provides a filesystem abstraction: https://docs.harelang.org/fs https://docs.harelang.org/fs The "os" module links these with the host operating system. It provides an implementation of the fs abstraction for the current working directory in the host filesystem, and also provides convenience wrappers like os::open, which calls fs::open with the host filesystem singleton. https://docs.harelang.org/os#open https://docs.harelang.org/os#open
- deleted 4y ago[deleted]
- cmitsakis 4y agoI can't find any information about concurrency. Do you plan to support async/await?
- ddevault 4y agoNo. We prefer a more traditional style with event-driven I/O, e.g. via unix::poll. This should be more familiar to C programmers than to those coming from higher-level languages with async/await constructs. https://docs.harelang.org/unix/poll https://docs.harelang.org/unix/poll You can see a small event-driven server example here: https://git.sr.ht/~sircmpwn/himitsu/tree/master/item/cmd/himitsud/socket.ha https://git.sr.ht/~sircmpwn/himitsu/tree/master/item/cmd/him... https://git.sr.ht/~sircmpwn/himitsu/tree/master/item/cmd/himitsud/client.ha https://git.sr.ht/~sircmpwn/himitsu/tree/master/item/cmd/him...
- nyanpasu64 4y agoFWIW, frequently I've wished that languages had a version of https://www.chiark.greenend.org.uk/~sgtatham/coroutines.html https://www.chiark.greenend.org.uk/~sgtatham/coroutines.html built-in for implementing iterators, like Python generators, or somewhat similar to async/await. Porting the macros to C++ suffers because switches can't jump past declaring local variables with required constructors, and my hacks around this issue were ugly and error-prone. I haven't learned C++ coroutines yet, but they seem confusing.
- ddevault 4y agoWe do not have first-class iterators, but we do have an iterator pattern which is common throughout the Hare standard library. As an example, here's how you can enumerate the nodes in a directory: let iter = os::iter("/")!; for (true) { const entry = match (fs::next(&iter)) { case let ent: fs::dirent => yield ent; case void => break; }; fs::println(entry.name)!; };
- nyanpasu64 4y ago
- staticassertion 4y agolol my other post got flagged, so let me reiterate perhaps in a less inflammatory way. It is disappointing to see that "trust the programmer" is a design goal. Programmers can not be trusted with manual memory management. We have decades of proof, billions and billions of dollars of bug fixes and mitigation investments, real world damages, etc. Building a language like this and saying you hope it will be the foundation for new operating systems is... depressing. It's setting us up for another century of industry failure - buggy software that makes users less safe. It's not to say that memory unsafe languages have no place. Toy programs, or programs not exposed at all, are fine. But that's clearly not the case here - the stated use cases are things like the OS, "networking software", etc. All of the places where C has caused incredible harm. edit: It would be wrong not to note that Hare does consider memory safety. https://harelang.org/blog/2021-02-09-hare-advances-on-c/ https://harelang.org/blog/2021-02-09-hare-advances-on-c/ There are clearly wins here, no question in my mind that a world where spatial memory safety is the default is a better world than today. It doesn't change my view overall, however, that for the use cases defined that the bar needs to be higher. I am also compelled to say something nice about the language. Most apparent is that it looks very approachable - I have to wonder what the '!' means (I can guess), but otherwise it looks very readable. I also like the explicit nature, that's my preference for programs as well as I find it's much more readable. I think "simplicity" can be a tricky goal, but I like seeing languages call it out as one - I'm very curious to see over the next few decades how "simple" plays out.
- ddevault 4y agoThere are plans to research an optional borrow checker for Hare. Hare also does offer many "safety" advantages over C: checked slice and array access, exhaustive switch and match, nullable pointer types, less undefined behavior, no strict pointer aliasing, fewer aggressive optimizations, and so on. Hare code is much less likely to have these errors when compared to C code. I would ultimately just come out and say that we have to agree to disagree. I think that there is still plenty of room for a language that trusts the programmer. If you feel differently, I encourage you to invest in "safer" languages like Rust - but the argument that we're morally in the wrong to prefer another approach is not really appreciated.
- aledue 4y agoAre hare's tagged unions and pattern matching comparable to ADTs found in functional languages? I really miss them in C and would like a "better C" that offers them. Rust does, but of course it's a much bigger language.
- ddevault 4y agoThey are a subset, I suppose. I'm not an expert at functional programming so I couldn't say. The tutorial which introduces tagged unions is here: https://harelang.org/tutorials/introduction/#tagged-unions-in-depth https://harelang.org/tutorials/introduction/#tagged-unions-i... They are also covered in section 6.5.18 of the Hare specification: https://harelang.org/specification.pdf https://harelang.org/specification.pdf Would be curious to hear your thoughts on how they compare given your (presumed) background in functional programming.
- erk__ 4y agoThe biggest missing feature here would be a way to not only select by type and for example allow something like type foo = (A int | B int) Which from my cursory reading does not seem to be possible?
- ddevault 4y agoI'm not sure what you mean by "select by type". I can say that you can define new types: type a = int; type b = int; type c = (a | b); Which seems to be what you're angling for here? I also suspect that you're approaching this from a Rust- or Zig-like background where enums and tagged unions are closely related; this is not so in Hare.
- erk__ 4y agoI do know those languages, but this is more the ADT way from ML. The example you linked did not really make it clear from my point of view because one of the points is that it will collapse if there are multiples of a specific type. But your way seems to make it possible.
- xeeeeeeeeeeenu 4y agoNot supporting Windows and macOS will likely hurt the adoption of the language. Anyway, is it possible to target bare-metal with Hare? Is it possible to use it without the standard library?
- ddevault 4y ago> Not supporting Windows and macOS will likely hurt the adoption of the language. Not among our target audience it won't. > Anyway, is it possible to target bare-metal with Hare? Is it possible to use it without the standard library? Yes. Here are two kernels written in Hare that don't use the stdlib: https://git.sr.ht/~sircmpwn/helios https://git.sr.ht/~sircmpwn/helios https://git.sr.ht/~yerinalexey/carrot https://git.sr.ht/~yerinalexey/carrot
- ed_elliott_asc 4y agoWho are your target audience?
- minroot 4y agoTo my thinking, users of open-source operating systems
- the_duke 4y agoThe problem here is that focusing on a language can lead to lots of small API design decisions that make it very cumbersome to support other systems later without significant breaking changes. I can appreciate the ideological and practical purity of that decision, but even Linux aficionados need to deploy code to other operating systems to make a living.
- eatonphil 4y agoI don't have data to support it but even for Go, a language that does support macOS and Windows, it does not feel like the stdlib is as mature or performant as the Linux version. I don't have numbers for that yet just observations doing simple benchmarks across Linux, macOS and Windows. Some languages are just clearly designed to be used on the server.
- duckerude 4y agoI don't know if the world needs this language, but I'm glad it exists. There's a real charm to C's straightforwardness. It deserves to be expressed without broken array handling and a clunky preprocessor and overzealous UB and so on. I use Rust and like it well enough but it's amazing that its amount of complexity can work at all. It's healthy to have a counterpoint that stays clear even of generics.
- conaclos 4y agoIt is impressive the number of times Rust is mentioned in this thread. I agree. Rust is very complicated and it still feels experimental. It is good to have more conservative languages.
- throw10920 4y agoYou might want to look into Zig, which has most/all of Hare's features, supports a wider range of platforms and OSes (Hare only does Linux+FreeBSD), and has metaprogramming in the form of comptime expressions (unlike Hare, which has no metaprogramming at all) while being pretty widely considered to be an "easy" language to learn (and everyone I've heard talk about it has said that it's far easier than Rust).
- dgb23 4y agoHare has some pretty neat features I have to say: https://harelang.org/tutorials/introduction/#using-yield https://harelang.org/tutorials/introduction/#using-yield https://harelang.org/tutorials/introduction/#tagged-unions-in-depth https://harelang.org/tutorials/introduction/#tagged-unions-i...
- magnio 4y agoI see that Hare exposes itself via the hare module in stdlib. Is there any plan for metaprogramming/macro (not preprocessor) in Hare?
- ddevault 4y agoNo, there are no plans for first-class metaprogramming. The purpose of exposing the parser, type checker, module system, etc, in the standard library is to allow for users to more easily build custom Hare tooling. The closest thing you could get to metaprogramming with this is some assistance with code generation.
- marosgrego 4y agoThat's unfortunate, some metaprogramming could be fun and without generics and such quite simple and efficient even.
- ddevault 4y agoTotally agree that metaprogramming is fun. But I don't think it's a recipe for simplicity and robust engineering, and that's the priority with Hare.
- turminal 4y ago> Is there any plan for metaprogramming/macro (not preprocessor) in Hare? We don't plan to add anything like that. Hare strives to be simple and straightforward. Metaprogramming would not fit it well. Closest thing in this direction that we tried was reflection, but that didn't turn out to play along with the rest of the language either, so it was removed.
- throw10920 4y agoCan you explain how metaprogramming is not "simple and straightforward"?
- lloydatkinson 4y agoWhy do people keep choosing :: over simply .? How does adding more visual noise help anyone?
- onlyrealcuzzo 4y agoTo distinguish between an instance and a namespace? The same can be said for why do we need to put parenthesis after functions that take no parameters? So people still know it's a function.
- metaltyphoon 4y ago> To distinguish between an instance and a namespace? I’m with OP here. C# proves that . reduces the noise substantially.
- onlyrealcuzzo 4y agoI think the question should be less about ergonomics and more about does the distinction matter. I don't know enough about C# to know if it matters. From everything I know, it's a really well designed language, so I'm guessing they made the right call. It doesn't mean it's the right call everywhere.
- frou_dh 4y agoOnly somewhat related, but when reading docs/comments that mention some method `class.method`, it's annoying when that's ambiguous and could mean either a static method or an instance method. In the Ruby world, I think they have the convention of writing `class#method` in docs/comments when mentioning an instance method, and `class.method` when mentioning a static method.
- steveklabnik 4y agoFun trivia fact: I tried to bring that convention over to Rust, but enough people didn't like it than in the end, we don't do that.
- 4y ago
- jpe90 4y agoSince the language is officially announced now, here's an interesting analysis on the language: https://tilde.team/~kiedtl/blog/hare/ https://tilde.team/~kiedtl/blog/hare/ Personally I'm very interesting in playing with it. Generics, functional programming constructs, and a lot of the syntactic sugar you find in modern languages have their uses but I think there's a lot of merit to the idea that you might not want them in a systems language. I think cleaning up some of C's rough edges and providing batteries while keeping things extremely simple and clear is very compelling. I'm also appreciative that it doesn't seem overly opinionated where it doesn't need to be. It's kind of a bummer that there's no MacOS support so I'll have to SSH into my linux box to play with it. I hope the language takes off and support for other platforms materializes. Congratulations to everyone who worked on this.
- turminal 4y ago> Since the language is officially announced now, here's an interesting analysis on the language: https://tilde.team/~kiedtl/blog/hare/ https://tilde.team/~kiedtl/blog/hare/ Just a reminder (since I can't see a date in the blog post) that this was written almost a year ago. Lots of things have changed in the language since then.
- wchar_t 4y agoYes, it is indeed outdated, however some of the criticism/praise is still relevant. I'll see if I can take a second look at the language in the coming days.
- turminal 4y agoYeah, I didn't mean to imply it's not relevant.
- pwdisswordfish9 4y agoHare has generics now?!?! Because to me it looks like the bulk of the criticism remains substantially relevant.
- 4y ago
- lifthrasiir 4y agoTagged union type seems a defining feature of Hare to me. It is not exactly "tagged" in the sense that it internally has tags but users don't explicitly see them [1]. This kind of types are normally headaches for language designers (cf. polymorphic variants in OCaml), but the Hare type system is simple enough that it doesn't pose a significant problem. In turn it gives an intuitive model of conversion; you don't have to convert from, say, one type of error to another type of error. Zig error type is also similar in this aspect, but it is not as general as Hare's tagged union type. [1] I really want to refer this as to "untagged" union type, but of course this will cause a confusion with C-style unsafe unions.
- FrozenVoid 4y agoLack of macros in recent systems languages like Zig/Hare/etc seems to be a design flaw, a handicap marketed as safety feature or bargain for clarity. If a language can't replace C macros, it cannot replace C.
- vladharbuz 4y agoCould you expand on this? I'm really curious why you think so. I have written and worked with C codebases that do quite well without using macros at all.
- FrozenVoid 4y agoIt is a general capability to modify C code at will, example: https://www.chiark.greenend.org.uk/~sgtatham/coroutines.html https://www.chiark.greenend.org.uk/~sgtatham/coroutines.html
- jstimpfle 4y agoIt could be portability stuff, like compiler-dependent attributes. It could be fixing shortcomings of the languages without a huge complicated system that needs to be built into the language (and if it isn't, you can't just switch languages). It could be dirty hacks that abstract a problem at the syntactic level (this is the kind of macro that is most likely to be replaced).
- BaculumMeumEst 4y agoWhat necessary use case of macros isn’t addressed by comptime in zig?
- jstimpfle 4y agoI can't really judge, I've barely tried Zig but... Maybe X-macros? Maybe compiler-specific attributes? Maybe reducing some syntactic clutter?
- FrozenVoid 4y agozig comptime is the same as constexpr/consteval in C++ which operate on variables and valid code blocks. C macros operate on arbitrary tokens, which get converted to code or constants. For example variadic functions can be implemented to act on token arglists that act as abstract tuples: https://github.com/FrozenVoid/C-headers/blob/main/argmanip.h https://github.com/FrozenVoid/C-headers/blob/main/argmanip.h
- tpoacher 4y ago> almost all programs written in C can also be written in Hare Isn't that true of all languages?
- hobo_mark 4y agoIt's probably not true of crab language, at the very least.
- edflsafoiewq 4y agoWhy?
- hobo_mark 4y agoBecause the compiler won't let you, except under duress.
- kaba0 4y agoLet’s add that likely a significant chunk of those programs are full of memory bugs and/or data races. But with unsafe they are all possible to write. Though the reverse is not true, you can’t generally write SIMD-aware code in C without using inline assembly or some compiler extension.
- nickitolas 4y agoWhat exactly are you thinking of? There are very few things I can think of that rust cannot do when using unsafe (And one of the biggest is interacting with safe code ergonomically because of &mut/& guarantees like the noalias/restrict attributes)
- 4khilles 4y agoI would struggle to write a bootloader in JavaScript or a database in Vimscript.
- BaculumMeumEst 4y agoWill wlroots move to hare? Or will bindings be written and maintained?
- ddevault 4y agoI have no plans to do either. I can't see wlroots being rewritten, but I could see someone writing bindings for it. Hare does not make C obsolete, there's no reason to rewrite old code imo.
- BaculumMeumEst 4y agoGotcha. Looking forward to seeing it develop and see what you build with it.
- veltas 4y agoC replacements always seem to have noisier syntax, and not nearly enough motivation to switch from C. And if I could have been tempted with templates and a more intelligent type system I would have switched to a restricted C++ subset years ago. And yes macros are dirty, but yet they're often far simpler than the alternatives, based on how languages like C++, Zig et al have attempted to reduce them.
- jstimpfle 4y agoThis. I love my macros, even if many of them end up being replaced by code, and some of them only patch up shortcomings in the language. There will always be shortcomings in any language, and there will always be situations that need to be fixed with a quick hack, even though that is not a long term solution. And in almost any project I have a few lines of macro magic that almost completely fixes situations where I would otherwise have to resort to terribly complicated C++ templates and slow compile times.
- ninjin 4y agoHappy to see “secretlang” out in the open! I have been following development from afar and really like the idea of a “simple” take on a language, but with a lot of wisdom and affordances added since the state of the world back in 1972. In short, Hare seems to be a language that I really should like and I want to take it for a spin. What I find a bit confusing though is the licensing. I belong to the “BSD school”, but can at least claim that I understand (and respect) how GNU looks at things. Looking at Hare’s licensing [1], I am somewhat stumped and my usual modes of thinking no longer apply. What is the threat that warrants this level of complexity? A commercial fork? A community fork? Proprietary drivers? Are these really realistic enough threats to warrant this level of license complexity rather than just stamping ISC and CC-BY on the whole thing and not worry about forks at all? Yes, there is some writing in the README, but perhaps I am too thick to “get it”? [1]: https://git.sr.ht/~sircmpwn/hare#licensing https://git.sr.ht/~sircmpwn/hare#licensing Lastly, a sanity check, am I reacting too strongly to this if I feel that it has a bit of chilling effect in terms of my excitement?
- staticassertion 4y agoThe license seems straightforward. You can use and distribute software written in Hare, but if you want to link or make changes to the tooling (compiler, etc) you must open source those.
- ninjin 4y agoYes, legally it is perfectly clear. Just not the why. Is there any other language that has taken a similar approach? Has this been discussed in relation to Hare somewhere apart from the brief chunk of text that I linked? I am perfectly accepting that I may be in error here in terms of how I view licensing, but it bothers me that I can not build a mental model of the intentions of the authors.
- sanxiyn 4y agoIt seems basically equivalent to gcc/glibc, which I think is a good default.
- eatonphil 4y agoIt looks like self-hosting is still WIP. Do I have that right? * https://git.sr.ht/~sircmpwn/hare/tree/master/item/cmd/harec * https://git.sr.ht/~sircmpwn/hare/tree/master/item/hare * https://harelang.org/blog/2021-03-14-a-self-hosting-toolchain/
- turminal 4y agoYes There is one more significant (but not user-visible) change planned for the language before we continue working on that.
- eatonphil 4y agoWhat is that?
- turminal 4y agoCode dealing with tagged union matching is going to be completely rewritten and support added for match exhaustiveness checks and matching on pointers to tagged unions without copying the tagged union and its values. The ability to do the latter is expected to result in a significant performance improvement and stack usage decrease.
- ncmncm 4y agoSelf-hosting is a very last-millennium form of wankage. Back then, a compiler was a pretty significant program, and compiler construction tools weren't mature. Nowadays, self-hosting your compiler doesn't demonstrate much of anything. It takes a lot more than a compiler to prove anything meaningful about your language. Time spent on self-hosting is mostly just time wasted. It mainly suggests you were not really serious. Make a front end for LLVM, and get on with things.
- eatonphil 4y ago> Self-hosting is a very last-millennium form of wankage You're reading way more into my comment than I wrote. I asked a question.
- jrexilius 4y agoFirst off, congrats and thank you for putting this out there. Its a massive undertaking and I think the niche you are looking at is a valid one. At a superficial first glance, this looks very welcoming, and I'm definitely going to tinker with it. My expected use case will be embedded arm so I'll have to wait for support for that. And as many have expressed, my primary concern is safety and security, so tooling around proof assistants or formal verification are of interest to me. All of that takes time and community effort, I know. Good luck and thank you for giving the world years of your teams work.
- onlyrealcuzzo 4y agoQuestion: is it easier to implement a language that has manual memory management or a GC, or does it not really make a difference these days?
- ncmncm 4y agoThe first thing I look for in something that claims to be a systems language is whether it provides anything that helps me out. First and foremost, does it provide any primitive that can be used for automation? C++ brought destructors, Rust did a Drop trait. What do you have? Second, does it provide any way to operate on types? C++ got templates, Rust offers generics. What do you have? Third, does it provide useful compile-time logic? If it lacks those, what does it bring to the table to make up for those gaping holes? This is not the '70s, or even the '80s. We have learned things since then. Have you?
- amelius 4y ago> We have learned things since then. Have you? We have learned to read the documentation before we judge things.
- colonwqbang 4y agoUnless the front page points out at least something that is different or better about the new language compared to the alternatives, most people will not read the documentation.
- ncmncm 4y agoI have learned to check on some basic facts before committing a huge block of time to another pointless exercise. The world seems mostly to have learned to serve up way more pointless exercises. One choice is to just ignore everything, which almost always produces the right answer. But that will miss the thing that would have been worth looking into. Another choice is to try ways to filter out chaff. What is not a possible choice is to dig into everything that might conceivably be interesting. One thing we can always be sure of: if it is meant to appeal mainly to C coders, it will fall flat, because everybody who is still using C has seen a thousand languages go by and passed on all of them.
- AnimalMuppet 4y agoI filter it a bit differently. There are enough people who will check out new language X; I don't have to. If it has merit, I'll keep hearing about it. Sure, I'll miss out on using X the first year or two out of the gate, but I don't actually need that. Yes, if X is all it's cracked up to be, I could have benefited from using it in that year or two. On the other hand, I didn't waste time learning a bunch of new languages trying to find the one that would be more useful than what I already have.
- nomemory 4y agoGuess is not the language for me. I am not going to switch to a Linux Desktop to be able to use a general purpose programming language.
- metaltyphoon 4y agoSame boat.
- christophilus 4y agoThis looks quite nice, actually. The negativity in the comments seems a bit heavy. I really like the idea of a language that is as (or almost as) simple as C but with many of the footguns removed.
- DrBazza 4y agoStandard HN. Henry Ford and his faster horse would be spinning in their graves. Another day another group of people criticising a language they’ve never tried. If you paint a house grab a paint brush. If you need to hang a picture a hammer and a nail. Writing a program? Pick the best language for the job.
- Ambroisie 4y agoIs there no RSS feed for the blog? I tried finding a link but failed to do so. Hopefully I am just blind.
- closeneough 4y agoThere is one. The first link when you open the blog. https://harelang.org/blog/index.xml https://harelang.org/blog/index.xml
- throw10920 4y agoNo metaprogramming? No thanks. Metaprogramming is necessary in order to compensate for any missing language features, it doesn't add much complexity, and it's not here.
- astrange 4y agoJust use m4 or gyb! It's the UNIX way.
- skybrian 4y agoTagged unions look simple and useful, but not very compact. As someone who has dabbled in scripting language interpreters, it be would nice to see built-in support for something like NaN-boxing if you're doing a union between pointer types, smaller integer types, and doubles. But I suppose you could it yourself like in C.
- turminal 4y agoThe issue with representing them more compactly is that we'd have to make the rules much more complex and we'd also have to depart from the C abi, so while this is something we might look into in the future it's not very likely to happen.
- tayistay 4y agoWhy have both switch and match statements?
- ddevault 4y agoGood question. The answer is that Hare does not have real pattern matching as you may understand it. The switch statement switches on values, and the match statement switches on types. Merging these faces two problems: one is that the grammar does not support types and values appearing in the same place, and the other is that it would imply either dependent types or a hack similar to them, which we're not really interested in. But I can see that on the surface, the distinction appears a bit arbitrary.
- camgunz 4y agoI really respect Drew and his work/advocacy. I think what most enchants me about Hare is that it's not a "take over the world" language. It's pure FOSS engineering: there's nothing out there that does what I want, so I'll (build a community to help me) build it. Love it.
- torresjrjr 4y agoI contributed to this project for this reason. Hare exists as itself and for a purpose. The libre ethos, the simplicity, the design, with people and the future in mind. The dilligence in having a standard, the commitment to supporting libre platforms, and not bending knees to non-free ones just because they are the norm; e.g. not being afraid to dream. Not adopting whatever hype-train technology bandwagon or corporate interest. Hare stands out as something special.
- akagusu 4y agoThis is why I will be using it, besides the fact that it's designed to be a modern C replacement that feels like C, but without the bad parts.
- wheelerof4te 4y agoI am very pleased to see this out in the open! Looks like a very simple, yet readable little language. Reminds me of C's glory days. I know that we already have a couple of "better C" languages out there, but Hare seems like it truly grasps the simplicity of it's older cousin. I love the focus on open-source only, by the way. It will keep the spirit of the language. I just hope that Drew will stay on this project for a while longer. A language with this kind of vision must persevere. Good luck to Drew and the Hare team!
- mrtweetyhack 4y ago
- HacklesRaised 4y agoInitial reaction is positive, but as with Blow's Jai, it seems like a programming language for the authors, and there's nothing particularly wrong with that; the ideological stance re FOSS, probably excludes it from any general purpose conversation, which is disappointing. Though, nothing stops interested parties from forking to support proprietary platforms, although the outcome may be disappointing 4 the authors if such a fork picked up a zig head of steam.