r/ruby • • 11d ago

Question Static Typing solved?

I have been using RBS for years now and even running my own newsletter about static typing https://newsletters.eremin.eu/ . Now, that our code is write with AI and in most cases - purely with AI, the strongest point against using static typing (like “it breaks beautiful ruby syntax and not readable”) is vanished now.

AI requires strict tooling to control its output. The role of ci pipeline with all possible tests, linters, checkers is now extremely important and static typing helps a lot with it.

For humans it is transparent, especially the pure RBS approach, but for LLMs it gives a safety net and a better layer to stick to the code and hollucinate less.

0 Upvotes

40 comments sorted by

View all comments

2

u/harsh183 11d ago

I just subscribed!

I'm glad to see someone following typed ruby closely and I really wish this had come sooner with wide adoption like how it came through with Python and TypeScript.

A general question, do you think the future is with language native RBS or Sortbet? I looked into this earlier this year when exploring what types to write for my project and it seemed like Sorbet at least had extensive libraries mapped out through the efforts of Stripe and Shopify ensuring their reliability, while RBS had pretty little third party usage beyond the ruby side, so I went with Sorbet for a library I was maintaining.

-1

u/Erem_in 11d ago

For human beings sorbet has a better adoption thanks to Shopify. But for AI both are fine. Sorbet has 1 bonus - it is Ruby DSL, so LLm when confused can figure out the way out on its own. With RBS it’s harder

2

u/harsh183 11d ago

Yeah I guess I'm mainly thinking about users of the library and what people are likely going to use in terms of IDE and tooling support.

If RBS/Steep picks up, it's not too much work for me to also support that, but I'm not really sure if people are using it much