micro-editor / micro-editor/micro
Tree-sitter support via WASM
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 29.6k
- Forks
- 1.4k
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 10
Description
I know that there was another ticket about tree-sitter support -- but it looks like it got closed, probably because of cgo.
The good news is that with wasm and wazero, tree-sitter can be done entirely without cgo.
Basically, tree-sitter modules (not all, but most) can compile to wasm. Then you take that wasm file, and can use wazero to either compile it to native code (arm64 or amd64), or you can use it in interpreter mode to run it (will obviously be slower).
This may offer a nice cgo-free path. Note that the wasm stuff is used by zed.dev for their isolation of the tree-sitter into a separate space, preventing a bad tree-sitter grammar from taking down the process.
I am not a user of micro, although you're using my Tcell package, and I'm also the author of a couple of tree-sitter grammars (notably the D one) and I'm keen to help the ecosystem for D -- and thought this might help. Feel free to close if utterly non-interesting.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing micro's existing tree-sitter integration and the earlier closed tree-sitter ticket. Investigate whether tree-sitter modules can be loaded through wazero without cgo, including compiled and interpreter modes. Done would require an agreed implementation scope and a working cgo-free path for the supported grammars.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, wasm
- Domain
- cli, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100