Understand Abstract Syntax Trees - ASTs - in Practical and Useful Ways for Frontend Developers

แชร์
ฝัง
  • เผยแพร่เมื่อ 10 มิ.ย. 2024
  • Master abstract syntax trees, ASTs, with Wealthfront Engineer, Spencer Miskoviak. Spencer shares his understanding of ASTs, acquired throughout his career at Wealthfront and previously Handshake and Target, to help up-level your ability to maintain continuously evolving large JavaScript codebases, to parse, traverse, and generate abstract syntax trees and much more. Get started with abstract syntax tree fundamentals and dive deep into several practical use cases of abstract syntax trees in the full course, Practical Abstract Syntax Trees, here: www.newline.co/courses/practi....
    As a frontend engineer, it can be difficult to appreciate ASTs because you likely don't use traditional compilers outputting bytecode as such. It is likely that you rely on tooling built on top of abstract syntax trees. Some common examples of frontend build tools or compilers that rely on abstract syntax trees are webpack, babel, and swc. However, ASTs aren't isolated to build tools either. Tools like Prettier (code formatter), ESLint (code linter), or jscodeshift (code transformer) have different purposes but they all rely on abstract syntax trees. It's not necessary to understand abstract syntax trees to be a productive and successful frontend engineer. However, having a basic understanding can boost your ability to maintain and make sweeping changes to any sized codebase in a safe and reliable way.
    This course is produced by
    ewline; building courses for developers from software professionals. We democratize production-level details that you would have to spend years educating yourself by working at a Silicon Valley company. Get instant access to this course and other newline e-books, guides and courses by subscribing here: www.newline.co/pricing
    #newline #AbstractSyntaxTrees #JavaScript
    Connect with
    ewline Online!
    Visit
    ewline's Website: www.newline.co/
    Find
    ewline on Facebook: / newlinedotco
    Follow
    ewline on Twitter: / fullstackio
    Follow
    ewline on Instagram: / newlinedotco
    Chapters
    0:00 Course Introduction
    02:30 AST Basics
    08:25 Exploring an AST
    12:47 JavaScript AST Ecosystem
    14:34 Environment Setup
    15:38 Generating a JavaScript AST
    22:07 Traversing an AST
    29:40 Preventing Runtime Errors (with Types)

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

  • @nightwolf4343
    @nightwolf4343 5 หลายเดือนก่อน +2

    Usually I don't write comments for the videos, but this one is really helpful. So I would like to tell: Thank you for this!

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

      Glad it was helpful!

  • @iyar220
    @iyar220 8 หลายเดือนก่อน +3

    I'm learning how to build compilers, and I was a bit lost at the subject of context-free grammars and ASTs, thanks for helping to clear that up!

  • @ayush612
    @ayush612 ปีที่แล้ว +9

    Thank you sir for creating this unique video and in such depth ... Thank you and such an awesome presentation and quality!

    • @newlinedotco
      @newlinedotco  ปีที่แล้ว +1

      You are welcome! Thanks for the kind words. We are glad you enjoyed this.

  • @abdullahahmed8468
    @abdullahahmed8468 2 ปีที่แล้ว +2

    really that's amazing and a lot of useful concepts and tools and examples.
    Thank you so much.

    • @newlinedotco
      @newlinedotco  2 ปีที่แล้ว

      Yes, we are glad you liked it!

  • @vasilygerrans
    @vasilygerrans 2 ปีที่แล้ว

    Excellent video! Thank you

    • @newlinedotco
      @newlinedotco  2 ปีที่แล้ว

      Thanks! We are glad you enjoyed this.

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

    This is great tutorial

  • @dikhyantkrishnadalai6422
    @dikhyantkrishnadalai6422 2 ปีที่แล้ว

    Thank you
    It was helpful

    • @newlinedotco
      @newlinedotco  2 ปีที่แล้ว

      Awesome! We are glad that you enjoyed this.

  • @ocsilentwolf7805
    @ocsilentwolf7805 11 หลายเดือนก่อน

    Thank you this will help me in my next project

    • @newlinedotco
      @newlinedotco  11 หลายเดือนก่อน

      Great! So glad to hear this.

  • @thatisuday
    @thatisuday ปีที่แล้ว

    Awesome video, keep it up 😄

  • @manjurulislamkhan4722
    @manjurulislamkhan4722 ปีที่แล้ว

    Brilliant explanation

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

    This is amazing.

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

      Awesome! We are glad this was helpful.

  • @user-vf5uw7jb5e
    @user-vf5uw7jb5e 2 ปีที่แล้ว +1

    thank you

  • @hamidmouad829
    @hamidmouad829 ปีที่แล้ว +2

    22:07
    const rootNode = parse(code).program.body[0].expression;
    function traverse(node) {
    if (!node) {
    return;
    }
    if (node.type === "NumericLiteral") {
    console.log(node.value);
    }
    if (node.left) {
    traverse(node.left);
    }
    if (node.right) {
    traverse(node.right);
    }
    }
    traverse(rootNode);

  • @MrFarooqueazam
    @MrFarooqueazam ปีที่แล้ว

    wonderful😇

  • @solitarywayfarer8693
    @solitarywayfarer8693 ปีที่แล้ว

    How can I generate AST for C source code using C++ language? Please suggest me something.

    • @newlinedotco
      @newlinedotco  ปีที่แล้ว

      This course was produced for JavaScript, but the theory/principles should carry to most other languages/tools. Our Discord server is a great resource to connect with others. You can join us here: discord.com/invite/D88ppSb

  • @easycomputerscience69
    @easycomputerscience69 ปีที่แล้ว

    Can any one tell AST for java programs

    • @newlinedotco
      @newlinedotco  ปีที่แล้ว

      This course is aimed at JavaScript, but the theory/principles should carry to most other languages/tools. With that focus, I don't have a specific tool recommendation but maybe google/stack overflow could help point you toward the right tools.