Live data from Hacker News

Tbsp – treesitter-based source processing language

git.peppe.rs

31–40 of 47 posts

Re: Tbsp – treesitter-based source processing language

#31

This is great, and a step in the right direction. I wish tree-sitter had an official higher level API that allowed processing and pattern matching for use cases other than those required for text editors. I’m currently using tree-sitter at work to build AST-based tools, as performance is amazing, even with huge codebases, but I’m finding it slightly frustrating to have to manually write recursive descent processors k…

You may already be aware of it, but in case not - it sounds like tree-sitter-graph could be something you'd be interested in: https://docs.rs/tree-sitter-graph/latest/tree_sitter_graph/r...

I haven't gotten into it yet but it looks pretty neat, and it's an official tool.

Re: Tbsp – treesitter-based source processing language

#34
post #22

Not a technical comment (as cool as this is), but I love the name. We always say naming things is one of the hard parts of programming. They avoided the default option of something like tawk.

trawk (tree awk) was one of the initial names for this (not author, but know him personally)

Re: Tbsp – treesitter-based source processing language

#35
post #12
post #3

Maybe update the link to https://git.peppe.rs/languages/tbsp/tree/readme.txt ?

Is it formerly peppe.rs ? Here is the new account and doc for tbsp below. https://oppi.li/posts/introducing_tablespoon/

The git is still hosted at peppe.rs.

Re: Tbsp – treesitter-based source processing language

#36
post #22

Not a technical comment (as cool as this is), but I love the name. We always say naming things is one of the hard parts of programming. They avoided the default option of something like tawk.

Though, being the abbreviation for tablespoon, make searching for this a fair bit harder. As long as code files using this language don't get called recipes...

Re: Tbsp – treesitter-based source processing language

#37
post #21

For those that want to explore the grammars listed at https://github.com/tree-sitter/tree-sitter/wiki/List-of-pars... in a more friendly railroad diagram format I made https://mingodad.github.io/plgh/json2ebnf.html that reads the "src/grammar.json" and try it's best to generate an EBNF understood by (IPV6) https://www.bottlecaps.de/rr/ui or (IPV4) https://rr.red-dove.com/ui where we get a nice navigable railroad diag…

Hi, in case you're not already aware of the name clash, there's already a `rr` in the programming world. It's "record and replay": https://rr-project.org/ . Very different, but a very fine tool tool too.

It doesn’t seem like the rr that GP linked to is their own project, just something they’ve found useful.

In any case, in the non-software world, “RR” stands for railroad, as it does in the name of that tool. You can’t own a common two-letter abbreviation.

Re: Tbsp – treesitter-based source processing language

#39
post #24

Earlier quoted context omitted.

Impressive! The grammar.json file is just a little bit too underspecced to automate some things. Not to mention it's self-referential. How did you deal with extras and other 'specialisms' that are secretly hidden away in the C-level scanner and so on? I ask because I wrote Combobulate [1], a structured editing and movement tool for Emacs using TS. 1: https://github.com/mickeynp/combobulate

Also there was several requests to create a more formal grammar to describe the grammars but the tree-sitter developers doesn't like the idea and reject then. But some people did nice attempts like https://github.com/eatkins/tree-sitter-ebnf-generator that I also adapted and exposed it here https://mingodad.github.io/lua-wasm-playground/ to allow play with it online (select "Tree-sitter-ebnf-generator" from examples…

I've added more non trivial grammars Javascript, Java, Kotlin, PHP, C, CPP, Rust, Ruby, CSS, HTML, Python using a quickjs script to convert "src/grammar.json" to an EBNF understood by https://mingodad.github.io/lua-wasm-playground/ (the script is here https://github.com/mingodad/plgh/blob/main/json2ebnf-lua.js).

Re: Tbsp – treesitter-based source processing language

#40

This is great, and a step in the right direction. I wish tree-sitter had an official higher level API that allowed processing and pattern matching for use cases other than those required for text editors. I’m currently using tree-sitter at work to build AST-based tools, as performance is amazing, even with huge codebases, but I’m finding it slightly frustrating to have to manually write recursive descent processors k…

You may already be aware of it, but in case not - it sounds like tree-sitter-graph could be something you'd be interested in: https://docs.rs/tree-sitter-graph/latest/tree_sitter_graph/r... I haven't gotten into it yet but it looks pretty neat, and it's an official tool.

[dead]
Post reply on HN