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

Redesigning the crucible-cli API #1240

Open
langston-barrett opened this issue Aug 20, 2024 · 0 comments
Open

Redesigning the crucible-cli API #1240

langston-barrett opened this issue Aug 20, 2024 · 0 comments
Labels

Comments

@langston-barrett
Copy link
Contributor

langston-barrett commented Aug 20, 2024

The crucible-cli API is heavily callback-oriented. For example, it requires a callback for setting up the appropriate Crucible language extension:

simulateProgramWithExtension
:: (IsSyntaxExtension ext, ?parserHooks :: ParserHooks ext)
=> (forall sym bak t st fs. (IsSymBackend sym bak, sym ~ ExprBuilder t st fs) =>
bak -> IO (ExtensionImpl () sym ext))

and provides several "hooks" for code that does different things before the program is simulated:

data SimulateProgramHooks ext = SimulateProgramHooks

This is a confusing API (due to the amount of inversion-of-control), and it is not very flexible. For example, it is currently impossible to set up Macaw's memory adequately. We should consider if there are alternative designs that would allow code reuse without resorting to a "framework-style" API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants