6 ms·
BMG: A Production Ready Relational Algebra in Ruby
- oezi 6y agoNeat! One obvious question: Is this intended to integrate with Rails?
- bdcravens 6y agoJust like any gem. You can create models without inheriting from ActiveRecord.
- iovrthoughtthis 6y agoIntended - I have no idea. Possible - Absolutely.
- shay_ker 6y agoIf you use Sequel, it should work fine https://github.com/enspirit/bmg#connecting-to-a-sql-database https://github.com/enspirit/bmg#connecting-to-a-sql-database
- blambeau 6y ago(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.
- elcritch 6y agoThis 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 6y agoThe 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 6y agoAFAIK 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-class-citizen http://www.try-alf.org/blog/2013-10-21-relations-as-first-cl...
- bnt 6y agoHonest 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.
- d4mi3n 6y agoDepends on the industries and locales you work in. Ruby still has a strong contingent in SF, though I hear it’s somewhat uncommon out in London. This is anecdotal and from fintech circles I’ve worked in.
- busterarm 6y agoStill very strong in NY, but everyone's looking for senior hires to do cleanup jobs to fix poorly implemented bolt-on caching schemes in ailing Rails projects. Ruby is still a great, powerful language, but in the last couple of years I've started to notice that it isn't getting the tooling love that it used to from the community. I'd still work in it for the right job, just like most any other language. Because tools are tools. Language shouldn't get as much emphasis as it does.
- purple-again 6y agoDon’t bother with a small selection of random opinions that may or may not have an agenda that doesn’t align with yours. Simply go to the monthly who’s hiring posts and compare Ruby to Python etc. for the technologies you are considering. You will need to understand that Rails is actually the keyword you are looking for rather that Ruby and I don’t know enough about the Python ecosystem to help you but I think maybe Django is the major player in that space.
- drchopchop 6y agoRuby's a bit of a niche, but there are a fair number of big-name companies built on it (Github, Basecamp, etc), certainly not bad to have in your arsenal. Note: Ruby is the programming language, but in the SaaS world that's usually coupled with Rails (the MVC architecture) and ActiveRecord (the database/SQL layer).
- Abishek_Muthian 6y agoIs 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 6y agoNote that this library implements relational algebra, a specific set of set-theoretical operations on an object called a relation — not general-purpose mathematical algebra.
- leoh 6y agoIf 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/.