3 ms·
I recently tried out Crystal (on a project that went nowhere very quickly) and liked what I got out of it. However, I feel the language is very complex in terms
by packetlost 5y ago
I recently tried out Crystal (on a project that went nowhere very quickly) and liked what I got out of it. However, I feel the language is very complex in terms of operators and language constructs and found myself quickly completely forgetting language features even exist. There's a balance somewhere of "neatly fitting in your head" and "too simple" and Crystal firmly falls in the former for me.
- alin23 5y agoYes, the language is definitely much more complex than I expected. I’m still getting the hang of some syntax choices like the `with … yield` and the myriad ways of using closures: https://crystal-lang.org/reference/1.3/syntax_and_semantics/blocks_and_procs.html#with-yield https://crystal-lang.org/reference/1.3/syntax_and_semantics/... But I really miss some of Crystal’s features in other languages I work with: 1. Being able to declare union types when ingesting some not-so-normalized data alias UserID = String | Int32 | UUID 2. Macros and meta-programming For example here I have a `storedprop` macro which I can use to define propertied that get saved automatically to a YAML config when they are changed: https://f.lunar.fyi/uRW69B/settings.cr https://f.lunar.fyi/uRW69B/settings.cr class Settings include YAML::Serializable storedprop host : String = "ddcutil-server.local" storedprop port : UInt16 = 3485 end The good thing is you’re not really required to learn this stuff if you don’t want. But they surely can make the language fit to your style better if you invest the time to understand them.