Live data from Hacker News

Criticizing Hare language approach for generic data structures

ayende.com

91–100 of 272 posts

Re: Criticizing Hare language approach for generic data structures

#91

Earlier quoted context omitted.

I question the assertion that Hare's standard library is "anemic"; it includes a pretty decent set of batteries for many use-cases: https://docs.harelang.org Many Hare programs will not need to have dependencies at all. We encourage a more conservative approach to dependencies than is common in many modern languages such as Cargo, PyPI, npm, Go, etc. Even dependency-heavy Hare projects will not have hundreds of depen…

That does look like a decent collection of functionality, but a HashMap as mentioned in the submission seems like a pretty glaring omission. I can't remember the last time I wrote a program that didn't use a Map. Even dynamic languages that tend to be quite light on types almost universally include a map type. I can definitely see the problems with the Node "explosion of modules" approach, but if we're looking at fix…

Take a look at this comment where I explained why a first-class hash map is not a good fit for Hare:

https://news.ycombinator.com/item?id=31258759

Re: Criticizing Hare language approach for generic data structures

#92

Earlier quoted context omitted.

Are you suggesting there aren't mature implementations of hash maps in C you can easily vendor?

What does “vendor” mean in this context? Is it just a synonym for “distribute”?

It means including a library in your codebase via manually copying the files in (but generally in their own subdirectory and without modifying them so that it is easy-ish to update to a new version of the library by simply copying in the files from the new version).

I believe the name comes from a tradition of putting such code in a directory named vendor/name-of-library or vendor/name-of-vendor/name-of-library which allowed for distinguishing between the src directory which was first-party code and the vendor directory which contained code form 3rd party vendors (often such code was proprietary and had to be bought/licensed).

Nowadays the term is used to differentiate between a manual approach and the use of a package manager.

Re: Criticizing Hare language approach for generic data structures

#93

Earlier quoted context omitted.

There's a mature open source library for them packaged for Arch and other distros. Using that would be less work than trying to implement it from scratch.

Are you suggesting there aren't mature implementations of hash maps in C you can easily vendor?

I was only suggesting what I thought was the easiest option. If others are even easier, then I'm even more curious about what might rule them out. I hope to learn something.

Re: Criticizing Hare language approach for generic data structures

#94

Earlier quoted context omitted.

BYOD combined with "we don't need a package manager" sounds like a particularly bad combination. I understand Rust's "small stdlib but great package ecosystem", but whats the appeal of "anemic stdlib plus no package ecosystem"? Maybe I would come up with something like this if I only ever worked on Linux software using C, but outside those niches these choices seem weird.

Correct me if I'm wrong, but Hare doesn't say "we need no package manager" but instead "we don't need a new package manager, use the one your OS provides", at least from how I understand it.

That's a great way to make a program work only on specific distros.

Re: Criticizing Hare language approach for generic data structures

#95
post #68
post #40

Earlier quoted context omitted.

Even in the embedded world, it’s becoming less justifiable to use C when your platform supports rust.

rust doesn't offer much value for embedded (mcu, bare metal, tiny stuff) imo. No allocation = no leaks, no use after free, no dangling pointers. No multi core = no atomics or concurrency to worry about. Ring buffers solve 99% of my interrupt data sharing = no need to worry about synchronization. Bounds/safety checks? Need to run and test release builds most of the time because of space/memory constraints.

It's a bit early, so there are currently lots of downsides, but some potential benefits:

- The package management is a nice. Install a generic ring buffer or a board support package for the hardware you are using.

- Async-await can be really nice for dealing with hardware peripherals.

- Don't interrupts constitute concurrency?

- Reduced UB and footguns compared to C

Re: Criticizing Hare language approach for generic data structures

#96
post #69

Earlier quoted context omitted.

I have no fists in this fight, but wanted some clarification. Are you saying the reason Rust is now being integrated into the Kernel instead of Golang is because of the success of evangelists, not because of the merit of the language itself? I'm not involved in Kernel development myself, but if I was, I'd see your statement as a big hit in the face that we don't know what we're doing, if they (Kernel developers) are…

Its not existing kernel devs that suddenly switched to rust. It is the incoming cohort.

For someone to start using a new language in the Kernel, some of the existing "guard" has to approve it, meaning they've investigated if it's fit or not. Or can anyone willy-nilly contribute to the Kernel without anyone approving changes going into the main branch?

Re: Criticizing Hare language approach for generic data structures

#97
post #94

Earlier quoted context omitted.

Correct me if I'm wrong, but Hare doesn't say "we need no package manager" but instead "we don't need a new package manager, use the one your OS provides", at least from how I understand it.

That's a great way to make a program work only on specific distros.

Seems it fits Hare perfectly then, as one of the explicit goals of Hare is to only support non-proprietary OSes.

Re: Criticizing Hare language approach for generic data structures

#98

Earlier quoted context omitted.

Are you suggesting there aren't mature implementations of hash maps in C you can easily vendor?

What does “vendor” mean in this context? Is it just a synonym for “distribute”?

It's basically the professionally sanctioned version of copy and paste. With all the good and bad that that entails.

Based on my long builds times and erratic network behavior in CI I'm beginning to think every system should just vendor.

Re: Criticizing Hare language approach for generic data structures

#99

I don't get this guy. He's just raging. I agree a hashmap is not simple and Hare's post is a bit naive, but I don't get what's his problem with the language not providing a default implementation. It's part of the language's design. It's targeting people that most likely won't need a hash table. It's not aiming to be a high-level batteries-included language like Java.

I think that even the mere fact that there are a billion implementations of a hashmap kind of implies that a hash table _is_ a simple data structure, that you may complicate in a bazillion ways in order to cater for some specific usecase / requeriment. But at it's core, a simple data structure.

Fair point. I agree with you on that.

Re: Criticizing Hare language approach for generic data structures

#100
Why do people spend so much energy shooting down a language nobody uses? If you don’t like it you don’t have to use it. I would hate to be the creator of Hare and get so much crap for simply daring to exist.

He is making a language he likes and wants to use. There are probably some people who like it and find it useful. Good for them! A lot of us have dreams of building our own language. He is following his passions and people are just lining up to be Debbie Downers.

Now I almost feel like I need to learn more Hare to give the guy some encouragement and positive feedback on things done right. Be the glass half full guy.

Well I won’t. I think Zig will be the last C-like language I invest time in. It is so easy to get sucked into something new that will never go mainstream.

Post reply on HN