Skip to content

Latest commit

 

History

History
19 lines (19 loc) · 923 Bytes

notes.org

File metadata and controls

19 lines (19 loc) · 923 Bytes

4 Steps for Adding Language Features

  1. Syntax
    • Parser modifications
  2. Representation
    • Objects and data to represent feature
  3. Parsing
    • Modify reader/printer
    • AST -> read feature
  4. Semantics
    • Evaluation and manipulation

Common Pitfalls

  • When writing a builtin operation remember to operate on the ARGUMENTS of the lval that’s passed in. This usually involves popping them off the lval first.
  • Remember to delete the container lval that runs the builtin function before returning the newly created lval that’s inside to replace it.

TODOs

  • What is the logic behind who destroys variables and frees their memory? Still don’t fully grasp this.
  • Possibly make a version of this in Rust/Go to learn those langs!
  • possibly expand standard lib to include stuff from other lisps
  • how could we make an object model in here?
  • implement same Lang in a different lisp