3 ms·
> As the author notes: the typing system is very pleasant. And the standard library is great! The author complained about the standard library, specifically th
by nurettin 2y ago
> As the author notes: the typing system is very pleasant. And the standard library is great!
The author complained about the standard library, specifically the Dir module using inconsistent types and the implementation details of Temp files potentially leading to security flaws, leading me to think there are more warts he didn't cover.
- compumike 2y agoTemp file issue is debunked here: https://news.ycombinator.com/item?id=41684848 https://news.ycombinator.com/item?id=41684848 Dir module works fine, though maybe the docs could be improved. https://crystal-lang.org/api/1.13.3/Dir.html https://crystal-lang.org/api/1.13.3/Dir.html . The stdlib code is also highly readable: https://github.com/crystal-lang/crystal/blob/d14d04562/src/dir.cr#L111 https://github.com/crystal-lang/crystal/blob/d14d04562/src/d... shows that #each_child just calls #read and yields it to the block, so I don't think this is really a wart :)
- nurettin 2y agoI think the Dir issue wasn't that documentation was inadequate or stdlib code was hard to read, but he expected paths, and received strings instead.