Grammars, parsing, and recursive descent

Поділитися
Вставка
  • Опубліковано 21 лис 2024

КОМЕНТАРІ • 76

  • @zweitekonto9654
    @zweitekonto9654 10 днів тому +50

    It's that moment where you're casually scrolling through youtube. You see a video recommended. It intrigues you, and after 1 min in, you realise you hit an absolute goldmine. Subscribed.

    • @sleepyelk5955
      @sleepyelk5955 7 днів тому

      same here lol ... thanks algorithm and thanks for the great video and channel 👍

    • @emmanuelaminu9721
      @emmanuelaminu9721 6 днів тому

      Same here 😅

    • @davit_nergadze
      @davit_nergadze 6 днів тому

      The power of the title and thumbnail!

    • @albizutoday2754
      @albizutoday2754 6 днів тому

      Just like Rust!

    • @VideosViraisVirais-dc7nx
      @VideosViraisVirais-dc7nx 2 дні тому

      Yeah, specially the haired man, which is very rare on UA-cam, once they tend to attract toxic people.

  • @hyperplano
    @hyperplano 10 днів тому +48

    You know it's going to be good when Kay starts with some historical artifact

  • @AyoDamilareMichael
    @AyoDamilareMichael 10 днів тому +33

    Every single upload is a masterpiece

  • @rafaelfreire3792
    @rafaelfreire3792 10 днів тому +7

    I'm taking a class on compilers this semester. You have no idea how great it is to click on UA-cam and see a video like this. Thanks

  • @corysandlin5032
    @corysandlin5032 10 днів тому +10

    Dude I just started writing a compiler to learn how they work. This video couldn't have come at a more perfect time! Great vid as always

    • @LinuxIsBetter43
      @LinuxIsBetter43 9 днів тому

      Then you also might want to read Writing C Compiler by Nora Sandler that came out very recently.

    • @zweitekonto9654
      @zweitekonto9654 2 дні тому

      @@LinuxIsBetter43 damn, I definitely wanna read this. Modern compiler book, with all the modern techniques.

  • @adhyansehgal4192
    @adhyansehgal4192 3 дні тому +2

    This guy has the blood of Newton of some great people

  • @LF-cm5wm
    @LF-cm5wm 5 днів тому +1

    This channel is exactly what I've been looking for. Thank you algorithm god 🙌🏻

  • @JarheadCrayonEater
    @JarheadCrayonEater 9 днів тому +3

    I developed a smart form system a few years ago for my past employer, where users could enter custom formulas in fields that were dependant on other fields and/or other objects within our system. Really typical of a lot of CRM's these days, but we needed to roll-our-own since it was specific to metrology.
    So, I took a deep-dive into this topic and ended up learning more about ANTLR and g4 syntax than I expected, and now I'm stuck in this rabbit hole forever.

  • @tejasbawa
    @tejasbawa 10 днів тому +4

    You're cooking so hard Kay, thanks for putting out this awesome content.

  • @SolathPrime
    @SolathPrime 10 днів тому +2

    You know ever since I found this channel and I find myself downloading videos to my archive and using them as a teaching materials
    I can't just say how thankful am I to you for this great work
    I wish I could do more to support but all I can do is point to your channel whenever I can

  • @IGNACIOSOLAR1
    @IGNACIOSOLAR1 4 дні тому

    amazing stuff, glad to see theory applied, wish my teachers on uni would show this side of the course

  • @vividoo
    @vividoo 11 годин тому

    I wish I watched this before my exam today where I was shifty on pushdown automata... great video!

  • @ebn7722
    @ebn7722 9 днів тому +2

    This has become one of my favorite channels

  • @arupsan
    @arupsan 2 дні тому

    I knew someday in your video this topics will come … great to hear from you …

  • @esra_erimez
    @esra_erimez 9 днів тому +3

    "Crafting Interpreters" by Nystrom is a good treatment on the subject for those that would like a deeper dive

  • @ocdkirby
    @ocdkirby 3 дні тому

    Amazing work! I think Knuth’s research really ought to be touched on more here though. The approach in the recursive descent section is combinatorial parsing (every language has a parser combinator library now, you can write a compiler in basically anything), but Knuth had the idea to do it with lookup tables that tell you when you’ve parsed enough characters for a based on the next character. The new rule for pushdown automata (precedence)? Another lookup table. It’s exponentially harder to scale than parser combinators so it doesn’t hold up today, but it’s an important part of the history!

    • @neoeno4242
      @neoeno4242  2 дні тому

      Thanks for sharing your thoughts on this! There was definitely a lot I didn't cover here and useful to hear which are highlights for you. Will keep this in mind.

  • @LaboriousCretin
    @LaboriousCretin 8 днів тому +1

    Nice video. Thank you for sharing. From language communication to social constructs. Religions imprinted from social structures. The check of types. Ask them but knowing they have a imprint structure and things that differ. Bias sets and bias blindness and linking to phrasing/word structure and lexicons/words used.

  • @marceloguzman646
    @marceloguzman646 3 дні тому

    I love these videos! My course focused on too much theory and running algorithms by hand like minization of DFA, nfa to dfa, etc., which was a nightmare.

  • @programmer1356
    @programmer1356 10 днів тому +4

    Bonkers how appropriate, for me, this is right now. Thank you

  • @anon_y_mousse
    @anon_y_mousse 9 днів тому

    I don't know what a modern equivalent would be, but if you want a super simple explanation of recursive descent to just get something working without understanding any of the theory, then Crenshaw's tutorial is the best I've ever found. If it didn't use Pascal and generate 68k assembly it would still be directly usable today, but hardly anyone uses Pascal anymore and fewer still need code generated for a 68k processor and if you're just starting out learning you won't understand how to translate these.
    If anyone knows of a good modern equivalent that either is written in C or generates C or both, that would probably be what I'd recommend. If not, then I'll have to add that to my project list because someone needs to write one.

  • @bt64u30
    @bt64u30 10 днів тому +2

    Love the vids. I am learning the Same topic in uni right now. Nice overhaul. Thank you very much. Continue the good work pretty please!😊

  • @vicdotso
    @vicdotso 10 днів тому +2

    thank you. this almost made me shed a tear

  • @ngideo
    @ngideo 6 днів тому

    i literally lol'd at the example of "the grammar of a laugh". well played.

  • @Gaafet
    @Gaafet 10 днів тому

    Your videos keep getting better and better!

  • @oliverwooding2066
    @oliverwooding2066 10 днів тому +2

    quick correction for 10:50 - context sensitive languages can be recognised by linear bounded automata, which are less powerful than turing machines. turing machine automata recognise the recursively enumerable languages, which are a superset of the context sensitive languages

  • @bzboii
    @bzboii 10 днів тому +2

    these videos are so great. happy i found the channel :)

  • @esra_erimez
    @esra_erimez 10 днів тому +2

    As Kay is extremely thorough, I shall refrain from commenting until the end since invariably whatever I have to add is eventually covered

  • @piolet3399
    @piolet3399 10 днів тому +4

    Loved the video, Jai Shree Ram!!

  • @Sub0x-x40
    @Sub0x-x40 9 днів тому

    holy smokes this channel has exploded. kinda knew it would tho

  • @xbelanch
    @xbelanch 10 днів тому

    Kay has lots of knowledge and a beautiful english voice for a guy from Barcelona. Amazing.

  • @tambow44
    @tambow44 8 днів тому

    My face lit up. Thanks, Kay!

  • @model.citizen.ps3
    @model.citizen.ps3 10 днів тому

    Awesome work! Have you ever noticed how recursion in programming is similar to a proof by induction in mathematics? In both you begin with the "base" case 🙂

  • @yanovoyair5129
    @yanovoyair5129 9 днів тому

    Yo, that’s dope.
    Greetings from Peru

  • @moormoor4281
    @moormoor4281 10 днів тому +5

    Thanking you most kindly from English England

  • @thanksforthefish42
    @thanksforthefish42 9 днів тому

    I've wanted to go through Sipser's computation course on mitocw for a while, already have his book. Maybe this popping up is a sign 😂

  • @onaecO
    @onaecO 10 днів тому

    Amazing channel!

  • @paulhuang2030
    @paulhuang2030 7 днів тому

    Awesome vbideo, thanks so much. What do you use to make these visualizations? They're beautiful!

    • @neoeno4242
      @neoeno4242  6 днів тому

      Thanks :) These ones are coded with Motion Canvas - motioncanvas.io - takes just a little while to get used to but really nice to work with once you do.

  • @BrayanRuiz-m3w
    @BrayanRuiz-m3w 18 годин тому

    hi Kay, hope you are doing well, Im 25 getting into programming, idk if I should go for functional programing in Ocaml or C++, any advise, love ur videos!!

  • @ozzy-fr7vj
    @ozzy-fr7vj 5 днів тому

    THAT WAS AWESOME !

  • @pavalep
    @pavalep 2 дні тому

    Thanks Kay

  • @RezaMarz
    @RezaMarz 8 днів тому

    Thanks.

  • @Bagrat-III
    @Bagrat-III 5 днів тому

    nice video

  • @cvabds
    @cvabds 10 днів тому

    im glad i watched this

  • @Humble_Electronic_Musician
    @Humble_Electronic_Musician 10 днів тому

    Awesome!

  • @howwitty
    @howwitty 10 днів тому

    Hi, great shirt.

  • @prawtism
    @prawtism 4 дні тому

    6:41 is there some reason why (Tail ::= 'a' Tail) is only in the right tree?

  • @xspager
    @xspager 10 днів тому +2

    Noam Chomsky

  • @eldersprig
    @eldersprig 6 днів тому

    can you do PEG grammar?

  • @ErikBongers
    @ErikBongers 5 днів тому

    Long time ago, I wrote a parser after I heard that compilers first tokenize. That concept clicked as it was easy to understand and implement: just group digits into numbers and letters into strings. I thought I was halfway. With a lot of suffering, I implemented what I now know to be a recursive descent parser.
    Years later I discovered the academic theory and...I still don't understand it. Or rather, I grew to understand how impractical it is for programmers.
    Firstly, it's explained to 'produce' text, which is already confusing for programmers as that's not what we want to do.
    Secondly, the grammar notation is not only very abstract but it's also incomplete. You casually mention multiple times that we are assuming a specific order, in case of multiple choices, even labelling a specific order as "greedy".
    I think no gramnar checker or parser generator uses standard BNF or even EBNF, so if these notations are so flawed, why are academics still teaching them?
    At least you mentioned that the top down production is not what we want to do but that this theory was initially developed to understand human languages, but you should start with that info!
    (But even then, no human "produces" sentences in a top down manner - you start with the concept e.g. "swimming" and then build the sentence around it. "I want to go swimming!" Interestingly, notice how in this case we "produced" from the right, starting with the last and most important word of the sentence.)
    As I'm writing this, I just realised that all this theory has been created to analyse and classify text hut that it's wrong to assume that it's equally useful to practically produce or transform (compile).
    I know that compiler theory does give some tools to compile text into code, such as the method of merging (reducing) tokens into non-terminal nodes, but you mentioned that highly demanding compilers for systems programming languages still use the "old fashioned" manually written recursive parsers.
    I think that's a symptom that language and compiler theory may not be that useful, otherwise it would have resulted in more advanced (in the meaning of more capable) compilers.

    • @ErikBongers
      @ErikBongers 5 днів тому

      I guess what I want to say is :
      1. Don't start compiler writing lessons with the graveyard of the theory, just as you wouldn't start a class on general relativity by explaining the 4 essential elements: earth, wind, fire and water.
      2. Don't parrot. Be critical of theory and throw away or refine what is wrong.
      3. If you want to know how good a car is, don't listen to the CEO but talk to the mechanic. Ask language builders what part if the theory they used...and what bits of theory they came up with as they were working, as this surely is the way that grammar notation was improved in a gazillion ways but never standardized!

    • @neoeno4242
      @neoeno4242  4 дні тому

      Thanks for taking the time to put these thoughts into writing, appreciate it 👍

  • @amir650
    @amir650 2 дні тому

    The Laugh language I think is wrong. How do you process 'haha' given the rules?
    'h' -> Head :: 'h' Tail
    'a' -> Tail 'a' Tail
    Now where to?

    • @neoeno4242
      @neoeno4242  2 дні тому

      Hi! Do you mean the version around 14:06? If so, yes that is a scaled back version just for that example (so won't match 'haha'). If I misunderstand though let me know.

  • @cvabds
    @cvabds 10 днів тому

    can you create a parser using a n dimensional gaussian

  • @insidiousmaximus
    @insidiousmaximus 5 днів тому

    why do I feel like listening to supergrass all of a sudden

  • @budiardjo6610
    @budiardjo6610 8 днів тому

    yah lanang

  • @noeaguilar4521
    @noeaguilar4521 9 днів тому

    I've had a nasty experience with umami. It seemed that when adding attribute values for some events recorded, it made my whole app crash (didn't really had time to debug what was the problem, so I just removed those attribute values and it worked as expected). Other than that, very pleased with this great tool !

  • @devashishdalvi7527
    @devashishdalvi7527 10 днів тому

    What is 0 more times? Around 10:04

    • @anon_y_mousse
      @anon_y_mousse 9 днів тому +2

      Zero *or* more times. The "or" is very faint, but if you play the video at 1x or slower you can hear it even if the captions don't capture that fact. If you need further explanation of what zero or more times means, it means that something can repeat to infinity or not exist at all.

    • @devashishdalvi7527
      @devashishdalvi7527 9 днів тому +1

      Ok that explains a lot. Thanks for the explanation

  • @mlab3051
    @mlab3051 20 годин тому

    So the rumore of sanskrit is an artificial language is true, what I person.

  • @vk8a8
    @vk8a8 10 днів тому

    if ode5 is so good why has there no ode6

  • @theJellyjoker
    @theJellyjoker 10 днів тому

    You should be able to solve this.
    Subject + Verb + Object * preposition = X^adverb
    Solve for X when Subject = Topic
    Show your work