Notes on programing languages

Interpreters on 2023

program - parse -> abstract-syntax-tree - eval -> result

sspy.py - a tiny scheme interpreter with python - shows the details.

Python Data Model -> A Framework/API for core language constructs

We can leverage the Python Data Model to build new classes.

By using and implementing special methods of Python Data Model in your objects, your objects can behave like the built-in types, enabling the expressive coding style Pythonic. You will find that your intuition applies everywhere.

Data Sturctures
Functions as objects
target = deco(target)
def deco(func):
    def inner():
        print("running inner()")
    return inner

@deco
def target():
    print("running target()")
    return
Object Oriented
Iteration
def gen_ab():
    yield 'A'
    yield 'B'
Context Managers
generators as coroutines
Metaprogramming

Standard ML

notes

reference