Last active
December 14, 2015 02:49
-
-
Save Idorobots/5016087 to your computer and use it in GitHub Desktop.
Code that writes code that writes code that defines a virtual machine emulator.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defmacro defvm (regs @tuple body) | |
(append `(do (defmacro defop (name @tuple body) | |
(append (tuple 'defun name '$regs | |
(append (tuple 'dump (stringof name)) '$regs)) | |
body)) | |
(defmacro go (name) | |
(cons name '$regs))) | |
(map (lambda (op) | |
(append `(defop $(car op)) | |
(cdr op))) | |
body))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I can't imagine how useful this could be or is to people with lack of use of their hands for whatever reason. I can't wait to see about this.