tree-sitter-cpp VS tree-sitter-javascript

Compare tree-sitter-cpp vs tree-sitter-javascript and see what are their differences.

SurveyJS: Build JSON-Driven Surveys and Forms with Full Data Control
Add the SurveyJS UI components to your JS app (React/Angular/Vue3). Securely collect and analyze data without sending it to 3rd-party servers. Fully customizable, works with any backend, and ideal for data-heavy apps. Learn more.
surveyjs.io
featured
InfluxDB – Built for High-Performance Time Series Workloads
InfluxDB 3 OSS is now GA. Transform, enrich, and act on time series data directly in the database. Automate critical tasks and eliminate the need to move data externally. Download now.
www.influxdata.com
featured
tree-sitter-cpp tree-sitter-javascript
8 7
387 453
2.6% 1.5%
7.4 6.2
28 days ago 28 days ago
JavaScript JavaScript
MIT License MIT License
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-cpp

Posts with mentions or reviews of tree-sitter-cpp. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-03-21.

tree-sitter-javascript

Posts with mentions or reviews of tree-sitter-javascript. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2025-01-03.
  • Swc4j: SWC for Java
    4 projects | news.ycombinator.com | 3 Jan 2025
    I get the sense that treesitter is more for syntax highlighting than for real parsing, since I raised this issue[0] a while ago and I don't think anyone's really interested in it (not really interested enough myself in tree-sitter to see if it can be fundamentally solved; solving it involves making almost all production rules in the grammar parametric over two booleans).

    Admittedly I haven't tested the TypeScript treesitter grammar, but I'd be surprised if the issue is fixed there. I've put together a sample file[1] that demonstrates various cases of these context dependencies. If I remember correctly, Sublime's highlighter was the best at handling these cases out of various editors I tried, though it still failed at some of the ones at the bottom involving multi-line function expressions within object literal keys. GitHub/gist uses treesitter, so you'll notice that sometimes the "REGEX" and "DIVISION" blocks are inconsistently coloured, but a correct parser should associate a colour consistently to them. Not demonstrated here, but inserting a multi-line comment in a file that is parsed incorrectly will throw the entire thing off.

    [0] https://github.com/tree-sitter/tree-sitter-javascript/issues...

    [1] https://gist.github.com/Maxdamantus/a11b41675fcde25ffc9b7ef0...

  • How to make `goto_next_test` and `goto_prev_test` work?
    2 projects | /r/HelixEditor | 20 May 2023
    I believe goto_next_test requires support from the tree-sitter parser, specifically tree-sitter-javascript in the case of JS and tree-sitter-typescript in the case of TS.
  • Emacs and Java Development: Corfu + Cape + LSP-Mode + Treesit
    21 projects | /r/emacs | 19 May 2023
  • Building tree-sitter languages for Emacs
    20 projects | /r/emacs | 30 Dec 2022
  • RMS – EmacsConf Talk
    3 projects | news.ycombinator.com | 6 Dec 2022
    Here is the tree-sitter grammar of Elisp:

    https://github.com/Wilfred/tree-sitter-elisp/blob/main/gramm... (approx. 200 lines)

    and here is the grammar of JavaScript:

    https://github.com/tree-sitter/tree-sitter-javascript/blob/m... (approx. 1200 lines)

    JavaScript evolved into a language of similar complexity as Perl 5 (the corresponding tree sitter syntax table counts almost 2000 lines, currently).

  • How to use Emacs 29 Tree-sitter?
    12 projects | /r/emacs | 3 Dec 2022
    Next, clone the Javascript grammar for tree-sitter from https://github.com/tree-sitter/tree-sitter-javascript and compile it with cc -shared -fPIC -g -O2 -I src src/scanner.c src/parser.c -o ~/.emacs.d/tree-sitter/libtree-sitter-javascript.dylib.
  • Trying to implement language injection for template literals: CSS inside of ` `
    2 projects | /r/Atom | 31 Mar 2021
    I downloaded the tree-sitter-javascript repo, created a folder for a custom grammar package, and created a basic package.json file, but I have no clue what the Atom page is talking about regarding call_expression, and the addInjectionPoint code. ELI5?

What are some alternatives?

When comparing tree-sitter-cpp and tree-sitter-javascript you can also consider the following projects:

difftastic - a structural diff that understands syntax 🟥🟩

styled-jsx - Full CSS support for JSX without compromises

git-split-diffs - Syntax highlighted side-by-side diffs in your terminal

tree-sitter-elixir - Elixir grammar for tree-sitter

tree-sitter-c - C grammar for tree-sitter

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

SurveyJS: Build JSON-Driven Surveys and Forms with Full Data Control
Add the SurveyJS UI components to your JS app (React/Angular/Vue3). Securely collect and analyze data without sending it to 3rd-party servers. Fully customizable, works with any backend, and ideal for data-heavy apps. Learn more.
surveyjs.io
featured
InfluxDB – Built for High-Performance Time Series Workloads
InfluxDB 3 OSS is now GA. Transform, enrich, and act on time series data directly in the database. Automate critical tasks and eliminate the need to move data externally. Download now.
www.influxdata.com
featured

Did you know that JavaScript is
the 4th most popular programming language
based on number of references?