tree-sitter explained

แชร์
ฝัง
  • เผยแพร่เมื่อ 22 ธ.ค. 2024

ความคิดเห็น • 217

  • @esclavodeluna8000
    @esclavodeluna8000 9 หลายเดือนก่อน +137

    Why does tree sitter sound like an insult

    • @Fafr
      @Fafr 6 หลายเดือนก่อน

      Treeshitter

    • @unsigned_var
      @unsigned_var 3 หลายเดือนก่อน

      Don't be such a tree sitter, man

    • @l30n.marin3r0
      @l30n.marin3r0 2 หลายเดือนก่อน

      It does sound like an insult xD

    • @orcusbrawlstars2716
      @orcusbrawlstars2716 2 หลายเดือนก่อน +1

      cuz of bush camper?😂

  • @radvilardian740
    @radvilardian740 9 หลายเดือนก่อน +153

    I stop before continuing watching. Thank God for having you. I want to know more about this treesitter. I hope we have series for treesitter.

    • @teej_dv
      @teej_dv  9 หลายเดือนก่อน +37

      hoping to do longer video later, will take some time to put together

    • @hazmat86
      @hazmat86 9 หลายเดือนก่อน

      ​@@teej_dv if only you would do a long length video about tree sitter, feels like you did though, like recently, ehhhh......guess not, must be losing it....BLAZINGLY CRAZY!

    • @peteruelimaa4973
      @peteruelimaa4973 หลายเดือนก่อน +1

      I mean you could read the docs. You'll know more than you ever could from watching videos. Reading documentation has become a superpower.

  • @caschque7242
    @caschque7242 9 หลายเดือนก่อน +61

    Your videos are impressive. I think the value comes from explaining one topic so one understands, how it works on an intuitive level while keeping the video short.

  • @silentobserver9095
    @silentobserver9095 9 หลายเดือนก่อน +26

    I never comment on any TH-cam videos.... but damn, this video was really great. Not only did you talk about an interesting topic but also explained it extremely well.
    Please keep on releasing more of these videos. We need content creators like you.

  • @Richetechguy
    @Richetechguy 9 หลายเดือนก่อน +25

    Great stuff, keep it up your kickstart vid has helped me out a lot on getting back into Neovim fully.

    • @teej_dv
      @teej_dv  9 หลายเดือนก่อน +3

      Thanks!! glad to hear it :)

  • @TankorSmash
    @TankorSmash 9 หลายเดือนก่อน +10

    Haskell slander aside, this was amazing! I can't believe how much of ts you explained, along with giving clear usecases and examples right into vim. Thanks for putting this out!

  • @martinocrespoalvarez4663
    @martinocrespoalvarez4663 7 หลายเดือนก่อน +2

    I'm really jealous about the way this guy expresses ideas and concepts. Huge, huge fan!

  • @jR-tm3ko
    @jR-tm3ko 9 หลายเดือนก่อน +7

    The quality of each video you put out just gets better and better. Thank you!

  • @mattwilly7959
    @mattwilly7959 9 หลายเดือนก่อน +2

    This makes a lot more sense now. Really like how you break things down in a simple way. It makes it a lot easier to understand concepts.

  • @jasonschannel
    @jasonschannel 9 หลายเดือนก่อน +4

    Followed after the LSP video, and now I get this! The top quality explainers just keep coming! Thanks TJ!

  • @LokeshKrishna1995
    @LokeshKrishna1995 9 หลายเดือนก่อน +2

    Bless you for your fantastic explainers and all your work on Neovim. Huge fan!

  • @Tntpker
    @Tntpker 9 หลายเดือนก่อน +7

    I actually used tree-sitter in a project a while ago making a LS for a DSL. It worked pretty well and had auto-complete, hover, signature help, and syntax error highlights. However, tree-sitter's error recovery ability still remains a problem to make it a viable tool for creating LSs.

  • @meatcow417
    @meatcow417 8 หลายเดือนก่อน +1

    Pulled me in with the trees in the thumbnail, stayed for the solid explanations. Thanks man!

  • @Jscodin
    @Jscodin 9 หลายเดือนก่อน +2

    You really have a great way of explaining things in a way that anyone can understand, even beginners like myself - this was very interesting and informative, looking forward to the next explainer

  • @vojtastruhar8950
    @vojtastruhar8950 9 หลายเดือนก่อน +4

    What blows my mind is that it downloads some C files, COMPILES THEM and then runs them nice and fast and natively. Great stuff

  • @slim_mike
    @slim_mike 5 หลายเดือนก่อน +1

    blown away in peices after seeing this video, I'm still recovering. This is very impresive, I want to learn scheme now

  • @intimidate123
    @intimidate123 8 หลายเดือนก่อน +1

    Great video TJ! really enjoy how you break everything down, makes it easy to understand and learn

  • @xcuu
    @xcuu 9 หลายเดือนก่อน +1

    These videos are really great TJ, please keep them coming!

  • @ParanoidxProd
    @ParanoidxProd 9 หลายเดือนก่อน +19

    I would love a more in depth video on writing grammar, and more specific scanner. Been diving into writing grammars lately and so appreciate the content!

    • @teej_dv
      @teej_dv  9 หลายเดือนก่อน +9

      ya, might do longer video of this later -- will have to be way longer haha

  • @wadechang
    @wadechang 6 หลายเดือนก่อน

    First time in my life I feel like I understand what treesitter is. Hats off!

  • @johnathonme
    @johnathonme 6 หลายเดือนก่อน

    Great video, thanks!!! Just the right amount of depth and standing while presenting was extra engaging!

  • @MalakaiPrograms
    @MalakaiPrograms 9 หลายเดือนก่อน

    Love this video. Recently had to edit the grammar for a semi-obscure language as it was missing features and loved how simple it was. I mean it still took me 4 hours because I didn't know anything about tree-sitter but I wish I saw this video before then, it would have been so much help! Keep it up!

  • @PrestonThorpe-d1x
    @PrestonThorpe-d1x 9 หลายเดือนก่อน +1

    TJ you're my new favorite youtuber/content creator. I really hope the full time thing works out for you, good luck. Definitely need more videos like these. Also now I hope you are able finish the interpreter in OCaml series one day :D

  • @funkdefied1
    @funkdefied1 9 หลายเดือนก่อน

    Man this is dope. I never thought to try to understand LSPs and the parsers powering them. It was all just magic.

  • @codetothemoon
    @codetothemoon 9 หลายเดือนก่อน +1

    Incredible. Cleared up a ton of confusion for me. Thank you!

  • @roberto8016
    @roberto8016 9 หลายเดือนก่อน +6

    I didn't know tree-sitter uses JDSL, Tom is indeed a genius

  • @megaxlrful
    @megaxlrful 9 หลายเดือนก่อน

    This is a great explainer on Treesitter. I used Atom in the past, switched to Vim then Neovim. I knew what treesitter did inside neovim, and heard that it is the best one at its job but never really understood what is soo good about it.

  • @rddavies
    @rddavies 9 หลายเดือนก่อน

    You're a truly gifted teacher among your many other talents.

  • @rom1detroyes143
    @rom1detroyes143 9 หลายเดือนก่อน

    I still don't really know what I can do with tree-sitter, but now I know what and how it does this thing in Neovim : great knowledge sharing, thanx :-)

  • @sandeepvk
    @sandeepvk 9 หลายเดือนก่อน

    Have never understood the REAL difference between LLM, LSP and treesitter. This video was very useful

  • @gmchris4113
    @gmchris4113 9 หลายเดือนก่อน

    This was dense. I'll be honest, a lot of it went right over my head as I'm starting to learn now, but I hope to return in time and realize it all makes sense 😅.
    Great content, I love the educational stuff. Keep it up.

  • @yakomisar
    @yakomisar 9 หลายเดือนก่อน

    TJ your presentations skill is a masterpiece

  • @sarojregmi200
    @sarojregmi200 9 หลายเดือนก่อน

    Future Nile will admire you more than anyone.
    Great video.
    Ignore the spelling mistakes if any.

  • @marianouvalle895
    @marianouvalle895 9 หลายเดือนก่อน +1

    Amazing stuff Teej, keep it up!

    • @teej_dv
      @teej_dv  9 หลายเดือนก่อน

      Thanks :) :)

  • @amirhoseinfarhadi2268
    @amirhoseinfarhadi2268 9 หลายเดือนก่อน

    I really love this new wave of content from you champ 👍🏻

  • @droydi
    @droydi 9 หลายเดือนก่อน

    Godlike TJ, well done once again with the explanations, more of this!

  • @WinterSchwartz-q2j
    @WinterSchwartz-q2j 9 หลายเดือนก่อน

    I hate the rest of the internet. Nobody else seemed to care about explaining what everything i was installing was doing and just that i should install it. This really, really sucks while ur trying to configure neovim on your own for the first time. Please keep it up < 3

  • @rastko614
    @rastko614 9 หลายเดือนก่อน

    Really cool video. Thank you for showing us behind the curtain!

  • @JosephMcMurray1984
    @JosephMcMurray1984 9 หลายเดือนก่อน

    You know this video is going to be good when Teej brings out the blazer.

  • @Jojor11
    @Jojor11 9 หลายเดือนก่อน

    I had the ideas but this really helped me connect them together… treesitter really is extremely powerful and I’m already getting ideas of cool things I could use it for if I learn it a bit

    • @teej_dv
      @teej_dv  9 หลายเดือนก่อน +1

      So great to hear!! thanks for the nice words :)

  • @RustFlow223
    @RustFlow223 7 หลายเดือนก่อน

    Man your explanation sound great! Keep going!

  • @TroubleChute
    @TroubleChute 9 หลายเดือนก่อน +1

    What would we do without trees*itter

    • @teej_dv
      @teej_dv  9 หลายเดือนก่อน +1

      we would not be sitting on the trees

  • @PotatoGameDev
    @PotatoGameDev 9 หลายเดือนก่อน

    You are a good human, TJ.

  • @jong.4864
    @jong.4864 9 หลายเดือนก่อน +2

    This guy is a machine!! Def much better than that netflix-btw-guy

    • @jimshtepa5423
      @jimshtepa5423 9 หลายเดือนก่อน

      who ends his streams thinking we know his name))

  • @accumulator4825
    @accumulator4825 4 หลายเดือนก่อน

    Really good explanation, thank you for the knowledge!!!

  • @huge_letters
    @huge_letters 9 หลายเดือนก่อน

    Oh, I have a new question - if tree sitter has no clue about context, it just parses text to ast.
    How does syntax highlighting working through tree sitter know when my identifier is a function or value?
    What I mean is when in TS I define a
    ```
    const num = 5;
    function func(){}
    console.log(a, func) ;
    ```
    It would highlight num blue and func yellow - how does it even know here that func is a function? From my understanding it would only know it's just some sort of identifier

  • @MrSpyTubes
    @MrSpyTubes 9 หลายเดือนก่อน +1

    Great job man! Keep up the good work!

    • @teej_dv
      @teej_dv  9 หลายเดือนก่อน

      Thanks :)

  • @ivandenysenko
    @ivandenysenko 5 หลายเดือนก่อน

    Thank you for such an awesome explanation!

  • @joaomsa
    @joaomsa 9 หลายเดือนก่อน

    Great video, lots of cool tools built around the ecosystem like ast-grep

  • @darkenblade986
    @darkenblade986 9 หลายเดือนก่อน

    i am loving these videos. really great info!

  • @NStripleseven
    @NStripleseven 9 หลายเดือนก่อน

    The bit that I was really interested in is how the tree sitter determines what the “least number of errors” is for a given invalid program. Looks like it was never covered but I’m still curious.

  • @maxnrm
    @maxnrm 3 หลายเดือนก่อน

    I'm on the journey of configuring neovim from scratch, this is second video I watched, first one was about Abstract Syntax Tree. I think I would be able to set up neovim in under 100 hours. Probably a 5-8 videos more and after that practice for 80 hours. Then finally I would be able to use neovim how I like.

  • @sparkhum
    @sparkhum 9 หลายเดือนก่อน

    This was awesome. Thanks for the explanations!

  • @nemethda
    @nemethda 9 หลายเดือนก่อน

    To the point, simply brilliant

  • @faraonch
    @faraonch 8 หลายเดือนก่อน

    Very well explained. Although, as a Mac power user it's still hard to overcome all the entry barriers. It's too easy to forget all the needed fundamentals that are needed to switch to neo vim. (as an active freelancer working on projects)

  • @voldllc9621
    @voldllc9621 6 หลายเดือนก่อน +2

    Tresitter is clearly a tokenizer and lexical analyzer, on top of you have some productions that are general enough to build branches in the syntax tree such as braces aaround a list without committing to specific languages. Am I on the right track track here?

  • @SalvaToroTorus
    @SalvaToroTorus 9 หลายเดือนก่อน

    Nice stuff. You explain things really well.

  • @THIRSTYGNOME
    @THIRSTYGNOME 9 หลายเดือนก่อน

    What are the security implications of auto install of the different language parsers?

  • @ka9dgx
    @ka9dgx 2 หลายเดือนก่อน

    Well, that certainly was an excellent explanation of something I didn't know I needed to know. Thanks!
    Maybe now I'll find out what an LSP is... ;-)

  • @hechuan5075
    @hechuan5075 9 หลายเดือนก่อน +1

    any chance you could do an indepth LSP video, i watched the dedicated one but would like to learn more about the capabilities and handlers

    • @teej_dv
      @teej_dv  9 หลายเดือนก่อน +2

      yes, i'm planning an entire video of writing a complete lsp from scratch

    • @hechuan5075
      @hechuan5075 9 หลายเดือนก่อน

      @@teej_dvthank you than you

  • @matthewrossee
    @matthewrossee 9 หลายเดือนก่อน

    Some lsp clients implement syntax highlighting themselves, right? How does neovim decide on using treesitter or lsp highlighting? I would assume that treesitter takes precedence, since it's faster, but if lsp and treesitter are unrelated, then how does it work?

  • @je12emy
    @je12emy 9 หลายเดือนก่อน

    Great video, thank you, TJ!

  • @havocthehobbit
    @havocthehobbit 9 หลายเดือนก่อน

    Great explanation .I had no idea I was building something that already existed , Iv been writing a language query system in rust ... I just have no interest in having to go back to C or train someone else in C to be able to use tree sitter building new language libraries for tree sitter to use .
    I'd love to know the learning curve with tree sitter when building a language parser for a new language that hasnt been done or shared with it .

    • @teej_dv
      @teej_dv  9 หลายเดือนก่อน +1

      You don't write c when you use tree sitter. You write the grammar in js and you usually have language bindings already in other langs.

    • @havocthehobbit
      @havocthehobbit 9 หลายเดือนก่อน

      @@teej_dvOK that sounds interesting , so basically tell it the syntax and structure or and using javascript to create a grammar , then I could use rust bindings if I wanted to read or compile that grammar into something consumable.
      I was under the impression I had to use C to write and compile that grammer into a library that uses C lib exports for bindings, so that I could then consume it with a Language like Rust or whatever Lang to be able to query what it parses...
      So it sounds like a 2 stage approach versus the 3 phase approach I was thinking . Which means I dont need to use C at all.

  • @michaeletzkorn
    @michaeletzkorn 9 หลายเดือนก่อน

    I could be wrong because some of the information went over my head, but it sounds like treesitter is a file syntax parser and NOT a babysitter for trees.

  • @rasmusravnandersen5788
    @rasmusravnandersen5788 9 หลายเดือนก่อน

    Omg, what a great explanation!

  • @nightshade427
    @nightshade427 9 หลายเดือนก่อน

    Great video and explanation as always

  • @M0K0K0
    @M0K0K0 9 หลายเดือนก่อน

    Bro it's late and I was like "tree sitter ? Wtf would you like someone to watch over a tree for you ?" and I feel very stupid now

  • @iliadmitriev01
    @iliadmitriev01 9 หลายเดือนก่อน

    how did you got TS query window open? I found the way to open right tree window with :InspectTree command

    • @jeffbeyer462
      @jeffbeyer462 8 หลายเดือนก่อน

      was wondering this too. it's :EditQuery but looks like it's a 0.10 feature

  • @huge_letters
    @huge_letters 9 หลายเดือนก่อน

    "LSP and Treesitter are unrelated" - but do LSPs use treesitter for text parsing for example? Like LS-server receives an event with file changes, it runs them through tree-sitter to get a parsed result and then based on AST it can generate a response to the client?

    • @teej_dv
      @teej_dv  9 หลายเดือนก่อน +3

      not generally no. they usually use hand-rolled custom parsers that are optimized for their language

  • @Luna-lp9op
    @Luna-lp9op 9 หลายเดือนก่อน

    "isn't that outdated and illegal now" not proud to understand that joke because i'm chronically online

  • @andrewrush7667
    @andrewrush7667 9 หลายเดือนก่อน

    Sharp sports coat, very professional!

  • @thiagolopes4978
    @thiagolopes4978 9 หลายเดือนก่อน

    hello TJ, may I ask you something?
    While using VS Code, the Vim extension makes possible for me to use Visual Block mode, and then when I enter "I" to insert text, then backspace , the text follows for each line selected, and it is pretty good to use with SQL queries for example. When I try to do this with Vim or Neovim, I just can't, and I don't think it is the 'whichwrap' option, do you know what it is? Thank you.

    • @heian17
      @heian17 2 หลายเดือนก่อน

      You can, by typing `dd`

  • @mjhika
    @mjhika 9 หลายเดือนก่อน +1

    LISP MENTIONED LISP MENTIONED LISP MENTIONED LISP MENTIONED LISP MENTIONED

  • @ElvenSpellmaker
    @ElvenSpellmaker 9 หลายเดือนก่อน

    Vscode seem to be discussing potentially moving to treesitter from textmate grammars, it'll be a loooong time though.

  • @trailangnd96
    @trailangnd96 17 วันที่ผ่านมา

    can you make video about c# + tree sitter? please

  • @hendrykhoza4782
    @hendrykhoza4782 9 หลายเดือนก่อน

    How to build a parser, I need parser for Razor pages

  • @JordanShurmer
    @JordanShurmer 9 หลายเดือนก่อน

    you should try a different material sports coat. Tweed or Linen perhaps

  • @TeamDman
    @TeamDman 9 หลายเดือนก่อน

    Eloquently explained!

  • @zaneearldufour
    @zaneearldufour 9 หลายเดือนก่อน

    Um ackshually: treesitter and LSP overlap w.r.t. semantic highlighting

  • @DanielPaunescu
    @DanielPaunescu 3 หลายเดือนก่อน

    You said tree-sitter is not an LSP, but could you use tree-sitter to implement an LSP sort of thing on top of it?

  • @hendrykhoza4782
    @hendrykhoza4782 9 หลายเดือนก่อน +1

    Guys what is he using for presentation ?

  • @StephenRayner
    @StephenRayner 4 หลายเดือนก่อน

    Where is the video on LSPs?

  • @viniciusataidedealbuquerqu2837
    @viniciusataidedealbuquerqu2837 4 หลายเดือนก่อน

    this looks like a logical expression query language 10:48

  • @CROXoDyLE
    @CROXoDyLE 7 หลายเดือนก่อน

    Is this like a baby sitter but for trees

  • @mike_yon
    @mike_yon 9 หลายเดือนก่อน

    Great video except I do infact delete the file everytime I want to change something. I run echo >> file.ml (ocaml BTW) every time I need to edit something.
    It's a more functional way to program. Having random, nonrecursive access to a character in a file, like having access to an element in an array introduces state into the writing of my program

  • @hamzarashid7579
    @hamzarashid7579 9 หลายเดือนก่อน

    You forgot to say:
    Hopefully this video was suitable.

  • @StephenRayner
    @StephenRayner 4 หลายเดือนก่อน

    Subbed, this was very good thank you.

  • @kublaios
    @kublaios 5 หลายเดือนก่อน

    I trust this man because he's wearing a PhD jacket

  • @davidsicilia5316
    @davidsicilia5316 9 หลายเดือนก่อน

    Thanks for this, very helpful video

  • @AK-vx4dy
    @AK-vx4dy 29 วันที่ผ่านมา

    Emacs is decades old...how it uses tree-sitter?

  • @gobdovan
    @gobdovan 9 หลายเดือนก่อน +1

    I thought this video is about how to do a job where you clean and water the trees when the tree owner isn't home.

  • @ethernet764
    @ethernet764 9 หลายเดือนก่อน

    3:38 oof. I didn't come here to be roasted 😭

  • @Linuxdirk
    @Linuxdirk 9 หลายเดือนก่อน

    I wish it was easier to create own custom parsers and stuff, so it’s as easy to add tree-sitter syntax highlights than it was with old Vimscript.

  • @homfes
    @homfes 9 หลายเดือนก่อน

    I think I understood it. So treesitter is an interpreter that serves language protocols?

  • @liamwoodleigh
    @liamwoodleigh 9 หลายเดือนก่อน

    Great video Teej!

  • @alexandrostsagkaropoulos
    @alexandrostsagkaropoulos 9 หลายเดือนก่อน

    That is as close to art as it can be

  • @iliya-malecki
    @iliya-malecki 9 หลายเดือนก่อน

    couldnt it be sql or a subset of it? everybody knows sql but what the hell is that query syntax

  • @hroi
    @hroi 9 หลายเดือนก่อน

    How do you open the query editor?

  • @illegitimate-egg
    @illegitimate-egg 9 หลายเดือนก่อน +3

    How do you do a slideshow in nvim?

    • @MaartenHogeveen
      @MaartenHogeveen 9 หลายเดือนก่อน +1

      It’s a CLI tool called lookatme

    • @teej_dv
      @teej_dv  9 หลายเดือนก่อน +1

      correct! it's in the description

  • @JoshuaLonsako
    @JoshuaLonsako 9 หลายเดือนก่อน

    Dude you're on a roll