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
    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.