|
|
|
|
|
by npn
1518 days ago
|
|
I think Crystal is better than Python in term of language design. Unlike Ruby and Python that were way older, crystal is relatively new, so they learned from other languages mistake and try to improve it, result in a more cleaner language. For the cases mentioned, I think crystal is immensely helpful:
- Reading/writing files are easy, usually a single method will give you the result you want.
- Working with directories are nice, things like `Dir.mkdir_p`, `Dir.each_child`, `File.exists?`... all existed to make your life easier.
- Like ruby, you can invoke shell command easily using backticks
- There are some useful libraries to for console app, like `colorize` or `option_parser`. Crystal is a battery included language, so the standard library is filled with useful libraries.
- Working with lists and hashmaps is a breeze, since the Enumerable and Iterable modules are filled with useful methods, mostly inspired from ruby land.
- Concurrent is built in, so you can trivially write performant IO-bounded tasks like web crawlers. For a project that made by a handful of people, I just can't praise the dev team enough for making a language this practical. |
|