4 ms·
Personally, 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` (w
by rootlocus 4y ago
Personally, 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.