Live data from Hacker News

The Hare programming language

harelang.org

251–260 of 323 posts

Re: The Hare programming language

#251

Why have both switch and match statements?

Good question. The answer is that Hare does not have real pattern matching as you may understand it. The switch statement switches on values, and the match statement switches on types. Merging these faces two problems: one is that the grammar does not support types and values appearing in the same place, and the other is that it would imply either dependent types or a hack similar to them, which we're not really interested in. But I can see that on the surface, the distinction appears a bit arbitrary.

Re: The Hare programming language

#252

Earlier quoted context omitted.

I never said it wasn't the biggest deployment target. I also think it's shortsighted to do this. > you are not doing yourself any favors by not developing on the same platform as your deploy target Why would I give up all the tooling I already have, such as an VS, to "do development on Linux"? Have you tried doing development from Visual Studio, VSCode on windows where it targets WSL? It's seamless and I don't really…

You can do that exact setup just fine with Hare only being able to compile for Linux (or FreeBSD). Providing a Linux runtime environment to run code that targets Linux is WSLs whole purpose .

And here is the entire problem.

> code that targets Linux

This is too big of an assumption to make. For instance, the last company I worked for does contract with DOD where output of the project is two installers for windows an macOS, despite the product working flawlessly on Linux.

The is a HUGE world out there where your deployment targets won't be Linux servers, and this is a huge blind spot for a mainstream want to be language.

Re: The Hare programming language

#253

Earlier quoted context omitted.

You can do that exact setup just fine with Hare only being able to compile for Linux (or FreeBSD). Providing a Linux runtime environment to run code that targets Linux is WSLs whole purpose .

And here is the entire problem. > code that targets Linux This is too big of an assumption to make. For instance, the last company I worked for does contract with DOD where output of the project is two installers for windows an macOS, despite the product working flawlessly on Linux. The is a HUGE world out there where your deployment targets won't be Linux servers, and this is a huge blind spot for a mainstream want…

Nobody ever said it wanted to be mainstream. It targets a niche, quite blatantly.

Re: The Hare programming language

#254
post #114
post #84

Since the language is officially announced now, here's an interesting analysis on the language: https://tilde.team/~kiedtl/blog/hare/ Personally I'm very interesting in playing with it. Generics, functional programming constructs, and a lot of the syntactic sugar you find in modern languages have their uses but I think there's a lot of merit to the idea that you might not want them in a systems language. I think clea…

> Labeled loops > I'm not yet sure whether this is a good thing or a bad thing. Sure, you can do clever shenanigans now, but something tells me this will make the code's control flow much harder to follow. The most popular example I can think of is JavaScript: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe... Tbh, I think the opposite is true: without the ability to break outer loops, I have resorted to…

I agree, labelled loops are fantastic.

I don't know for sure, but I believe the JavaScript feature was inspired by Perl, which has had them since at least the v4 releases (1989-1993):

https://www.rexswain.com/perl4.html#flow

Re: The Hare programming language

#255

Will wlroots move to hare? Or will bindings be written and maintained?

I have no plans to do either. I can't see wlroots being rewritten, but I could see someone writing bindings for it. Hare does not make C obsolete, there's no reason to rewrite old code imo.

Gotcha. Looking forward to seeing it develop and see what you build with it.

Re: The Hare programming language

#256

Earlier quoted context omitted.

And here is the entire problem. > code that targets Linux This is too big of an assumption to make. For instance, the last company I worked for does contract with DOD where output of the project is two installers for windows an macOS, despite the product working flawlessly on Linux. The is a HUGE world out there where your deployment targets won't be Linux servers, and this is a huge blind spot for a mainstream want…

Nobody ever said it wanted to be mainstream. It targets a niche, quite blatantly.

No based on what's going on the thread. There is comparison everywhere with mainstream languages.

Re: The Hare programming language

#257

Not supporting Windows and macOS will likely hurt the adoption of the language. Anyway, is it possible to target bare-metal with Hare? Is it possible to use it without the standard library?

> Not supporting Windows and macOS will likely hurt the adoption of the language. Not among our target audience it won't. > Anyway, is it possible to target bare-metal with Hare? Is it possible to use it without the standard library? Yes. Here are two kernels written in Hare that don't use the stdlib: https://git.sr.ht/~sircmpwn/helios https://git.sr.ht/~yerinalexey/carrot

>> Not supporting Windows and macOS will likely hurt the adoption of the language. > Not among our target audience it won't.

No gamedev?

Re: The Hare programming language

#258
post #48

I see that Hare exposes itself via the hare module in stdlib. Is there any plan for metaprogramming/macro (not preprocessor) in Hare?

No, there are no plans for first-class metaprogramming. The purpose of exposing the parser, type checker, module system, etc, in the standard library is to allow for users to more easily build custom Hare tooling. The closest thing you could get to metaprogramming with this is some assistance with code generation.

That's unfortunate, some metaprogramming could be fun and without generics and such quite simple and efficient even.

Re: The Hare programming language

#259
I really respect Drew and his work/advocacy. I think what most enchants me about Hare is that it's not a "take over the world" language. It's pure FOSS engineering: there's nothing out there that does what I want, so I'll (build a community to help me) build it. Love it.

Re: The Hare programming language

#260
post #223

Earlier quoted context omitted.

You are missing one subtle but important flaw in your dismissal: not self-hosting means that your compiler will only be developed by people willing to write C/C++ code, which has practical implications as well as taking away some of the punch from your effort to improve on the status quo.

Self-hosting will only distract you from any "effort to improve on the status quo". And, do you really want people working on your compiler who can't even cope with C++? (BTW: There is no such language as C/C++. Clang and Gcc are both coded in C++.) Your new language desperately needs libraries that bring it up to a level of practical usefulness. A compiler front end is about the least-useful code you could write in…

> do you really want people working on your compiler who can't even cope with C++?

That's the whole point of creating a new programming language.

Post reply on HN