Build your own lazy operation evaluator in Elixir

clessg | 66 points

For those new to Elixir it may not be immediately obvious why this is so cool. You can do the same thing in Javascript by passing functions in object properties after all right?

With Elixir, the struct is immutable which means it can be safely accessed in parallel without dealing with locking/mutexes. You also have a horizontally scalable "cluster" of machines (even on a single physical machine, this is over-simplified but it's an accurate mental model) so you could easily have some producer that is creating these expensive math ops and pushing them onto a queue, and then a pool of "workers" that run the actual execution distributed across cluster CPUs. And this can be done fairly easily with idiomiatic Elixir, without adding external dependencies! Really neat stuff.

freedomben | 10 months ago

That's pretty cool and can scale well for parallel or concurrent computing.

deofoo | 10 months ago