Thoughts on Hare
tilde.team
tilde.team
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.
Seems like a trite complaint. docs (let alone polished) is not something you usually expect from pre-alpha software.
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’.
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.
They advocate using it for operating systems and general systems programming.
Rust has this feature: https://doc.rust-lang.org/rust-by-example/flow_control/loop/...
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!
A non-minimal example using continue (but you can also break): https://go.dev/play/p/mEyEqcEYvcK
The spec: 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!)
I ignored the comparisons to C ... any more modern language looks advanced in comparison.
Hmm.