Tree-sitter: an incremental parsing system for programming tools
121–130 of 138 posts
Re: Tree-sitter: an incremental parsing system for programming tools
#122Where is the SQL parser? Any specific reason why is it missing (not even started)?
That said, this is exactly why we've released tree-sitter as an open-source project. That way there's no need for anyone to be blocked on my team finding the time to work on an SQL parser. Most extant tree-sitter parsers [1] have been developed by external language communities, and not by the core tree-sitter maintainers.
(Also note that SQL is a particularly wrinkly language, since there are so many different dialects. Are you looking for an ANSI SQL parser? A MySQL SQL parser? One that covers all of them to some degree?)
[1] https://tree-sitter.github.io/tree-sitter/#available-parsers
Re: Tree-sitter: an incremental parsing system for programming tools
#123I’m going to play with this and see if I can make a generic language server for vscode that works across languages. Unless someone has already done that.
What would be really cool is that tree-sitter (or a sister package) that provides incremental formatting primitives across languages.
The closest language agnostic formatter that comes to mind is prettier.js with its extensions.
incremental parser —> language server -> formatter across languages would be super rad.
Re: Tree-sitter: an incremental parsing system for programming tools
#124Earlier quoted context omitted.
Tooting my own horn, Emacs’ csharp-mode[1] is undergoing a rewrite to be 100% based on tree-sitter rather than regexps. The new code runs way faster and is so much nicer to work with. Once all the kinks are gone, I can’t imagine going back. [1] https://github.com/emacs-csharp/csharp-mode/blob/master/csha...
This looks awesome! Do you mind elaborating on any kinks which you found?
- indentation may be fine for a final doc, but not always while editing. Especially for new lines starting new code-blocks.
- adding new syntax not already known by tree-sitter requires up streaming to at least 2 repos before we can use it in a released version of our package. This can feel less hands on and slow than working in a single repo where you have full control.
No super-biggies yet though.
Re: Tree-sitter: an incremental parsing system for programming tools
#125Does GitHub currently use tree-sitter for syntax highlighting? If yes, are the libraries open-source? Thanks :)
For some languages, yes. https://news.ycombinator.com/item?id=26227214
> If yes, are the libraries open-source?
They are! tree-sitter itself is open-source [1], as are all of the language parsers we've listed on the homepage [2]. The syntax highlighting support is documented here [3].
[1] https://github.com/tree-sitter/tree-sitter
[2] https://tree-sitter.github.io/tree-sitter/#available-parsers
[3] https://tree-sitter.github.io/tree-sitter/syntax-highlightin...
Re: Tree-sitter: an incremental parsing system for programming tools
#126I tried to use this to ease the front end work load of students in a compiler project (building a C compiler) for a University course, so that the project could be focused on the more interesting middle and back end parts of the compiler. However, reported bugs in the C grammar that saw no activity at all [1] made this impossible. From this small sample of experiences, I was left with the impression that Tree Sitter…
Re: Tree-sitter: an incremental parsing system for programming tools
#127While we're in this discussion: Say I want to implement "SQL" for my app (if you've used Jira, I want to make my own JQL). Is this the tool for that? I'm looking for something much simpler than ANTLR.
Re: Tree-sitter: an incremental parsing system for programming tools
#128Wrote tree-sitter-svelte. Was a good experience. I am also writing a programming language of my own similar to TypeScript and I am using tree-sitter for the same. Its a delight to work with it. Removes a lot of the worries.
Re: Tree-sitter: an incremental parsing system for programming tools
#129Earlier quoted context omitted.
The idea is pretty awesome, but my eyes nearly rolled out of my head from the needless condescension at the beginning.
it's just how old people talk. Rob Pike speaks of syntax colouring in the same way - he quotes the Bible. I don't see it as condescension though. I think it's just a way of speaking.
Re: Tree-sitter: an incremental parsing system for programming tools
#130Earlier quoted context omitted.
This looks awesome! Do you mind elaborating on any kinks which you found?
A few: - indentation may be fine for a final doc, but not always while editing. Especially for new lines starting new code-blocks. - adding new syntax not already known by tree-sitter requires up streaming to at least 2 repos before we can use it in a released version of our package. This can feel less hands on and slow than working in a single repo where you have full control. No super-biggies yet though.