Home

⚾︎

Maybe JRuby Is Enough

2026-10-16

I've been a fan of various things, distantly, for decades. A fan of the NASA Mars Rovers spaceplace:mars-rovers. A fan of Ruby, although I never quite broke through to having it be my everyday language. Likewise a fan of Smalltalk, Postscript, and Forth.

I've tried to drive my learning of other, perhaps trendier platforms like NodeJS with projects like PixieReport. I've received advice on Node, in particular, to continuously update to the latest version.

But updates have tended to discourage me. The npm ecosystem in particular seems like a poorly managed dependency stream which has frequently dropped incompatibilities and update warnings into my path. And as much as I'm in sympathy with the author of the left-pad package over the proprietors of Kik Messenger, a dependency ecosystem that's so messy and fragile just feels like another win for Javascript as the apotheosis of the Worse is Better approach. Do I repeat myself? I'm sure I do.

Anyway, I was happy enough with JRuby wrapping the Java image handling classes, with a little help in import aliasing* of File (java.io) to JFile to avoid a name clash with File (the Ruby class).

With friendly syntax and the extensive Java runtime library, maybe I don't need any separate dependencies for image processing and HTTP service request handling. Maybe JRuby is enough.

jruby-image-compositing

Description: A prototype of a PixieReport weather image with several partly transparent image layers composited atop a starry night background. In place of the textual weather conditions, the word "hello" is centered in a black panel at the lower frame of the image. To the right is a VS Code window with an editor open to the source of a file called "compose-jre.rb" using Ruby syntax to manipulate Java runtime classses representing the image layers. An annotation in red text on a yellow panel overlies the image, with the note "JRuby image compositing stacking up the layers!"

*JRuby import aliasing of java.io.File to "JFile":

require "java"
java_import "java.awt.image.BufferedImage"
java_import('java.io.File') { |package, name| "J#{name}" }
java_import "javax.imageio.ImageIO"
java_import "java.awt.Color"
java_import "java.awt.Rectangle"

Want to become a better programmer? Join the Recurse Center!

« Recurse Webring (Index; Random) »
← Constellation Webring (Index; Random) →