I find the T-Ruby syntax appealing because types are incorporated into the grammar.
On the other hand, by writing RBS comments in .rb files,
- type checking (by Sorbet, Steep or TypeProf)
- RBS file generation (by rbs-inline)
- direct execution
can all be achieved.
# a.rb
class A
#: (Integer) -> String
def foo(x)
x.to_s
end
end
While projects like ruby-next exist, transpilation is not yet as common in the Ruby community compared to the JavaScript community, so I thought T-Ruby might not be widely used.
Therefore, I thought that if T-Ruby could be directly executed, it could be said to have equivalent functionality to raw Ruby files with RBS comments written in them.
I find the T-Ruby syntax appealing because types are incorporated into the grammar.
On the other hand, by writing RBS comments in .rb files,
can all be achieved.
While projects like ruby-next exist, transpilation is not yet as common in the Ruby community compared to the JavaScript community, so I thought T-Ruby might not be widely used.
Therefore, I thought that if T-Ruby could be directly executed, it could be said to have equivalent functionality to raw Ruby files with RBS comments written in them.