I’m thinking about rewriting my Ruby on Rails application in Crystal with the Lucky web framework. It looks really awesome!
I’m just a bit concerned about not having access to a REPL (e.g. irb and rails console). I also read this Medium post about the long compilation times.
I’ve done some research and have read through a lot of threads and posts, including the following wiki pages / issues:
- GH Wiki: Crystal for Rubyists
- GH #681: Can we have a builtin REPL?
- GH #914: Differences from Ruby?
I was wondering if it might be possible to transpile Crystal code to Ruby? Then I would be able to run a Crystal program with a REPL and try out some different things at run-time. The transpiler could also add Sorbet type annotations and enable run-time checks to get type-safety.
The main thing I’m worried about is debugging code at run-time (although it doesn’t look too bad.) But it would be really nice if I had the option to run the code as plain Ruby, so I could define new methods and try things out in a REPL whenever I need to debug something.
I’m also worried about not having access to
rails console in production. I guess I will need to make sure that I can do everything from my admin dashboard, write a custom CLI tool to perform some operations, or just write some plain SQL queries.