Skip to content

Instantly share code, notes, and snippets.

@Idorobots
Last active December 14, 2015 02:49
Show Gist options
  • Save Idorobots/5016087 to your computer and use it in GitHub Desktop.
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.
(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)))
@Angelfirenze
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment