What Is An Abstract Syntax Tree, With WealthFront Engineer Spencer Miskoviak

  Рет қаралды 22,822

newline

newline

Күн бұрын

Пікірлер: 10
@schmoris
@schmoris 5 ай бұрын
Holy snack, the lady at the end gave me a heart attack! Nice video tho.
@abdulmobinkarimi6846
@abdulmobinkarimi6846 13 күн бұрын
same 😂
@BeRohan5
@BeRohan5 Жыл бұрын
Good simple straightforward explaintion. I would love to watch a detailed video about the same. It would be just great if you can turn it into a 10 part series. Thanks for the video and please keep the great work coming :)
@newlinedotco
@newlinedotco Жыл бұрын
Awesome! More to come soon. You might enjoy the full course too! You can check it out here, www.newline.co/courses/practical-abstract-syntax-trees.
@about2mount
@about2mount 11 ай бұрын
Trees and Nodes honestly do not exists. They are only Imaginary scholarly taught schematics as a study to teach new programmers how to perform Logic of a programs syntax while developing a parser Engine. A syntax is Parsed from Left To Right within a Loop which moves from Top to Bottom thousands to millions of times per second. And as its being parsed, global, string and static variables are set for counting, for storing buffered short expression patterns and to store specific data into struct arrays for further processing. And we called this........."Logical Routines". You have a good presentation, a passion and are determined. Stay with it. Thanks.
@CELESTEisdead
@CELESTEisdead 5 ай бұрын
"doesn't exist" maybe for you java plebs, try that in C
@darraghconnaughton5095
@darraghconnaughton5095 Жыл бұрын
Excellent video, feel I have a much better grasp of AST now. Thank you.
@newlinedotco
@newlinedotco 11 ай бұрын
Great to hear!
@danielcrompton7818
@danielcrompton7818 3 ай бұрын
I write it in Swift import Foundation import CoreGraphics protocol Number { static func + (lhs: Self, rhs: Self) -> Self static func - (lhs: Self, rhs: Self) -> Self static func / (lhs: Self, rhs: Self) -> Self static func * (lhs: Self, rhs: Self) -> Self } extension Int: Number { } extension Float: Number { } extension Double: Number { } extension CGFloat: Number { } struct Operation { /// Enum to represent **a node on an AST** (abstract syntax tree). The node can either be a number (with something numeric attached to it) or another operation (which is also associated with the case). indirect enum Term { case number(N) case operation(Operation) static var `default`: Term { Term.number(0 as! N) } } /// Store the left hand node let left: Term /// Store the right node let right: Term /// Store the calculation function to calculate an answer from 2 numbers (not Terms, these are handled later) let reduce: (N, N) -> N init(_ t1: Term = .default, _ t2: Term = .default, reduce: @escaping (N, N) -> N) { self.left = t1 self.right = t2 self.reduce = reduce } func calculate() -> N { // Return a value of the calculation function `calculate` on the terms. It traverses the tree first to find the last operation, return the result and continute up the tree until the current node /// Function to recursively traverse the tree, calculating the leaf operations first func evaluate(_ term: Term) -> N { return switch term { case .number(let num): num case .operation(let op): op.calculate() } } // Return the current operation's calculation on the 2 terms let t1 = evaluate(left) let t2 = evaluate(right) return reduce(t1, t2) } } let op = Operation(.number(2), .operation(Operation(.number(5.0), .number(10), reduce: *)), reduce: +) // Output 57 print(op.calculate())
abstract syntax tree's are gonna be IMPORTANT in 2024
20:53
Chris Hay
Рет қаралды 2,5 М.
Какой я клей? | CLEX #shorts
0:59
CLEX
Рет қаралды 1,9 МЛН
#behindthescenes @CrissaJackson
0:11
Happy Kelli
Рет қаралды 27 МЛН
The Dome Paradox: A Loophole in Newton's Laws
22:59
Up and Atom
Рет қаралды 980 М.
Parsing Explained - Computerphile
14:58
Computerphile
Рет қаралды 247 М.
Python AST Parsing and Custom Linting
11:24
mCoding
Рет қаралды 46 М.
3 Types of Algorithms Every Programmer Needs to Know
13:12
ForrestKnight
Рет қаралды 512 М.
Compilation - Part Three: Syntax Analysis
22:05
Computer Science Lessons
Рет қаралды 40 М.
Parsing Bottom Up - Computerphile
11:13
Computerphile
Рет қаралды 81 М.
Building a Parser from scratch. Lecture [1/18]: Tokenizer | Parser
14:02
Dmitry Soshnikov
Рет қаралды 157 М.
Compilers, How They Work, And Writing Them From Scratch
23:53
Adam McDaniel (kiwi)
Рет қаралды 236 М.