Introspection
I'm really tempted to complete each day of the Advent of Code this year in a different language, but I don't really have twelve languages that I'm proficient in.
I've definitely written code in for more than just twelve languages in my life, but if we restrict the list to languages that I've built something non-trivial with in the last ten years, it's a relatively short list:
- Ruby
- JavaScript/TypeScript
- Lua
- Python
- Elixir
- SQL
- ReScript
I'm thinking I'll have to pad it out with languages like Zig, C/C++, Java, OCaml, and Clojure. And maybe GForth. We'll see.
Get Low
I find low_type super interesting as a project. It's damn incredible that they've managed to bolt a type system onto Ruby in a way that looks so natural, without any explicit language support. It's just Ruby. Look at it!
def say_hello(greetings: Array[String]) -> { String | nil }
return nil if greetings.first == 'Goodbye'
greetings.first
end
Part of why I love Ruby is that it's so flexible and dynamic; you can do anything with it. Like turn it into JavaScript.
Now, I'm not actually going to use this project. I love Ruby's flexibility and dynamism. I love how it gets out of your way when you're building something. Adding a type system through Sorbet, RBS, or low_type goes against that. And if you're not at Shopify/GitHub/Gusto scale, I really don't think you need it.
But I'm also not discouraging anyone from playing with these tools. Ruby is fun, and if you think this stuff is fun, go for it. Whatever you think of this approach, it's impressive.
My Markdown brings all the docs to the YARD
Last weekend, Wytch got a website. It's not a very good website (seeing as it's totally unstyled), but it does one neat thing: it uses YARD's programmatic API to pull the docs and render them out as pages using Wytch iself.
Currently the way it does this is kind of lame, but it'll do for now. The site also contains the greatest Markdown renderer of all time:
def markdown_to_html(text)
# Simple markdown rendering - just handle basic formatting
text.gsub(/`([^`]+)`/, '<code>\1</code>')
.gsub(/\*\*([^*]+)\*\*/, '<strong>\1</strong>')
.gsub("\n\n", "</p><p>")
.then { |s| "<p>#{s}</p>" }
end
Disclaimer: Claude wrote that shit, not me. I was at the pub and just trying to get the YARD-to-Wytch integration working and didn't want to bother with the details. I'll fix it later.
Participation Trophy
I stumbled on this link this week, 10 ways to participate in the Ruby community and only now, as I come to share it here, realize that my podcast is listed in it. Thanks Javier!
Anyway, the Ruby community is wonderful, so I just wanted to share this resource for people who want to be more involved in it.
Antinoë – The Fold
I'm sure most of you never listen to my music recommendations. That's fine. When I pick an album to showcase in this newsletter, I do it because I'm enjoying the record. I doubt most of you are metalheads. Well, here's something the non-metalheads. (You metalheads are allowed to enjoy this too, though.)
Here's some music to listen to on your next winter walk. Its haunting melodies will perfectly complement the chill of the wind, the barren trees, and the cloudy sky. Enjoy the melancholy.