Writing a parser in Go, the C way | Tobias Guggenmos

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

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

  • @jasonwhite5578
    @jasonwhite5578 Год назад +3

    This is exactly why you shouldn't let interns give talks, they give really bad advice, because they don't know any better. When new to parsers, the absolute worst thing you can do is to use regular expressions you copy-pasta'd off of stack overflow, and outsource your own job to a tool like YACC. Here's an amazing video on building a parser using recursive descent, and you'll learn how to create and describe your own grammar if you ever end up doing something like this in an actual production application. ruclips.net/video/SToUyjAsaFk/видео.html

    • @dandogamer
      @dandogamer Год назад

      Thanks for sharing that link, it's a really good resource!!

    • @nonconsensualopinion
      @nonconsensualopinion 9 месяцев назад

      With respect to using YACC: that is exactly what you should do. Writing a lexer is more straight forward. Writing a parser is more complicated. That is why compiler compilers (the CC in "YACC") were created. Sure, if you use a recursive descent parser on a simple grammar you can probably succeed, but YACC is a better option if you are using, say, an LR parser. "Rolling your own" parser is a great way to learn something, but if you are actually creating a non-trivial language and you want production quality, you should be using a parse generator like YACC.

    • @jasonwhite5578
      @jasonwhite5578 9 месяцев назад

      @@nonconsensualopinion It depends on the project, but I've written such a thing for General Electric that is in production, and surprise is that it wasn't that hard. Using YACC is just overengineering for most projects and you're now dependent on YACC when you don't need to be
      .

  • @donatj
    @donatj Год назад

    Not a bad talk, I would have appreciated a talk more from a standpoint of someone who doesn't have a history of writing parsers though.

  • @misterzurg7874
    @misterzurg7874 3 года назад +1

    GitHub: github.com/slrtbtfs/goyacc-tutorial

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

    Bruh