-
-
Notifications
You must be signed in to change notification settings - Fork 4
crystal
pannous edited this page Sep 19, 2021
·
9 revisions
We love the crystal programming language. It's only / main shortcomings are:
-
Type inference is slow
-
missing uniform serialization resulting in
-
lack of caching:
-
changing a line of code often results in the whole compilation of the project
-
this makes compilation often very time consuming aka slow
-
missing WASM target
-
ugly operators && || for and, or
-
data is second class citizen
minor issues:
- verbose hash maps {1 => 2, 3 => 4} vs {1:2 3:4}
- next = break
- the block mechanism is cumbersome:
def twice(&block)
yield
yield
end
best features of crystal:
- clear syntax, yet compiled
-
if
after blocks:a = 2 if some_condition
- operator overloading
- block of code is executed with the yield keyword
Interesting:
- very clear statements of language goals
- The difference between using do ... end and { ... } is that do ... end binds to the left-most call, while * { ... } binds to the right-most call
- It like operator &.
- method &.some_method
- with ... yield
- a non-captured block is always inlined
https://github.com/pannous/cheats/edit/master/cheats.crystal