Why This Matters
This article highlights the importance of understanding how interpreters and compilers work, as they form the foundation of computer programming and software development. By building a Lisp interpreter in Python, developers gain insight into language syntax, semantics, and execution, which enhances their overall grasp of programming languages and system architecture.
Key Takeaways
- Scheme syntax is expression-based with no statement/expression distinction.
- Understanding interpreters helps demystify how programming languages execute code.
- Building a Lisp interpreter in Python provides practical insight into language design and implementation.
(How to Write a (Lisp) Interpreter (in Python))
Why does this matter? As Steve Yegge said, "If you don't know how compilers work, then you don't know how computers work." Yegge describes 8 problems that can be solved with compilers (or equally well with interpreters, or with Yegge's typical heavy dosage of cynicism).
Syntax and Semantics of Scheme Programs
Scheme syntax is different from most other programming languages. Consider:
Java Scheme if (x.val() > 0) {
return fn(A[i] + 3 * i,
new String[] {"one", "two"});
} (if (> (val x) 0)
(fn (+ (aref A i) (* 3 i))
(quote (one two)))
... continue reading