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

WIP: abi-cafe v2 (kdl-script frontend) #20

Draft
wants to merge 16 commits into
base: main
Choose a base branch
from
Draft

WIP: abi-cafe v2 (kdl-script frontend) #20

wants to merge 16 commits into from

Conversation

Gankra
Copy link
Owner

@Gankra Gankra commented Nov 29, 2023

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).

@Gankra Gankra changed the title WIP: kdl-script backend WIP: abi-cafe v2 (kdl-script backend) Nov 29, 2023
@Gankra Gankra changed the title WIP: abi-cafe v2 (kdl-script backend) WIP: abi-cafe v2 (kdl-script frontend) Nov 29, 2023
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.
Copy link
Owner Author

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.

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

Successfully merging this pull request may close these issues.

None yet

1 participant