January 2019
Intermediate to advanced
246 pages
5h 23m
English
Unfortunately, there isn’t yet a migration tool from Ruby to Crystal, but converting Ruby code to Crystal is often quite straightforward. Consider the following:
A lot of the dynamic power of Ruby does not exist in Crystal. This includes eval, send, instance_eval, auto_load, and define_method. Macros in Crystal can sometimes be used to achieve the same goal.
Crystal also has less introspection—for example, methods doesn’t exist on an object, though @type.methods works in macros.
When overflow occurs in integer calculations, Ruby converts automatically from Fixnum to Bignum. Crystal 0.27, on the other hand, applies simple modular arithmetic. (Overflow is planned to appear in future versions of Crystal, ...
Read now
Unlock full access