4 ms·
IRB type completion comes as a result of a chain of events which starts from the incredible work done by Kevin Newton (et al) to write a new canonical Ruby pars
by ryanseys 3y ago
IRB type completion comes as a result of a chain of events which starts from the incredible work done by Kevin Newton (et al) to write a new canonical Ruby parser called Prism in C99 with no dependencies [1].
With Prism, you can then create tool suites like syntax_tree [2], which then leads Prettier formatters [3], a new Ruby LSP [4], which unlocks a new Ruby LSP VS Code extension [5], not to mention a laundry list of other gems like Rubocop and of course Ruby itself that will benefit from a faster and more maintainable Ruby parser.
It's a beautiful illustration of the power of questioning conventions, going back to first principles to uncover better solutions to previously solved problems, whose new solutions create new capabilities which unlocks the ability to solve new problems.
[1]: https://github.com/ruby/prism https://github.com/ruby/prism
[2]: https://github.com/ruby-syntax-tree/syntax_tree https://github.com/ruby-syntax-tree/syntax_tree
[3]: https://github.com/prettier/plugin-ruby https://github.com/prettier/plugin-ruby
[4]: https://github.com/Shopify/ruby-lsp https://github.com/Shopify/ruby-lsp
[5]: https://marketplace.visualstudio.com/items?itemName=Shopify.ruby-lsp https://marketplace.visualstudio.com/items?itemName=Shopify....
- boundlessdreamz 3y agoDidn't syntax_tree come before Prism?
- st0012 3y agosyntax_tree was actually created before Prism. Ruby LSP also adopted syntax_tree first, and then switched to Prism (then called YARP) when it was mature enough. But indeed, the type completor would've been much harder to build and maintain if without Prism.
- ryanseys 3y agoGood correction! My apologies.