-
Notifications
You must be signed in to change notification settings - Fork 15
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
WIP: abi-cafe v2 (kdl-script frontend) #20
Merged
Conversation
This file contains 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
Gankra
commented
May 4, 2024
src/abis/mod.rs
Outdated
Comment on lines
67
to
69
// TODO: add some kind of ValueSelector type here, so that when faced with the | ||
// question of "what value is this function argument SUPPOSED to have?", | ||
// all implementations of the test (and the checker) can consistently agree. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This huge comment is important and consuming me.
…non-support inline
This was referenced Jun 30, 2024
Closed
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For a TL;DR of what this branch is about, see the abi-cafe-v2-manifesto.
This is a WIP rewrite of abi-cafe to be driven by kdl-script type definitions, which were created precisely for this usecase (especially the "pun" types). I started this like, over a year ago but ran out of energy when it came time to integrate it into abi-cafe because I went SO FUCKING HARD on designing the kdl-script type system that trying to (re)implement all the backends in one shot was a completely overwhelming task.
rust2.rs shows some initial work on rewriting the rust backend. I got as far as type definitions, but function definitions and bodies (both callee and caller) and how to populate values for those types just was Too Much.
If we ever want to do this, it should be an incremental migration. Implement the stuff the current ron backend supports, then incrementally add support for things like puns, varargs (#1), annotations, outparams, enums, unions, etc.
The kdl-script compiler also provides a ton of utilities for querying "what type definitions do i need for just this one function in a test" and "how do i forward declare them properly for things like C". In principle this makes it more suitable for something like #3 (outputting a standalone godbolt version of a test for submitting bug reports).