And if that's the case... why why WHY even try to do it this way?! Feels like a VERY forced pushing of a square peg into a non-existent hole.
I would speculate the reason is that it's a very consequential change for the user, and they don't want to commit to it yet. I bet Ruby 4.0 will have optional inline types, if it turns out RBS are as functional as is expected.
.d.ts is a way to add types to source you don't control.
Ruby should have gone the path of typescript where .d.ts generation and type stripping is done by a tool you run when you publish your library. That way you can work with types in your code but export it to plain js that others can use with or without tyoings
Unlikely. They're are many Ruby implementations and on top of that rubocop has an independent parser.
Not with truly independent parsers; as I understand, most (maybe all) use, either directly or by way of a direct translation, parse.y from MRI.
> and on top of that rubocop has an independent parser.
Rubocop (or, rather, the parser gem it depends on) seems to have an independent lexer and a parser that is a Bison translation (maybe even mechanical, I'm not sure) of MRIs parse.y.
Is this because Ruby is extremely difficult to parse, to the point that nobody wanted to mess with the parser?
I remember reading a comment a while back from the creator of a Ruby parsing library and he said the language design is arbitrary and extremely difficult to parse correctly