Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement extensible instruction set #2

Open
pdarragh opened this issue Oct 4, 2022 · 0 comments
Open

Implement extensible instruction set #2

pdarragh opened this issue Oct 4, 2022 · 0 comments
Assignees
Labels
core Issues for the core functionality enhancement New feature or request

Comments

@pdarragh
Copy link
Collaborator

pdarragh commented Oct 4, 2022

Via @stephentyrone on Twitter:

Yes! Great to have this for teaching how to think about architecture too. What if we added an instruction that did X? Well, now you can just add it and teach the compiler to emit it and find out!

Which got me thinking about implementing the interpreter's core functionality in such a way that additional instructions can be implemented later on. I think this would also involve providing the Instruction supertype from ast.rkt.

I'm not totally sure how best to go about this. Xsmith had extensible grammars and such implemented through a (highly complicated) macro system (that I did not fully understand)... perhaps something like that would work? Or else the step function could be made such that its wildcard case calls a function stored in a parameter (from make-parameter) which can be overridden or something.

Or maybe... there could be a macro provided to define-new-instruction that requires a clause to be defined, which can be inserted into the match? Perhaps this is just a wrapper around the parameter idea? Unsure. Need to think on it more.

@pdarragh pdarragh added the enhancement New feature or request label Oct 4, 2022
@pdarragh pdarragh self-assigned this Oct 4, 2022
@pdarragh pdarragh added the core Issues for the core functionality label Jul 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Issues for the core functionality enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant