|
|
|
|
|
by chrisseaton
2351 days ago
|
|
> without needing to really think in a whole different programming experience But Crystal has entirely different semantics to Ruby. They look vaguely similar at a superficial level, but the semantics are not even remotely similar. |
|
I am porting a relatively simple ruby app to Crystal to see how it is and most of it is copy/paste and then some fixing and adding type definitions where needed. The only issues I have had are where I am using a rubygem that doesn't have a crystal counterpart.
For example a pretty simple Gem that connects to a socket and parses incoming data was exceedingly easy to port, including tests.
* https://gitlab.com/overlord-bot/tacview-ruby-client
* https://gitlab.com/overlord-bot/tacview-crystal-client
For a more specific example these two files are almost identical:
* https://gitlab.com/overlord-bot/tacview-ruby-client/blob/mas...
* https://gitlab.com/overlord-bot/tacview-crystal-client/blob/...
The only thing not done was CRC hash calculating for a password because there was no crystal shard for it and it was low priority so I didn't write one.