Skip to content

Make it possible to compile the Z combinator! - #229

Merged
skx merged 4 commits into
mainfrom
z-combinator
Jul 28, 2026
Merged

Make it possible to compile the Z combinator!#229
skx merged 4 commits into
mainfrom
z-combinator

Conversation

@skx

@skx skx commented Jul 28, 2026

Copy link
Copy Markdown
Owner

This pull-request updates our compiler so that the z-combinator (the less famous cousin of the rockstart y-combinator) compiles and executes!

I had to make two main changes:

  • Allow compiling nested lambdas, which hadn't been possible until now.
  • Allow lambdas to be located within captured-variables/closures.
    • Before only globals and locals worked, not captured variables.

That said this worked immediately in the inception interpreter, which was a pleasant surprise.

I think we're now 100% feature-complete, barring bugs.

skx added 4 commits July 28, 2026 20:05
We were previously only compling top-level lambdas, but if there are
child lambdas we need to handle them too.
@skx
skx merged commit 4d63cc2 into main Jul 28, 2026
1 check passed
@skx
skx deleted the z-combinator branch July 28, 2026 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant