archives

How to Write Seemingly Unhygienic and Referentially Opaque Macros with Syntax-rules

How to Write Seemingly Unhygienic and Referentially Opaque Macros with Syntax-rules
By Oleg Kiselyov
This paper details how folklore notions of hygiene and referential transparency of R5RS macros are defeated by a systematic attack. We demonstrate syntax-rules that seem to capture user identifiers and allow their own identifiers to be captured by the closest lexical bindings. In other words, we have written R5RS macros that accomplish what commonly believed to be impossible.

Egel Language v0.0.2

I wrote a little toy language you now can read an introduction to. I fully blame LtU for getting me interested in hacking around languages so don't laugh, it's embarrassing enough as it is. You can try a small Conway's Game of Life example on TIO.

Anyway, just a short heads up. It's a small language based on untyped eager combinatorial rewriting of a DAG in C++, which isn't too fast.

You're all invited to break the thing, I am at version 0.0.2 and I want to get rid of possible bugs so your expertise can matter.

Anyway, leave your comment here. Preferably, a nice one.