What do you think about Hare? I think it takes best from different languages, intentionally or not…

It is simple like C, but safer, and at the same time allows you to shoot yourself in the foot to take control and make mistakes if you want.

Example from this blog post two years ago:

fn io::write(s: *stream, buf: const []u8) (size | io::error);

// ...

sum += match (io::write(s, buf)) {
case let err: io::error =>
	match (err) {
	case unsupported =>
		abort("Expected write to be supported");
	case =>
		return err;
	};
case let n: size =>
	process(buf[..n]);
	yield n;
};

Expression-based syntax and match statements remind me of Rust, but it implemented simpler without options…

Maybe you already used Hare in your project. Interesting to read your feedback…

Do you like it? Why?
Dislike? Why?

  • XTL@sopuli.xyz
    link
    fedilink
    arrow-up
    1
    ·
    7 months ago

    Looks like a bad rust wannnabe. The site doesn’t really give any reason or reasoning or why it’s special, who uses it, what libraries or bindings are available. Nothing about platform support or targets, compilers or interpreters. No mention if it’s integrated in any distribution or package system.

    I’ll probably never look at it again unless it comes up in some interesting context.

      • XTL@sopuli.xyz
        link
        fedilink
        arrow-up
        2
        ·
        7 months ago

        Ah. Thanks. I’m not particularly, but rust definitely has crazy potential and makes a good tool where available. And it does keep coming up with surprises like having a target for Atari 800XL.

        Hare does have a mighty nice mascot, too.

  • onlinepersona@programming.dev
    link
    fedilink
    arrow-up
    2
    arrow-down
    2
    ·
    7 months ago

    First time I’m seeing it. From the sidebar

    Hare uses a static type system, manual memory management, and a minimal runtime

    My question is: what does it provide that C/C++ doesn’t? It doesn’t seem to provide memory safety, C also has a minimal runtime, C/C++ also have a static type system… does it have better tooling? A package manager?

    CC BY-NC-SA 4.0

      • modev@programming.devOPM
        link
        fedilink
        arrow-up
        3
        ·
        7 months ago

        Some devs just learn new languages to expand their view or to avoid burnout. Yes, I agree that memory safety is not a problem and all these C-killers suck. Hare is not positioned as a C killer, it can be used together with C.

        And look at today’s situation in the industry. Try to say in the Rust community “Rewrite it in C” or suggest some newcomers to write in pure C some app. All these commercial developments smell bulked overhyped technologies that have only one goal - make money for companies and companies support these tech. All job offers do not expect you to be an expert in computer internals or C, or even JavaScript. You just need to know the frameworks.

        All of these bring pure software quality. C will never die, and those who write on it will do. But newcomers need something different and better it will be as efficient as C.

        It is just one point of view…

          • modev@programming.devOPM
            link
            fedilink
            arrow-up
            2
            ·
            7 months ago

            Thank you for benchmark. Python is a player, lol.

            Rust is very overhyped and I do not accept its syntax, boring. I like C and Hare. I am not a system dev, it’s just a hobby, so my opinion can’t be proved by solid experience. But I came to C after learning and trying using Rust in a hobby game dev. Hare I like to have in my backpack as an alternative, fresh and developing tool. It is not overhyped and his team are not trying to reach popularity. Just making not bad language. IMHO.