4 ms·
I think that Hare has a pretty rich standard library, though balanced with a constrained scope which prevents it from growing without bound. Note, though, that
by ddevault 4y ago
I think that Hare has a pretty rich standard library, though balanced with a constrained scope which prevents it from growing without bound. Note, though, that web programming is not really a domain that Hare is designed for, so we're not too concerned about being able to pick it up and write a website with it.
You can check out the stdlib here:
https://docs.harelang.org https://docs.harelang.org
Let me know if you think this strikes the right balance.
- cyber_kinetist 4y agoI really appreciate that Hare already has high-quality documentation (in terms of tutorials, language reference, standard library, etc.), which you usually don't get to see in other work-in-progress languages. (BTW, https://harelang.org/documentation/ https://harelang.org/documentation/ is the link for more general documentation about the language.)
- ddevault 4y agoThanks!
- rootlocus 4y agoPersonally, I find it hard to appreciate the stdlib when every identifier is optimized to use the least amount of characters. There's a module called `shlex` (what does that mean?), there are two types called `pwent` and `grent`, a type (can't find it again) has a size field called `sz`. Various types have single letter fields. There's a `chown` function under `os` and another one under `fs`. The "interface" for streams is defined by the very generically named type `vtable`. There's also a dedicated module just for creating a temp directory? There are dedicated modules for `linux` and `unix`, but then various os level types are defined in a catch-all module called `rt`. Also, no data structures? I don't see maps, arrays, sets. No support for custom allocators (where's the `mem` module)? The roadman mentions TLS, smtp, sql and http (no json?) but you're not too concerned with people wanting to use it for web development?
- zozbot234 4y agoIf the short identifiers sit within a namespace, it's not a big issue. This is not C. It's arguably preferable to having them be too verbose.
- ddevault 4y agoMany of these names come from Unix, and we chose not to make an opinionated renaming of something that most C programmers are already familiar with. Regarding rt - read the docs, it's a low-level module which is not meant to be used by most users. Arrays and slices are built into the language, sets and maps are not. Much like C, though slices are new to Hare. I like the concise names. It's a matter of taste.
- kragen 4y agoshlex means it's like the Python shlex module. pwent and grent have been called that for 46 years, though usually only in the names of functions: https://www.freebsd.org/cgi/man.cgi?query=getgrent&sektion=3 https://www.freebsd.org/cgi/man.cgi?query=getgrent&sektion=3 Similarly, chown. Or is your complaint that there are two different chown calls? Trying to rename these things would make the library a lot harder to understand. Can you imagine if someone decided to call the USA "Samland" because they thought the three-letter identifier was too short? Would that reduce confusion? I kind of agree about vtable, though. Arrays are part of the base language, not a module. Not sure about sets and maps.