3 ms·
Question: why use TextMate instead of tree-sitter? Tree-sitter's drawbacks compared to TextMate and other regex-based solutions are slower speeds and chance of
by armchairhacker 4y ago
Question: why use TextMate instead of tree-sitter?
Tree-sitter's drawbacks compared to TextMate and other regex-based solutions are slower speeds and chance of edits breaking parse trees, which are not issues here. Its advantages are that the grammar definition can be more expressive and is much more readable.
Not saying you should abandon using TextMate, "if it ain't broke..." and I doubt all of the grammars you support right now have as pretty tree-sitter equivalents. But maybe add support for tree-sitter as well, especially because it seems to be growing in popularity, with growing support in emacs and neovim.
- eyelidlessness 4y agoThe advantage is reusing existing themes. TextMate themes as a standard are the de facto not-great-but-used-everywhere thing and in this case it means you can style your blog or whatever with what you use in VSCode or Sublime or whatever.
- doodpants 4y agoIronically, the last time I checked (which was some number of years ago), TextMate 2.0 did not support the TextMate 1.x theme format, not even via any sort of import or conversion mechanism. Which is odd, considering that it's become a de facto standard supported by other editors. TextMate 1.x was the king of Mac text editors back in its day. Is anyone actually still using TextMate today?
- eyelidlessness 4y agoI’m amazed I can’t remember whether I converted my custom TextMate theme when I started using 2.0! I also wish I’d realized the vivid colors in the theme (I called it “acid skittles”) were appealing to me for contrast, not their range of color spectrum. I don’t use TextMate anymore but I surely would have stuck with it longer if it had a debugger and language server. I panned all of the non-native editors that came between, but sadly had to admit that VSCode fit my workflow a lot better.
- Keats 4y agoTree-sitter is going to be a lot slower to load: https://github.com/tree-sitter/tree-sitter/issues/1942 https://github.com/tree-sitter/tree-sitter/issues/1942. It's ok for things like editor but using it in a SSG for example is hard when just loading the syntaxes will take multiple times the time it takes to render the whole thing with a regex based highlighter.
- artagnon 4y agoIs tree-sitter really slower than TextMate grammars? Some benchmarks indicate that this isn't really the case [1]. On the other hand, breaking parse trees is a real issue, because the error-recovery in tree-sitter is pretty rudimentary [2][3], but as you said, it's not an issue for Shiki. Several TextMate grammars suffer from inaccuracy bugs, and issues of maintainability. Perhaps the biggest hindrance in the adoption of tree-sitter, is that the most popular editor, VSCode, still doesn't support it. [1]: https://github.com/microsoft/vscode/pull/161479 https://github.com/microsoft/vscode/pull/161479 [2]: https://github.com/tree-sitter/tree-sitter/issues/1870 https://github.com/tree-sitter/tree-sitter/issues/1870 [3]: https://github.com/tree-sitter/tree-sitter/issues/224 https://github.com/tree-sitter/tree-sitter/issues/224
- z3t4 4y agoWould use treesitter if it had more documentation and examples. For example how to find all function declarations, all variable declarations, etc