-
The only reason Python has better scientific/math performance is because of Num.py and how they pushed the majority of their code down into C functions, which made the code less accessible/readable. If you need raw native performance, but still want to keep Ruby syntax, we now have Crystal as an option.
-
SaaSHub
SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives
-
In that situation, if there was a performance critical component we wanted to optimize by rewriting in Crystal, we would first extract it into its own app or worker (aka breakup the monolith, aka micro-services). Additional apps could have requests routed to them via a reverse proxy or they could be internal HTTP-endpoints. Then we would port that code to Crystal, replacing gem dependencies with Crystal shards equivalents (which there are many, and more are being added everyday), and then running the Ruby code through rubycodemod_crystal which changes minor things (ex: include? -> includes? or require 'foo' -> require "foo"). Assuming this component has RSpec tests, I would convert them to Spectator which is a Crystal clone of RSpec. Then I would tighten up the Crystal code by adding explicit Types to all instance variables and method signatures, so the compiler doesn't have to infer the types. This is basically the same process I have done when porting some of my own Ruby libraries to Crystal.
-
In that situation, if there was a performance critical component we wanted to optimize by rewriting in Crystal, we would first extract it into its own app or worker (aka breakup the monolith, aka micro-services). Additional apps could have requests routed to them via a reverse proxy or they could be internal HTTP-endpoints. Then we would port that code to Crystal, replacing gem dependencies with Crystal shards equivalents (which there are many, and more are being added everyday), and then running the Ruby code through rubycodemod_crystal which changes minor things (ex: include? -> includes? or require 'foo' -> require "foo"). Assuming this component has RSpec tests, I would convert them to Spectator which is a Crystal clone of RSpec. Then I would tighten up the Crystal code by adding explicit Types to all instance variables and method signatures, so the compiler doesn't have to infer the types. This is basically the same process I have done when porting some of my own Ruby libraries to Crystal.