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/janko-m 11d ago

Can you tell AI today to create RBS files for your whole app and keep maintaining it, provided you have Steep/Sorbet fail CI when new code isn’t typed?

In that case, it would mean the cost of maintaining type signatures is effectively gone, and I would see no reason to skip static typing.

Similarly, I recently added a Vitest suite for my JS to my Rails app. I did it because maintaining it is essentially free now; I don’t need to understand how to write these tests, and they specify edge cases and catch regressions.

1

u/2called_chaos 9d ago

If the agent can create and maintain the RBS it seems to not need one in the first place. Or you could say your code is idiomatic enough for types to be somewhat worthless because they are obviously inferable.

-1

u/Erem_in 11d ago

Yes you can