I'm not too invested in ruby but AFAIK they built a new parser from scratch, that was portable, that means that all the other projects like rubocop, solargraph (or how the ruby lsp is called) and all other ruby implementations can use it, so it will be easier from now on to maintain those projects up to date with the official ruby parser.
It’s disappointing there doesn’t seem to be an easily available blog post or announcement (maybe I just didn’t find it), but the design doc lists a few motivations: https://github.com/ruby/prism/blob/main/docs/design.md
Reading between the lines it looks to me like this is motivated by ripper (the old parser) not being a great fit for tooling around ruby like IDE LSP integrations and such. Ripper isn’t fault tolerant (if the script has a a syntax error you don’t get a partial tree, just an exception); being implemented in ruby enough itself that it kind of depends on ruby which isn’t always convenient for integration (IDEs like vscode make plugins in JS easy, prism comes with node bindings), and maybe being enough of a crufty old code base that maintaining it and fixing those design issues was deemed impracticable.
Also worth noting if it wasn’t clear I’m pretty sure this parser is not being used or intended to be used for a ruby runtime to actually execute scripts, and that’s not what ripper was for either. This is for tooling that operates on ruby files for other purposes: syntax highlighting, linting, stuff like that.
ksec|2 years ago
Still unsure about M:N thread scheduler and Ractor.
thowaway91234|2 years ago
sparker72678|2 years ago
pjmlp|2 years ago
meisel|2 years ago
norman784|2 years ago
You can read more about the parser I mentioned here (but it seems that is has/hat a different name before?) https://railsatscale.com/2023-06-12-rewriting-the-ruby-parse...
wfleming|2 years ago
It looks like there was also a podcast interview last year that touches on the origins of the project: https://topenddevs.com/podcasts/ruby-rogues/episodes/the-new...
Reading between the lines it looks to me like this is motivated by ripper (the old parser) not being a great fit for tooling around ruby like IDE LSP integrations and such. Ripper isn’t fault tolerant (if the script has a a syntax error you don’t get a partial tree, just an exception); being implemented in ruby enough itself that it kind of depends on ruby which isn’t always convenient for integration (IDEs like vscode make plugins in JS easy, prism comes with node bindings), and maybe being enough of a crufty old code base that maintaining it and fixing those design issues was deemed impracticable.
Also worth noting if it wasn’t clear I’m pretty sure this parser is not being used or intended to be used for a ruby runtime to actually execute scripts, and that’s not what ripper was for either. This is for tooling that operates on ruby files for other purposes: syntax highlighting, linting, stuff like that.
leipert|2 years ago
HN thread: https://news.ycombinator.com/item?id=36310130