"Tree-sitter - a new parsing system for programming tools" by Max Brunsfeld

Поделиться
HTML-код
  • Опубликовано: 20 окт 2024

Комментарии • 36

  • @atrevino1989
    @atrevino1989 Год назад +8

    4 years old and still relevant, super nice !

  • @gloverelaxis
    @gloverelaxis 2 года назад +36

    This is a really, really, cool idea and approach. This is going to be **phenomenally** useful and will improve how *all* code across the world is authored by everyone. I really hope this can be integrated into every editor and web-based code display. Thank you so much for this essential labour you've expended on this. I'm actually shocked at how badly most "code editors" (actually glorified text editors) understand the code they're editing. This addresses a lot of the problems of treating code as text instead of ordered trees (which is what programs really are on a conceptual *and* literal/mechanical level). I hope one day we can move into a much more productive world where most code authors can use good tree-based tools and stop wasting their time dealing with confusing parentheses, forgetting semicolons, and naming things without using spaces.
    "Expand selection" was my favourite feature of Sublime that I've missed since migrating to VSCode. I love that you remember which child nodes you "expanded selection" from, so you can contract them back again without mistakenly choosing (eg) the first child! Also, that idea of using "expand selection" with multiple nodes is SO powerful and useful.
    Just blown away by this, bravo and thank you again!

    • @danielorodriguez1689
      @danielorodriguez1689 2 года назад +5

      It is not “it will” it already does. It is an important tool in my workflow already

  • @noclaf78
    @noclaf78 6 лет назад +55

    What a fantastic presentation. A very useful project and a great explanation of how it works!

  • @douglasmennella4525
    @douglasmennella4525 2 года назад +2

    Just want to add another comment about how great a presentation this was.

  • @PatrickKellyLoneCoder
    @PatrickKellyLoneCoder 5 лет назад +15

    We've been working on a remarkably similar concept. Hot damn. Actually glad I'm not the only one.

  • @martink6092
    @martink6092 26 дней назад

    The "GLR" approach is a good generalisation of what we've been doing since the 1970's: simply treating most things as expressions, and only later hoisting out a contained L-value reference if it's required by context. So "L-value expected" becomes a semantic error rather than a syntax error.

  • @melodyogonna
    @melodyogonna 7 месяцев назад +1

    Now Treesitter has given Neovim superpowers by allowing it understand ASTs

  • @astrosticks
    @astrosticks Год назад +18

    tree-sitter is now part of GNU Emacs:)

    • @mndtr0
      @mndtr0 Год назад +5

      This is strange that a cool stuff like tree-sitter is used only in two major and popular code esitors. I'm mean only NeoVim and Emacs use it(if we talk about popular solutions) and other editors like VSCode, SublimeText4 etc. use regex-based syntax hightlighting 🤢

  • @SimonLeinen
    @SimonLeinen 4 года назад +12

    Awesome job-both the tree-sitter work and the presentation. Thank you! Just stumbled across this via a pointer on the emacs-devel list (in case anyone wonders :-). The one small thing I have an issue with was the critique of existing code-highlighting practices in the "motivation" part of the talk. In some cases I personally liked the "old-style" highlighting better than the treesitter-generated ones; in particular, I have a preference for NAMES OF NEWLY DEFINED THINGS to be highlighted, and that was what the "old" style did in the examples. In fact I think that EVEN OLDER algorithms did it the way Max prefers, i.e. type names one color, variable names second color, etc.
    Anyway, that's a detail. This is REALLY COOL work with lots of potential. Also kudos for respecting the elderly (-: as shown here, old methods such as (G)LR parsing may still have untapped potential. Now excuse me while I get a case of fresh punch cards from the basement and try to write a tree-sitter grammar for LISP

    • @BethKjos
      @BethKjos Год назад +1

      Grammar for LISP? I see what you did there...

  • @dl3307
    @dl3307 3 месяца назад +1

    This guy is now co-founder behind the new fast code editor Zed. Go figure!

  • @tompov227
    @tompov227 4 года назад +9

    You know vscode right now is so popular but I still love and use Atom as my primary editor. I hope now that Microsoft owns Github and Atom they dont get rid of it in favor of vscode. Also, I didn't know about this but the syntax highlighting always did look better to me in Atom but I just assumed the themes were made better, I didn't realize all this tech was going on under the hood

    • @chasecaleb
      @chasecaleb 2 года назад +15

      Two years later and the day has come. What are you using now?

  • @satishgoda
    @satishgoda 4 года назад +4

    Absolutely amazing presentation (and software)

  • @최강재-y9c
    @최강재-y9c Год назад

    So informative and the idea is just mind-blowing! Thanks for your well organized presentations.

  • @BethKjos
    @BethKjos Год назад +2

    Slick! Leveraging GLR for error recovery is a great idea. Question, though: How would you handle a confused lexer? Consider the insertion of a quote mark near the beginning of a file...

  • @MrRobWalter
    @MrRobWalter 4 года назад +5

    This is basically getting default features of structural (aka projectional) editing into textual editing. Interesting.

  • @_ashout
    @_ashout 4 года назад +2

    Wow, this is crazy cool. Might have to give Atom a try after seeing this

  • @kaerafeliceoira-turner4164
    @kaerafeliceoira-turner4164 6 лет назад +2

    Looks interesting. Reminds me of Roslyn for C# in Visual Studio.

  • @s1n7ax
    @s1n7ax 3 года назад +16

    Treesitter ships with neovim now

  • @pankaj_jangid
    @pankaj_jangid 4 года назад

    Fantastic work!

  • @mgetommy
    @mgetommy 4 года назад +1

    FANTASTIC

  • @samr.7515
    @samr.7515 6 лет назад +2

    Fantastic

  • @rj00a
    @rj00a 4 года назад

    Awesome!!!

  • @tretretretre747
    @tretretretre747 4 года назад

    Thanks for your presentation. I am learning tree-sitter but i have a problem. I am parsing a source code from file, i need to know his function name not the node name. how can i do that. I read all the doc but i can't have the solution. thanks

  • @RasikaPereraGovinnage
    @RasikaPereraGovinnage 5 лет назад

    If you need to know what is Tree-sitter jump into ruclips.net/video/Jes3bD6P0To/видео.html

  • @gzoechi
    @gzoechi 4 года назад +2

    I'm not convinced.
    For auto-completion and error reporting, language servers already need to parse and analyze the code.
    I'd expect that to be much more efficient if information for syntax highlighting also comes from that same parser and analyzer.
    I'm not much into language server protocol but I got the impression that semantic highlighting is something that is already supported (even though not implemented for every language)
    LSP is also designed for incremental changes as far as I know.

    • @neikms
      @neikms 4 года назад +1

      Agree, the main problem with LSP is that it comminucates via RPC, which can be quite slow, especially for thing that needs to be highlighted every key strokes.
      Tree-sitter can be directly imbedded into editor as a quick, standard (not necessarily correct) syntax highlighter.

    • @Megalcristo2
      @Megalcristo2 3 года назад

      Also if there are errors on that line you are going to lose the syntax highlight or fallback to the basic one.

    • @jeetadityachatterjee6995
      @jeetadityachatterjee6995 2 года назад +3

      I mean as someone who is worked for both LSP is way too slow for this job. Syntax highlighting is something that should happen in the editor and quickly. Plus tree sitter is not making a value add like LSP does. People can and do whatever they want with the tree which is something that LSP (at the moment) does not provide

    • @CianMcsweeney
      @CianMcsweeney 8 месяцев назад

      LSP's are too slow, it was a stupid idea to have to run an entire server that uses JSON for a task that requires minimal latency. Should instead have been a standardized ABI interface that different compilers/interpreters implement, instantly cuts out the majority of the performance concerns and also removes a ton of complexity. Treesitter is a project that aims to patch over the mistake of LSP's since unfortunately it's too late to go back and replace them entirely