4 ms·
We use Crystal extensively at https://heiioncall.com/ https://heiioncall.com/ for the high-performance stuff, and it’s terrific. :) As the author notes: the ty
by compumike 2y ago
We use Crystal extensively at https://heiioncall.com/ https://heiioncall.com/ for the high-performance stuff, and it’s terrific. :)
As the author notes: the typing system is very pleasant. And the standard library is great!
Generics work fine.
The testing story is very good (almost as good as rspec).
Have some experience with the Threads but won’t comment extensively as that’s about to get some big changes in the next minor release or two.
Overall: highly productive for high-performance backend API servers and background task daemons. Way more fast and pleasant to write than Rust or Go (IMHO).
- 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.
- davidatbu 2y agoHow bad are the compile times? My understanding is that the compile times are currently bad, and they can't be improved without fundamental changes to the lang/type system.
- compumike 2y agoIt depends a lot on compiler flags, especially "--release". See https://crystal-lang.org/reference/1.13/man/crystal/index.html#release-builds https://crystal-lang.org/reference/1.13/man/crystal/index.ht... : "Compiling without release mode is much faster and the resulting binaries still offer pretty good performance. Building in release mode should be used for production-ready executables and when performing benchmarks. For simple development builds, there is usually no reason to do so." For our API server https://api.heiioncall.com/ https://api.heiioncall.com/ , on my Ryzen 5950X, with a warm CRYSTAL_CACHE_DIR ("where Crystal caches partial compilation results for faster subsequent builds"), making a one-line change: Without --release: 6.11user 2.37system 0:08.19elapsed 103%CPU (0avgtext+0avgdata 590844maxresident)k With --release: 76.54user 5.49system 1:25.16elapsed 96%CPU (0avgtext+0avgdata 696876maxresident)k So let's call it about 9 seconds while developing, or 90 seconds for a CI build with full release optimizations.
- davidatbu 2y agoThan you so so much!