Topic

ruby

Articles tagged as “ruby”.

The analogue programmer in the land of LLMs

Published

It's been a while since I've posted, for obvious reasons a lot has changed in the realm of programming. LLMs, "agentic" coding et al. I've started using them almost from day one, when they were pretty bad and they could barely generate some readable text in their images. When it comes to coding, being in my late 30s, I'm …

Moving from iTerm2 to Kitty for simplicity and performance

Published

I love iTerm2, but it can be sluggish sometimes on my old late 2016 MacBook Pro. Plus, many of its features I never use. I had tried Alacritty before, but making it look and act like iTerm2 was a no-go. This time, I tried Kitty, and within two hours of work, it looked and behaved just like my iTerm2 configuration. This …

Ruby meets LISP: Unveiling alien tech at Friendly.rb's lightning talk

Published

Originally published after the 2023 Friendly.rb conference in Romania, this is an archival account of that talk. At the Friendly.rb conference in Romania, I explored an experimental blend of Ruby and the Lisp family, implemented here through Clojure. This journey was more about embracing the spirit of experimentation …

Interesting links - Is logging a "code smell" ?

Published

I was reading this article , and it raises quite an unexpected question - "Can we consider logging as a code smell"? Clearly - the answer is more nuanced than that and whilst I do enjoy the event bus approach from the article - that seems like overkill for most applications. It's interesting that Aspect Oriented …

The perils of writing request specs using concurrent-ruby under the JVM

Published

This article describes a 2017 JRuby, concurrent-ruby, and RSpec setup. Current APIs, integrations, and behavior may differ, so the workaround below should be read as historical rather than current guidance. When I write an API, though I'm not a hard core TDD practitioner, I do like writing specs - especially request specs …

Programming archaeology: PHP's dollar sigil

Published

I started out with Java as my professional language and before I discovered Ruby, PHP was my main programming language of choice for new projects. This was probably six to seven years ago or more. I had some pretty good times with CodeIgniter [0] and various libraries like HHMVC [1]. In any case, I digress - even back …

Using RVM for quite some time? You should clean it up a bit

Published

I can't even remember the last time I ran rvm implode, I'd reckon I've been using RVM for about three years. Sure: I always update it via rvm get stable but I never really clean up old Rubies or gems, I only run bundle clean --force in each repository from time to time since I don't always use bundle exec. In any case, …

Shedding some light into UUID version 4 in Ruby and Rails

Published

Ruby's standard library and Rails's PostgreSQL adapter use by default version 4 UUIDs. This could be changed in Rails migrations via: Archive note (2015; updated context 2024): These excerpts describe Rails 4.2-era behavior, not current defaults. RFC 4122 was obsoleted by RFC 9562 in May 2024; UUIDv4 has 122 random bits …

Ruby 2.2.0 Preview 1 quick Rails benchmarks

Published

Great news everyone! Ruby 2.2 preview 1 has been released ! I'm really curious about the Incremental GC and Symbol GC so let's run some quick Rails benchmarks on a normal Rails API app. Archive note (2014): Ruby 2.2.0-preview1 was prerelease software and must not be used now. Ruby 2.2 reached end of life on 31 March 2018; …

Improve Rails performance by adding a few gems

Published

After working with Rails for some time, you start nitpicking about how to improve it. This is the first in a series of articles on how to improve (even marginally) Rails's performance. Archive note (2014): This is Rails 4.1-era advice. Do not copy these dependencies, native extensions, or global monkey patches into a …

Is Rubinius 2.2.3 production ready ?

Published

Ruby 2.1 was released this Christmas, great news everyone! It sports a better GC (RGenGC — generational GC), hierarchical method caching, some small syntax changes and non-experimental refinements. All in all one can expect 5% to 15% performance increase which is quite awesome. Archive note (2014): Rubinius 2.2.3, JRuby …

Chunked transfer encoding in Rails (streaming)

Published

Anyone who has written a little PHP knows what the flush() family of functions do. The ideal usage scenario for using chunked transfer[0] is when we have something costly to render e.g. the first three most recent articles on a blog. Why, one might ask? Why stream It is rather simple: in a normal Rails render, the server …

On Ruby modules and concerns

Published

Modules are useful for highly specialized code that can be injected into other classes for fun and profit or for creating namespaces. An interesting approach is to use modules as an alternative to classical inheritance (without the usual trade-offs) : the core idea is to share an abstracted role that can be included in a …

On semantic Ruby block constructs

Published

I was cruising around my Github notifications and I found an interesting open issue created by Jim Weirich : “The Semantic Rule for { } vs. do/end” in the Ruby style guide repository . The semantic rule The semantic rule says use { } for blocks where the primary purpose of the block is to return a value, use do/end for …

On Ruby 2.0 memory usage, Unicorn and Heroku

Published

On UNIX-like operating systems (e.g. Linux) there's the concept of process forking via the fork() system call. When one calls fork from a parent-process it will spawn a new child-process - that is a copy of its parent, then both processes return from fork. The child-process has an exact copy of the parent's memory in a …