5 ms·
Thoughts on Hare
- tsuujin 5y ago> Because of that, I'm going to ask you, dear reader, to please respect Drew's wishes and not share this post in any public space. This page is "unlisted" and won't appear on the frontpage, and I only intend to share this with those who are already aware of Hare. If you, due to IRC logs, public GitHub repositories, or cosmic rays, find this page, kindly keep it to yourself. Hmm.
- pcr910303 5y agoFYI: The language was released a few hours ago.
- ncmncm 5y agoAnd, that blog post was overwhelmingly more informative than the announcement.
- gaws 5y agoIf you don't want it public, then don't post it.
- wchar_t 5y agoIt was public but unlisted, so you won't find it from the frontpage. (i.e., the same level of secrecy Hare's website had before the release.)
- jolux 5y agoSupports only Linux and a bunch of other Unix-likes in the long tail that almost nobody uses, no generics, similar philosophy to Zig but without the interesting async stuff and comptime. It’s not clear to me why people keep doing this. Why wouldn’t you just take C and remove the footguns if you think that’s all that needs to be done? Seems like it would have much better chances of adoption.
- mixedCase 5y agoTo me, it obviously seems to be a toy project to have fun and build personal projects with. I don't think Drew plans it to become a language aiming for serious adoption. And while I don't ever want to have anything to do with it, I'm glad people are still having fun making languages to build things for fun with other like-minded people.
- jolux 5y agoSeems to be more than a toy from its webpage: https://harelang.org/ https://harelang.org/ They advocate using it for operating systems and general systems programming.
- jibalt 5y agoWithout lots of things Zig brings to the table, like support for and cross compilation to every platform under the sun right out of the box. And Zig has generics.
- jolux 5y agoRight, I was getting it confused with Go, which also has generics now. Its generics are implemented with the comptime feature, right?
- UncleEntity 5y ago> … a technique called "subtyping" is used, where struct B, who's first member is a struct A, is cast as that struct A to properly conform to an interface. It's supposedly common in C (that's what I was told in #hare, anyway), though this is the first time I'm encountering it. How much C have you looked at if you’ve never seen that pattern (or ‘story’, not up on the lingo)? Is there another way to do this I’m not aware of because it’s so common I thought it was just common. —edit— Thinking about this for a minute there’s another ‘story’ where you use the least significant bit(s) as a tag and use that to differentiate between object types but that is definitely not too common, this hextree library I found somewhere uses it to tell a leaf from a branch and I’m really tempted to just replace it with the previously mentioned ‘subtyping’.
- jibalt 5y agoThe article isn't well informed ... e.g., it says "In all the languages I know of, you can't break out of a loop from an inner loop" but you can do so in all the languages it mentions at the top: Rust, Zig, and Myrddin, as well as many others.
- UncleEntity 5y agoI was thinking the same thing where Java has had this since 1995 but was too lazy to look it up to make sure. No language I actually use has it but I know about it from playing around with a java 1.1 parser project I’ve been slowly working on.
- wchar_t 5y ago(Author here.) Fair enough, I should have done my research on that. I had barely touched Myrddin, was just beginning to look into Zig, and hadn't heard of (or felt the need for) that feature in Rust at the time I wrote that post.
- Georgelemental 5y ago> In all the languages I know of, you can't break out of a loop from an inner loop. Rust has this feature: https://doc.rust-lang.org/rust-by-example/flow_control/loop/nested.html https://doc.rust-lang.org/rust-by-example/flow_control/loop/...
- Jtsummers 5y agoAs do Java, Common Lisp, Ada, Javascript, and probably a lot of others. Breaking from inner loops is a common thing and having to use special condition variables is error prone, in comparison, and potentially more time intensive. Labeled loops let you keep the premise of goto-less programming in structured programming while permitting a weakened jump-to-label (the program can't jump from anywhere to that label, only in the context of the loop). Since they aren't (usually) able to be used from other arbitrary points you still get the cleaner control flow that structured programming promotes.
- ratrocket 5y agoI was writing a (less informed!) sibling comment at the same time. Great observation that I hadn't considered: what I called a "labeled break" or "continue" is safer than bare goto since you can't jump from anywhere to anywhere. Thanks for making that plain!
- ratrocket 5y agoUnless I'm misunderstanding the mechanism (jumping to a label, right?), I thought most (well, lots of) languages supported this. Go does also: A non-minimal example using continue (but you can also break): https://go.dev/play/p/mEyEqcEYvcK https://go.dev/play/p/mEyEqcEYvcK The spec: https://go.dev/ref/spec#Labeled_statements https://go.dev/ref/spec#Labeled_statements It's just goto..? And despite "considered harmful", lots of languages have goto. There are some things for which goto (or labeled break/continue) really are the best way to do what you need. (I can't shake the feeling I'm missing something really obvious here!)
- jibalt 5y agoAll of the languages he mentioned (Rust, Zig, Myrddin) do. I ignored the comparisons to C ... any more modern language looks advanced in comparison.
- bawolff 5y agoProject is "secret" pre-alpha, not yet done... and the person is complaining that docs and tutorials aren't fully polished. Seems like a trite complaint. docs (let alone polished) is not something you usually expect from pre-alpha software.
- jolux 5y agoIt’s since been released.
- closeneough 5y agoNope, it just has been announced. There is no release yet.
- bawolff 5y agoIt wasn't at the time the blog post made those comments as far as i know. Regardless even if it was, its still early stage software.
- wchar_t 5y ago(Author here.) Yeah fair enough, it's not really a complaint worth making. I was more just listing things I noticed in general than faulting Hare for it.
- nwmcsween 5y agoWith regards to the no functional programming, functional programming aspects make code less buggy for doing standard things. Sure functional programming isn't as explicit as a 5 layer dip of for loops but to me less code equals less bugs and functional programming doesn't entail more abstractions, in fact it could mean less abstraction.
- jibalt 5y ago"In all the languages I know of, you can't break out of a loop from an inner loop." You can in all the languages that the author says they're interested in (Rust, Zig, and Myrddin). I think comparing Hare to C in this day and age is pointless. Rust, Zig, Myrddin, Nim, D, Odin, Crystal, Scopes, even V bring interesting and useful innovations to the table. What does Hare offer? No Windows support ever? No thanks. With Zig I can cross compile out of the box to just about any platform.
- Mengel67 5y ago[flagged]