4:28 Are these Lispy expressions not too oversimplified? Isn't it better to use nested objects which can also hold an internal map for attribute grammar processing, and build a language atop of object trees/graphs, and not lists? class Object { def __init__(self,V): self.label = V # label or scalar value (string, number) self.attr = {} # attributes self.nest = [] # nested elements in order (AST subtree) } class Number(Object): pass class String(Object): pass ... class Stack(Object): pass class Queue(Object): pass ... class Function(Object): pass
@dmitryponyatov21585 жыл бұрын
This model looks me more universal, as it can be easily expanded, for example, we can inherit it and use other approaches then lambda evaluation: class Actor(Object): def __init__(self,V): Object.__init__(self,V) self.queue = Queue() # message queue def dispatch(self): ... # async message dispatcher
@DmitrySoshnikov-education5 жыл бұрын
Right, and this is exactly the purpose -- to have the format as easy as possible, but still be able to build full semantics. Converting to a different expression format (like in your example) is a task of a transformer, which can be added as a separate module.
@gopalvirtual3 жыл бұрын
What are you using to create those slides? Pretty neat I would say
@DmitrySoshnikov-education3 жыл бұрын
Thanks, yes, it's a combination of Keynote, After effects, Good notes, and live editing on iPad.
@gopalvirtual3 жыл бұрын
@@DmitrySoshnikov-education Woah, that's a lot of effort after the actual content itself. Appreciated.
@DmitrySoshnikov-education4 жыл бұрын
Course syllabus: ⭐ *Enroll:* dmitrysoshnikov.com/courses/essentials-of-interpretation/ 📚 *Udemy:* www.udemy.com/course/essentials-of-interpretation/?referralCode=E7D6C9ADFCA273A53950 👉 *DS Education:* www.dmitrysoshnikov.education/p/essentials-of-interpretation Lecture 1: Parsers, ASTs, Interpreters and Compilers Lecture 2: AST Interpreters and Virtual Machines Lecture 3: Compilers: AOT, JIT, Transpiler Lecture 4: Eva programming language Lecture 5: Self-evaluating expressions Lecture 6: Variables and Environments Lecture 7: Blocks: expression groups and Nested Scopes Lecture 8: Control flow: If and While expressions Lecture 9: Back to parsers: S-expression to AST Lecture 10: Built-in and Native functions Lecture 11: User-defined functions, Activation Records and Closures Lecture 12: Lambda functions and Functional programming Lecture 13: Call-stack and Recursive calls Lecture 14: Syntactic sugar: Switch, For, Inc, Dec operators Lecture 15: Object-oriented Eva: Classes Lecture 16: Class inheritance and Super calls Lecture 17: Code isolation: Modules and Imports Lecture 18: Final executable and further data structures