-
Notifications
You must be signed in to change notification settings - Fork 6
runsol executable #300
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
Draft
mbenke
wants to merge
8
commits into
main
Choose a base branch
from
mbenke/runsol
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
runsol executable #300
Conversation
This file contains hidden or 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
Implement a new RunSol Haskell program (app/RunSol.hs) that replicates
the functionality of runsol.sh while integrating sol-core and yule
compilation directly as library functions instead of external processes.
Key changes:
- Move yule modules from yule/ to src/Yule/ with proper namespacing
- Yule/Translate.hs, Yule/TM.hs, Yule/Compress.hs, Yule/Builtins.hs,
Yule/Locus.hs, Yule/Options.hs
- Expose Yule.* modules in library for use by RunSol
- Create new runsol executable that:
- Calls compile() directly for sol-core compilation
- Calls translateObject() directly for yule translation
- Uses aeson for JSON processing (instead of jq)
- Calls external processes for solc, evm, cast
- Supports all runsol.sh command-line options
- Update yule/Main.hs to use new Yule.* module imports
- Update sol-core.cabal with Yule.* exports and runsol executable
Benefits:
- Faster execution (no process spawning for sol-core and yule)
- Better error handling through Haskell types
- Single executable instead of shell script
- Type safety through direct function calls
- Better module organization with Yule namespace
🤖 Generated with Claude Code
Co-Authored-By: Claude Haiku 4.5 <[email protected]>
Extend RunSol executable to recognize and process all sol-core options: - -i, --include DIRS: Colon-separated import directories - -n, --no-specialise: Skip specialisation phase - -s, --no-desugar-calls: Skip indirect call desugaring - -m, --no-match-compiler: Skip match compilation - -d, --no-if-desugar: Skip if/bool desugaring - -g, --no-gen-dispatch: Skip contract dispatch generation - -v, --verbose: Verbose output - --dump-ast, --dump-env, --dump-dispatch, --dump-ds, --dump-df, --dump-spec, --dump-core: Dump intermediate representations - --debug-spec, --debug-core: Debug output for specialisation and core - --timing: Measure compilation time All options are now passed directly to the compile function, making RunSol a fully-featured replacement for runsol.sh with the ability to control every aspect of the compilation pipeline. 🤖 Generated with Claude Code Co-Authored-By: Claude Haiku 4.5 <[email protected]>
Add addRetCode wrapper to Yul objects to ensure contract function results are stored in memory and returned to the EVM caller. This adds code to mstore the result and return 32 bytes from memory location 0. Also add JSONL parsing to extract return data from evm trace output, fixing the issue where runsol would show "Execution successful" without displaying the actual return value (e.g., returndata: 0x...2a for value 42). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Haiku 4.5 <[email protected]>
Add pattern match for SComment in genStmt to properly handle comments in Core code. Comments are translated to YComment statements, which is consistent with the existing genStmtWithComment function. This fixes the error 'genStmt unimplemented for: /* ... */' that occurred when compiling Core code containing type annotations or other comments. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Haiku 4.5 <[email protected]>
Update error extraction logic to properly parse JSON error fields: - Extract error values as strings instead of showing JSON representation - Handle null error fields (means no error) vs actual error strings - Use extracted evmError from JSON when available, fall back to exit code This fixes the issue where "execution reverted" was being displayed as "String \"execution reverted\"" (JSON show representation). Matches the behavior of runsol.sh which checks if error field is null and reports accordingly. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Haiku 4.5 <[email protected]>
Generate two versions of the compiled contract: 1. Deployment bytecode: Wraps contract with deployment initialization code 2. Runtime bytecode: Plain contract code for function execution This fixes the issue where runtime execution would return the deployment bytecode itself (when called without --create) instead of executing the actual contract functions. Now correctly: - Creation phase returns the deployment bytecode - Runtime phase executes the runtime bytecode and properly returns execution results or reverts when no valid selector is provided Verified with test cases: - No selector: "Execution failed: execution reverted" - something()(): returns 1 (decoded) - add2(2, 3): returns 5 (decoded, 2+3) Matches the expected behavior of runsol.sh. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Haiku 4.5 <[email protected]>
Collaborator
Author
|
Still needs some work - constructors are not emitted properly. |
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.
Claude-coded reimplementation of runsol.sh as a Haskell executable