Hi all,
yesterday evening I was one of the lucky people attending the monthly meetup of the El Rug (LRUG), the London Ruby User Group. I decided to go there because I started recently to work with Ruby and I thought that to join the community of users would have been a good idea, and it could have helped learning. Honestly I can say that I didn’t learn anything new about Ruby (or better, I learned that it uses a garbage collector, and this says a lot about my knowledge of Ruby), but it was anyway nice to attend it.

First talk was “A Brief (and incomplete) introduction to Rust (for Rubyists)” by David Wickes. I have honestly to say that I did not enjoy too much the way in which the presentation has been done, too many jokes, it was like if he forced himself to search the jokes and the laughs of the audience. We were not at a comedy show, but anyway, the topic was important and interesting.
Rust is basically a language that is compiled, it has several similarities with Scala (and Ruby, apparently) and, from the benchmarks of Wickes, it performs faster than Ruby, Go and even old C, on the same algorithm. It is easy to code, even if I would say that Scala looks better (ints specified as I32??? semi-colon at the end of the line except for the returning value??? …). Moreover it has no garbage collector but it guarantees no memory leak. Did I mention that IT IS FAST? But how can achieve such results? With a very weird concept of ownership, meaning that anything that is stored in memory has one owner: if the value is mutable the owner is one, if it is immutable the owner is still one but there can be more borrowing references. If the owner is removed, the variable is freed. With immutability comes a bunch of free features, and compiler can do crazy optimizations achieving the performance and thread safety needed.
The last part of the talk was about the possibility to run code written in other languages inside Ruby code thorugh a FFI (Foreign Function Interface). It showed us how to invoke a Rust compiled software from Ruby through a library (GEM) that is an implementation of the FFI.

Second talk was “5 Things I wish my grandfather told me about ActiveRecord and Postgres” by Ken Alex Fassone from Carwow. I am not sure what ActiveRecord is, but I worked with Postgres, and at the end the talk was a group of suggestions to optimise a database. Five, for being precise. And they were:

  1. use statement_timeouts (basically, don’t leave your database starving your machine for a single huge query)
  2. counts are expensive as the full query (obviously a database needs to compute the full query to have the number of elements that are extracted, to count them)
  3. sorts (or better, try to have this free with indexes)
  4. limits (using OFFSET is not really smart, suggestion is to use a sensible range that uses an index, for instance on the created_at date)
  5. is adding indexes always good? (of course not, because queries are optimised by the query engine, so if you add an index to improve the performance of a query, be sure that the engine will use that)

The talk ended with a bit of advertisement like their blog or their hakaton.

Last but not least, the talk “Do you even declarative?” by John Cinnamond. This talk has been really inspirational: it was about coding not by step to reach the solution, but by declaring the state of the world, the relations between things. It was basically showing how you can consider functions as tables of associations between inputs and outputs (function rules  or function tables???). It was a short talk but really nice and funny (his jokes were better 😛 ).

It’s all for now! Stay tuned!!!

Share