Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Easier/cleaner way to write tree-sitter grammar #118

Open
mingodad opened this issue Sep 3, 2024 · 5 comments
Open

Easier/cleaner way to write tree-sitter grammar #118

mingodad opened this issue Sep 3, 2024 · 5 comments

Comments

@mingodad
Copy link

mingodad commented Sep 3, 2024

Describe the feature

Here https://mingodad.github.io/lua-wasm-playground/ there is an easier/cleaner way to write tree-sitter grammars like V (select Tree-sitter-ebnf-generator-V from Examples then click Run to see a full commented out grammar.js from the EBNF variant describng the grammar in Input Text (arg[1])).

I hope it can be helpful !

Use Case

Less work and better communication of the intent.

Other Information

No response

@prashanth-hegde
Copy link

Unfortunately, this repo has been archived for three years.
https://github.com/eatkins/tree-sitter-ebnf-generator

While it may serve us to tweak the grammar once-a-while, for a long-running and continuous development like V, we need a sustainable and well supported toolchain in order to rely upon the solutions

@mingodad
Copy link
Author

The code isn't big and I already did several fixes to it but a real parser would be better.
It for sure proved the point that having a declarative way to describe grammars is superior in my opinion.

@spytheman
Copy link
Member

In the long term, we should ditch tree-sitter completely, and use pure V imho.

Because of Tree Sitter, this project uses V, C, and JS, and the relationships between them are unclear and easy to forget.

It also uses a git submodule for tree-sitter, an improvement over the previous state, where you had to clone its repo separately and then keep it synchronized manually. However, it still complicates daily operations and requires a separate build process.

From a maintenance point of view, it would have been much simpler to use a single language for all of it.

@spytheman
Copy link
Member

I do not see how adding Lua to the mix will simplify things.

@mingodad
Copy link
Author

The simplification is on the grammar used to write a tree-sitter grammar the fact that the one pointed here is implemented in Lua is a implementation detail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants