
BMG: A Production Ready Relational Algebra in Ruby - iovrthoughtthis
https://github.com/enspirit/bmg
======
elcritch
This is great looking! I don't use Ruby, but it's good to see libraries like
this. It still surprises me how few libraries implement the relational
algebra. Building on proper mathematical theory that's conducive to
programming languages really removes a lot of impedance mismatch and leaky
abstractions over ORM's.

~~~
bdcravens
The Rails ORM (ActiveRecord) is built atop of a relational algebra gem (arel,
which was eventually pulled into the AR library). I'm pretty sure the arel
functions are considered private API, so it's not necessarily best practice,
but you have the option to call those functions directly when you find the ORM
lacking and don't want to pass around raw SQL.

~~~
blambeau
AFAIK Arel is not a real algreba, since it does not really allow composing
relations the way we want.

More info here: [http://www.try-alf.org/blog/2013-10-21-relations-as-first-
cl...](http://www.try-alf.org/blog/2013-10-21-relations-as-first-class-
citizen)

------
bnt
Honest question: does it make sense to learn Ruby in 2020, with the hopes to
actually have a job with it for the next 5 years? I want to leave JS world for
something different, and I’m evaluating Elixir, Python and even PHP. What I’m
looking to work on are basically SaaS sites, nothing too crazy. Would
appreciate any thoughts.

~~~
iovrthoughtthis
My personal experience is that the ruby job market is quite strong. For
context, I've been a ruby developer (among other languages) for 5+ years.

Have you tried looking for some ruby work?

------
leoh
If you are using Java or a JVM language (e.g. Ruby, Clojure, etc.) it may be
worth checking out Apache Calcite
[https://calcite.apache.org/](https://calcite.apache.org/).

------
Abishek_Muthian
Is there any such library for Go? I was searching one for simple algebra stuff
while back and only prominent math library for Go seems to be gonum[1] which
for lack of better term seemed 'too large' for my purpose.

I didn't look properly or is Go's math scene not that great?

[1][https://github.com/gonum/gonum](https://github.com/gonum/gonum)

~~~
atombender
Note that this library implements relational algebra, a specific set of set-
theoretical operations on an object called a relation — not general-purpose
mathematical algebra.

------
oezi
Neat! One obvious question: Is this intended to integrate with Rails?

~~~
blambeau
(lead dev here). Not _intended_ , as I don't use Rails myself. But I would of
course support every PR making Bmg compatible/great with it.

