Language Folk Wisdom

Andy Wingo, a JavaScript and Guile Scheme blogger writes this insightful comment There is very little in the way of correct, current, and universal folk wisdom as to how to implement a programming language. Compiler hackers are priests of their languages, yes, but their temples are in reality more or less isolated cults, in which …

In a name

Just registered close-paren.com. Got a project in mind for it, but it just redirects here for now. My first choice was free-variable.com, but I saw that free-variable.org was already claimed by another good programmer. Interestingly, he too wanted a different domain originally, strictly-positive.org. Gotta have back up plans. 🙂 )))

Schools of Thought – Compilers

It occurs to me that there are roughly two schools of compiler and language design, typified by the books The Structure and Interpretation of Computer programs (aka SICP) by Ableson and Sussman, and Compilers: Principles, Techniques, and Tools by Aho et al. They’re also known as the Wizard Book and Dragon Book, respectively, named for …

A little stack machine

Threw this together to show an example of computed goto. Computed goto is a handy tool for building little interpreters. #include #define NEXT goto **ip++ int main() { int fact = 6, fact_b0 = 16; void* program[] = { &&push, (void*)5, &&call, (void*)fact, &&printi, &&end, &&beq0, (void*)fact_b0, &&dup, &&push, (void*)1, &&sub, &&call, (void*)fact, &&mult, &&ret, …

Schrodinger’s Yacc

There was a small controversy last year about parser combinators, a convenient way of rapidly developing parsers in a functional style. Yacc is presumably chosen as the archetypal non-combinator parser generator, requiring separate external parser compiler, known for being a pain to use. “Yacc is dead” (ltu discussion) “Yacc is not dead“ “Yacc is dead: …