5 ms·
My understanding, it's ruby like, but statically typed and compiled. Basically instead of trying to retrofit ruby with these features without breaking things (l
by DistractionRect 3y ago
My understanding, it's ruby like, but statically typed and compiled. Basically instead of trying to retrofit ruby with these features without breaking things (like Shopify and friends do with JITs, AOTs, sherbert, etc), this is bottom up approach around these features.
Due to it's infancy the packages are sparse, so what some people do is a hybrid approach, where they write their thing in Ruby/Rails and kick out the slower parts to Crystal. This kinda gives the best of both worlds. Crystal (last I checked) had slow compile times, so gives you the dev velocity and package availability of ruby, plus the speed of a compile language when you need it. The compile times on Crystal stay low because you're only writing a small parts/microservices of your application in Crystal.
- Toutouxc 3y ago> where they write their thing in Ruby/Rails and kick out the slower parts to Crystal What's the story on Crystal/Ruby interop these days? I work on a Rails app that does document automation, and I could definitely find some specific < 1000 LOC segments that would benefit hugely from being 1:1 rewritten into Crystal and integrated with the rest of the app.
- DistractionRect 3y agoAFAIK, it's the same as any other language w/ Ruby. Http micro service, IPC, or FFI. There were some attempts to do inline crystal, like what Mojo does in Python, but I don't know if any of them became stable long term solutions. There's probably a way to get native C ext speed, you can see an old attempt here: https://www.akitaonrails.com/2016/07/06/trying-to-match-c-based-fast-blank-with-crystal https://www.akitaonrails.com/2016/07/06/trying-to-match-c-ba... But at any rate, it'll be better than ruby.