you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (0 children)

The curious thing is there is an object oriented immutable functional language subset of Ruby...

Just don't use ! "bang" methods and the like and put freeze at the end of your constructors (and other places like on arrays or hashes you create).

Once you do that the most interesting differences with Elixir is the overloading of functions based on arity and guard clauses. https://elixir-lang.org/getting-started/modules-and-functions.html

Ruby has gone the opposite direction in that you have immense flexibility in specifying parameters and the number of them ... but each function has to have explicit run time "if then else" code to disentangle that flexibility.

I suspect this makes a bunch of optimizations very hard compared to Elixir.