tree-sitter-ruby VS parser

Compare tree-sitter-ruby vs parser and see what are their differences.

SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
surveyjs.io
featured
InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
tree-sitter-ruby parser
9 5
155 1,557
3.2% -
0.0 8.4
about 2 months ago 8 days ago
JavaScript Yacc
MIT License GNU General Public License v3.0 or later
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

tree-sitter-ruby

Posts with mentions or reviews of tree-sitter-ruby. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-05-19.
  • Emacs and Java Development: Corfu + Cape + LSP-Mode + Treesit
    21 projects | /r/emacs | 19 May 2023
    (use-package treesit :ensure nil :custom ;; Some stuff taken from here: https://robbmann.io/posts/emacs-treesit-auto/ (treesit-extra-load-path '("/usr/lib64/")) (treesit-language-source-alist '((bash . ("https://github.com/tree-sitter/tree-sitter-bash")) (c . ("https://github.com/tree-sitter/tree-sitter-c")) (c++ . ("https://github.com/tree-sitter/tree-sitter-cpp")) (csharp . ("https://github.com/tree-sitter/tree-sitter-c-sharp")) (css . ("https://github.com/tree-sitter/tree-sitter-css")) (elixir ("https://github.com/elixir-lang/tree-sitter-elixir")) (html . ("https://github.com/tree-sitter/tree-sitter-html")) (java . ("https://github.com/tree-sitter/tree-sitter-java")) (javascript . ("https://github.com/tree-sitter/tree-sitter-javascript")) (json . ("https://github.com/tree-sitter/tree-sitter-json")) (lua . ("https://github.com/Azganoth/tree-sitter-lua")) (makefile . ("https://github.com/alemuller/tree-sitter-make")) (org . ("https://github.com/milisims/tree-sitter-org")) (python . ("https://github.com/tree-sitter/tree-sitter-python")) (tsx . ("https://github.com/tree-sitter/tree-sitter-typescript" "master" "tsx/src")) (typescript . ("https://github.com/tree-sitter/tree-sitter-typescript" "master" "typescript/src")) (ruby . ("https://github.com/tree-sitter/tree-sitter-ruby")) (rust . ("https://github.com/tree-sitter/tree-sitter-rust")) (sql . ("https://github.com/m-novikov/tree-sitter-sql")) (toml . ("https://github.com/tree-sitter/tree-sitter-toml")) (yaml . ("https://github.com/ikatyang/tree-sitter-yaml")))) (major-mode-remap-alist '((c-mode . c-ts-mode) (c++-mode . c++-ts-mode) (csharp-mode . csharp-ts-mode) (css-mode . css-ts-mode) (html-mode . html-ts-mode) (java-mode . java-ts-mode) (js-mode . js-ts-mode) (json-mode . json-ts-mode) (makefile-mode . makefile-ts-mode) ;; (org-mode . org-ts-mode) ;; not mature yet (python-mode . python-ts-mode) (typescript-mode . typescript-ts-mode) (ruby-mode . ruby-ts-mode) (rust-mode . rust-ts-mode) (toml-mode . toml-ts-mode) (yaml-mode . yaml-ts-mode))) (treesit-auto-fallback-alist '((toml-ts-mode . conf-toml-mode) (typescript-ts-mode . nil) (tsx-ts-mode . nil))) (treesit-font-lock-settings t) (treesit-simple-indent t) (treesit-defun-type-regexp t)) (use-package treesit-auto :demand t :config (setq treesit-auto-install t) (global-treesit-auto-mode))
  • Building tree-sitter languages for Emacs
    20 projects | /r/emacs | 30 Dec 2022
  • Best Syntax Highlighter for Ruby?
    2 projects | /r/vim | 15 Mar 2021
    Just use tree-sitter with neovim. It has a Ruby plugin as well https://github.com/tree-sitter/tree-sitter-ruby
  • Tree-sitter: an incremental parsing system for programming tools
    24 projects | news.ycombinator.com | 22 Feb 2021
    @chrisseaton you are correct, the JSON file is generated. The handwritten parts are:

    - https://github.com/tree-sitter/tree-sitter-ruby/blob/32cd5a0...

parser

Posts with mentions or reviews of parser. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-11-14.
  • Inko Programming Language
    4 projects | news.ycombinator.com | 14 Nov 2023
    I have mixed feelings on Rust's syntax, especially around generics, lifetimes, and the `modifier -> keyword` syntax (i.e. `async fn` or `pub fn`). For Inko, I wanted something that's easy to parse by hand, and no context specific parsing (e.g. `QUOTE -> something` being the start of a lifetime in one place, but a char literal in another place).

    Another motivator for that is that years ago I worked on Rubinius for a while (an implementation of Ruby), and helped out with a parser for Ruby (https://github.com/whitequark/parser). The Ruby developers really liked changing their already impossible syntax in even more impossible ways on a regular basis, making it a real challenge to provide syntax related tools that support multiple Ruby versions. I wanted to avoid making the same mistake with Inko, hence I'm actively trying to keep the syntax as simple as is reasonable.

    As for the specific examples:

    - `fn async` means your parser only needs to look for `A | B | fn` in a certain scope, instead of `A | B | fn | async fn`. This cuts down the amount of repetition in the parser. An example is found at https://github.com/inko-lang/inko/blob/8f5ad1e56756fe00325a3..., which parses the body of a class definition.

    - Skipping parentheses is directly lifted from Ruby, because I really like it. Older versions took this further by also letting you write `function arg1 arg2`, but I got rid of that to make parsing easier. It's especially nice so you can do things like `if foo.bar.baz? { ... }` instead of `if foo().bar().baz?()`, though I suspect opinions will differ on this :)

    - Until recently we did in fact use `::` as a namespace separator, but I changed that to `.` to keep things consistent with the call syntax, and because it removes the need for remembering "Oh for namespaces I need to use ::, but for calls .".

    - `[T]` for generics is because most editors automatically insert a closing `]` if you type `[`, but not when you type `<`. If they do, then trying to write `10<20` is annoying because you'd end up with `10<>20`. I also just like the way it looks more. The usual ambiguity issues surrounding `<>` (e.g. what leads to `foo::()` in Rust) doesn't apply to Inko, because we don't allow generics in expressions (i.e. `Array[Int].with_capacity(42)` isn't valid syntax) in the first place.

  • Marc-André Lafortune on the abstract syntax tree and rewiring Rubocop
    4 projects | dev.to | 7 Sep 2023
    So there was this really awesome gem called parser written by someone not on the core team that gives you a super clean understanding of the Ruby code. Not only does it not care if the parentheses are there or not, but there's a really well structured and precise mapping of where the information comes from and it is completely semantic. So if you've got parentheses or not, it's not gonna make any difference in the structure of your abstract syntax tree, but you can actually ask where are the locations. That is taken care of, but the understanding of the code, what's going on in the code is completely independent of if you wrote those parentheses or not.
  • Where is keyword behavior defined?
    4 projects | /r/ruby | 26 Dec 2022
    Working with those things, possibly with the help of reading books, tends to be how it's learned I'd say. I'm not the one you asked, but I personally worked with Ruby for 10 years, worked on a system to improve coverage reports, which relied on rewriting ruby code. Doing so was done using the Parser gem, which is a ruby parser that has a different abstract syntax tree (https://github.com/whitequark/parser). I'm also interested in programming languages development, so I try to read on this / develop my own language in my free time.
  • Bad Ruby: Hash Value Omission
    2 projects | /r/ruby | 20 Jan 2022
    Changes like this have been going on for years. I remember that back when I was still helping out with https://github.com/whitequark/parser, the author on a regular basis had to deal with Ruby making yet more non-trivial syntax changes. IIRC they eventually burned out on the project because of that, but my memory is a bit fuzzy.
  • Tree-sitter: an incremental parsing system for programming tools
    24 projects | news.ycombinator.com | 22 Feb 2021
    This is more a function of Ruby than of tree-sitter. The tree-sitter grammars for other languages are hopefully less inscrutable. For Ruby, we basically just ported whitequark's parser [1] over to tree-sitter's grammar DSL and scanner API.

    [1] https://github.com/whitequark/parser

What are some alternatives?

When comparing tree-sitter-ruby and parser you can also consider the following projects:

nvim-treesitter - Nvim Treesitter configurations and abstraction layer

tree-sitter-kotlin - Kotlin grammar for Tree-sitter

tree-sitter-c-sharp - C# Grammar for tree-sitter

lsif-os - A (mostly) language-agnostic indexer for generating LSIF data.

elisp-tree-sitter - Emacs Lisp bindings for tree-sitter

Moose - MOOSE - Platform for software and data analysis.

sourcegraph - Code AI platform with Code Search & Cody

semshi - 🌈 Semantic Highlighting for Python in Neovim

csharp-mode - A major-mode for editing C# in emacs