Retiring from the core teams

Today we’re announcing on the official Hanami blog that I am retiring from the core teams. It’s a decision I’ve made after about 2 years of contemplating how I want to move forward with my involvement with the Ruby community and its Open Source ecosystem. As you can imagine, this decision has not been easy to make. I have a long history of working with Ruby and being an active member of its Open Source community. I will do my best to tell you why I made this decision, but first and foremost, this post is about the people who changed my life and a way of saying thank you. Let’s start with that! ...

December 12, 2024 · 7 min · Peter Solnica

Rails and its Ruby dialect

This was originally titled “Rails is not written in Ruby” but based on feedback, I decided to change the title. I’m born and raised in Kraków, a beautiful city in Poland, maybe you’ve heard about it, maybe you’ve even been here. In Poland we speak Polish, which is a really difficult language, it’s actually considered one of the top-10 most difficult languages to learn in the world. In Poland, just like in many other countries, there are regions where dialects are used rather than “the pure” form of the language, and so in my city, we have our own dialect. It’s not too different from Polish, but we have our special words, and a special way of saying certain words. For example, we say “czy”, which means “three”, even though the correct form is “trzy”, but we’re like “that’s too hard” so we keep it simple, “czydzieści czy” (33) instead of “trzydzieści trzy”. The rest of Poland is making fun of us because of this kind of stuff, but whatever, it’s our dialect - this is how we like to speak. ...

February 2, 2022 · 12 min · Peter Solnica

10 Years of Open Source

On June 4th, 2011 I released the first version of Virtus, a ruby gem that I extracted from the DataMapper project. I remember how I felt about Open Source back then, and I have to tell you that my perspective has changed a lot. 10 years, a freaking decade, is a lot of time…I’ve gone through a lot of ups-and-downs during that time, as my open-source contributions sky-rocketed, and that changing perspective is something I continuously think about. I don’t know how many projects I contributed to, how many libraries I’ve written, I honestly do not know. ...

June 4, 2021 · 10 min · Peter Solnica

The 5 Rules of Simple RSpec Tests

The 5 “rules” I try to follow in order to write simple RSpec tests. Let’s GO. 1. Max 2 levels of describe/context nesting Everything above 2 is a code-smell and causes alarm bells in my head to ring. The more levels of nesting you have, the harder it is to understand what a given example is doing. If you add before/after hooks to the mix, it’ll become even worse. I often reduce nesting by simply using example descriptions like that: ...

May 11, 2021 · 5 min · Peter Solnica

WHOOPS! Thoughts on Rails, forking and leadership

I decided to let it all out. What a funny coincident because exactly 5 years ago I wrote that I’m leaving Rails for good. I thought I’m gonna leave Ruby too but that didn’t happen and I’m still a very happy Rubyist and because of this I’m really saddened to see what’s been going on the past few days; but HEY, it’s up to us to make something good out of it. ...

May 1, 2021 · 7 min · Peter Solnica

Fixing Ruby 2.7 compilation error on Big Sur

We’re in the process of upgrading to Ruby 2.7.2 at castle.io and today I had to install it on macOS Big Sur. Unfortunately, I hit a compilation error that looked like this: $ ruby-install ruby 2.7.2 # yada yada yada compiling dmyext.c translating probes probes.d . ./vm_opts.h compiling array.c compiling ast.c compiling bignum.c compiling class.c compiling compar.c compiling compile.c compile.c:9857:61: error: use of undeclared identifier 'RUBY_FUNCTION_NAME_STRING' if (table == NULL) rb_bug("%s: table is not provided.", RUBY_FUNCTION_NAME_STRING); ^ compile.c:9859:63: error: use of undeclared identifier 'RUBY_FUNCTION_NAME_STRING' rb_bug("%s: index (%d) mismatch (expect %s but %s).", RUBY_FUNCTION_NAME_STRING, i, name, table[i].name); ^ 2 errors generated. make: *** [compile.o] Error 1 !!! Compiling ruby 2.7.2 failed! After some digging I managed to solve this problem by doing the following: ...

December 9, 2020 · 1 min · Peter Solnica

Be cautious with Ruby coercion methods

Coercion is a tricky problem to solve and it’s something we need pretty much everywhere. Whether you’re building a web application or a CLI tool, you will have to coerce values in some way. I say it’s a tricky problem because Ruby comes with many builtin coercion methods but it’s not enough. Furthermore, the builtin methods may actually lead to bugs or surprising behaviors. In this article we’ll take a look at the builtin coercion methods, various caveats that come with their usage and ways how you can handle coercion in a more predictable and strict way. ...

July 29, 2020 · 5 min · Peter Solnica

Introducing dry-schema

Two years ago (!!!) I published a post on discourse.dry-rb.org explaining my plans for dry-validation 1.0.0 and in this post I mentioned that there will be a new gem called dry-schema that dry-validation will use for its schemas. It’s crazy how time flies because I swear I thought it was last year. I know that over this time dry-validation has been accumulating a lot of issues (125 in the moment of writing this article), and I know it sucks, big time, that I didn’t have a chance to address any of these. ...

January 31, 2019 · 6 min · Peter Solnica

A quick​ recap and plans for the future

Hi, I’m back! I haven’t written anything on this blog since November 2016, which is sad but it is what it is. I’ve got so much to tell you. A lot happened during this time, and I’ll try to summarize it here and also talk a bit about my plans for the future. The Ruby Prize Almost a year ago I was honored to go to Matsue, Japan, to attend the Ruby World 2017 conference, where I received the Ruby Prize from Matz himself. Getting the prize and visiting Japan was a fantastic experience for me, and I’m deeply grateful. I’ve been thinking a lot about the Ruby community since then, mostly reflecting on how we’re evolving as programmers and trying to see how well my 8+ years of OSS contributions fit in this process. There are clear signs that a lot of Ruby developers are entirely on board with various ideas introduced by projects like rom-rb or dry-rb. Watching growing adoption makes me very happy (dry-types has > 2.7M downloads on rubygems.org already!), but at the same time, I’m aware that there’s much more work that we need to put into these projects if we want more people to use them. ...

August 29, 2018 · 7 min · Peter Solnica

Duck typing vs type safety in Ruby

Duck typing is one of the virtues of the Ruby language, it adds a lot of flexibility to the code, and allows us to use objects of different type in places where only specific methods are needed. Even though the idea behind duck typing may seem to be straight-forward, it is easy to use it incorrectly. It’s interesting to notice that over many years we’ve adopted various techniques that seem to leverage duck typing, but the specifics of how exactly we’re doing it are actually questionable, and I believe they deserve some reconsideration. This is directly related to the other important subject - type safety, and in this article I’d like to explain why we should care about it, while keeping duck typing in mind, too. ...

November 2, 2016 · 6 min · Peter Solnica