5
submitted 6 months ago* (last edited 6 months ago) by modev@programming.dev to c/hare@programming.dev

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?

you are viewing a single comment's thread
view the rest of the comments
[-] modev@programming.dev 3 points 6 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...

this post was submitted on 28 Feb 2024
5 points (100.0% liked)

Hare

47 readers
1 users here now

Welcome to the Hare community!

Hare is a systems programming language designed to be simple, stable, and robust. Hare uses a static type system, manual memory management, and a minimal runtime. It is well-suited to writing operating systems, system tools, compilers, networking software, and other low-level, high-performance tasks.

© Drew DeVault

🌐 https://harelang.org

founded 7 months ago
MODERATORS