Skip to main content


I got wondering how much work it would be to compile s-expressions to #uxn, it turns out, not a lot.

As a test, I've only implemented `let`, but it's shockingly easy to map lisp-like syntax to the uxn assembly, I might push this further still.

https://git.sr.ht/~rabbits/qzil/tree/master/item/src/qzil.tal

#uxn
This entry was edited (3 months ago)
in reply to Devine Lu Linvega

After all, a Lisp machine is just a stack machine with extra steps. 😀

Devine Lu Linvega reshared this.

in reply to Devine Lu Linvega

@spnw 🤔 to me it feels... sideways? a dual approach kinda thing... like in quantum mechanics where you can write the same system in more than one basis but the underlying dynamics is the same? and i don't mean in the sense that both are programming abstractions.

sorry, got rambly. haven't studied programming languages development theory, but yeah, i love this kinda shared thing between both styles.

@spnw
in reply to Devine Lu Linvega

a stack based vm is often the easiest way to implement a lisp, as you have noticed, converting from one to the other is not at all complicated
in reply to Luci for dyeing

@zens yup, the first time I did it was for the SECD stack machine which had a lot more convenient operations for hosting a functional language.
https://wiki.xxiivv.com/site/secd.html
in reply to Devine Lu Linvega

That is essentially what Funktal does, except that I didn't implement the let-syntax yet, because it's only syntactic sugar for lambdas. I'll do it eventually as it is very convenient.
in reply to WimⓂ️

@wim_v12e I should have gone straight for lambdas but I didn't think I'd get very far. I'll do defines today and maybe make let on top of lambda.

Lo, thar be cookies on this site to keep track of your login. By clicking 'okay', you are CONSENTING to this.