I thought about how (and more importantly why) some extensions to a
minimal programming language
increase its power in a way that gets us out of a “Turing tarpit”, then
returned to the idea a couple of weeks later when writing about
different
notions of power
in programming languages. These reflections have been quite helpful for
me to guide my own experiments. I would like to continue building on the
ideas by writing about how effects and effect handlers fit into the
picture.
I built a tree-walk interpreter for a
small language with effect handlers
and wanted to use it to build a static site generator for this blog.
This didn't quite work out, because the interpreter depends on Rust's
stack limit and quickly blows the stack for deeply recursive calls. A
tree-walk interpreter is fundamentally awkward for the kind of resumable
execution that effects require, which is why I started building a
stack-based VM. The architecture is much cleaner, but the work is still ongoing. I
still want to eventually use it to build a static site generator and
migrate these notes to it.
I spent a lot of time experimenting with explicit bindings and
reasonable macros (part 1,
part 2,
part 3,
more syntax experiments, comparison with fexprs). I
learned a lot, but the work is still incomplete, as I still have to
figure out how to represent the AST structure in a way that supports
reflection without pushing the required dynamism into the core calculus.
The different lab notes reflect my thoughts quite well, but I want to
eventually collect them into an article that stands on its own.
I experimented with a methodology of
throwing away code
at the end of each day and also built a small
testing infrastructure
to support this development approach while building my language. This
worked out quite well and I want to spend more time rewriting code
daily.
What Went Well? What Didn't?
I'm very happy with the format of writing weekly lab notes and want to
keep going. The detour of experimenting with radically rewriting and
throwing away code was also surprisingly rewarding, so I want to spend
more time thinking about the human element of software development and how
I can change my own practices.
I'm less happy with spending 5 weeks on the topic of explicit bindings /
reasonable macros without having a final prototype to show for it. This is
partly related to it being more experimental than any of the other topics,
but I also want to try to approach an idea like this more incrementally in
the future.
What I Want to Do Next
I will be spending the next 12 weeks at the
Recurse Center, where I want to
continue these experiments, but also just work on other ideas that
interest me. I want to...
finish the VM, maybe move to a register-based architecture.
complete a first proof of concept for reasonable macros.
build a real program in the language, e.g. a static site generator.
experiment with partial evaluation, to get rid of macro overhead.
learn about fully type inferred type systems that can reject implicit
recursion.
ideally think about how a language can be built around hot code reload.