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?

  • @modevOPM
    link
    34 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…

    • ChubakPDP11+TakeWithGrainOfSalt
      link
      34 months ago

      Yeah this is all true. I myself am a fan of learning as many languages as possible. When you pick up the ability to read an EBNF grammar, and learn the ins-and-outs of an imperative language, there’s little stopping you from picking up a new one. The language lies in its Standard Library. Like I’m fairly sure Rust won because of its STD. Nim came out in 2005, one year before Rust, and it failed to catch on because of it’s stupidly stupid STD. Plus it’s slower (check out my benchmarsk here).

      What’s funny is, few people are actually using Rust as a proper systems language. By ‘few’ I mean a small percentage of its users. I only know one or two people (out of the ones I know) in the Linux/BSD dev scene who have a zeal for ‘Rust-only’ code base — systems base that is. Most of the people who use Rust use it for unrelated, non-systems reasons. This fora we are on is an example. It’s not inherently a ‘bad’ thing mind you. I just don’t understand that, why people don’t get that it does not matter if a daemon-based, service-based software is written in a ‘fast’ language? A server is mostly IO-bound. You could write the backend for your system in machine binary code and when there’s clutter in IO, it’s will use as much ‘electricity’ as fucking NodeJS would! There’s literally no reason to use Rust in a web backend. ‘Speed’ is good when a software is CPU-bound. But whah what do I know.

      C just works. Face it. It’s protable as fuck. There’s fuckchain of toolfuck for it. It’s ‘text’, Rust is ‘subtext’!

      • @modevOPM
        link
        24 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.