Draft
Conversation
mbenke
reviewed
Feb 25, 2026
Collaborator
mbenke
left a comment
There was a problem hiding this comment.
Alas, this PR breaks the contract tests (ERC20 et consortes):
$ ./run_contests.sh
Processing: test/examples/dispatch/basic.json
Compiling to Hull...
Configuration is affected by the following files:
- cabal.project.local
Emitting hull for contract C
Writing to output1.hull
Generating Yul...
Configuration is affected by the following files:
- cabal.project.local
yule: /home/ben/work/solcore/build/output1.hull:345:34:
|
345 | return dispatch_$impl$std.$impl$abi_decode$calldataLbytesJ_pairLuint256_pairLuint256_uint256JJ_CalldataWordReader_pairLuint256_pairLuint256_uint256JJ(decodable, pty, prdr)
| ^
unexpected '.'
expecting "assembly", "false", "fst", "function", "if", "in", "inl", "inr", "let", "match", "return", "revert", "snd", "true", '$', '(', '_', '{', '}', alphanumeric character, integer, or letter
CallStack (from HasCallStack):
error, called at src/Common/LightYear.hs:26:15 in sol-core-0.0.0.0-inplace:Common.LightYear
runMyParser', called at src/Common/LightYear.hs:21:22 in sol-core-0.0.0.0-inplace:Common.LightYear
runMyParser, called at src/Language/Hull/Parser.hs:30:24 in sol-core-0.0.0.0-inplace:Language.Hull.Parser
Error: yule generation failed
Processing: test/examples/dispatch/neg.json
Compiling to Hull...
Configuration is affected by the following files:
- cabal.project.local
Module validation failed for /home/ben/work/solcore/test/examples/dispatch/neg.solc:
Undefined type constructor:
uint256
- in:function negPair () -> uint256 {
return uint256(fromB(pairfst(Neg.neg(Pair(B.F, B.T))))) ;
}
- in:function negPair () -> uint256 {
return uint256(fromB(pairfst(Neg.neg(Pair(B.F, B.T))))) ;
}
- in:contract NegPair {
constructor () {
}
function negPair () -> uint256 {
return uint256(fromB(pairfst(Neg.neg(Pair(B.F, B.T))))) ;
}
}
- in:contract NegPair {
constructor () {
}
function negPair () -> uint256 {
return uint256(fromB(pairfst(Neg.neg(Pair(B.F, B.T))))) ;
}
}
Error: sol-core compilation failed
Processing: test/examples/dispatch/miniERC20.json
Compiling to Hull...
Configuration is affected by the following files:
- cabal.project.local
Emitting hull for contract MiniERC20
Writing to output1.hull
Generating Yul...
Configuration is affected by the following files:
- cabal.project.local
yule: /home/ben/work/solcore/build/output1.hull:1294:34:
|
1294 | return dispatch_$impl$std.$impl$abi_decode$calldataLbytesJ_address_CalldataWordReader_address(decodable, pty, prdr)
| ^
unexpected '.'
expecting "assembly", "false", "fst", "function", "if", "in", "inl", "inr", "let", "match", "return", "revert", "snd", "true", '$', '(', '_', '{', '}', alphanumeric character, integer, or letter
CallStack (from HasCallStack):
error, called at src/Common/LightYear.hs:26:15 in sol-core-0.0.0.0-inplace:Common.LightYear
runMyParser', called at src/Common/LightYear.hs:21:22 in sol-core-0.0.0.0-inplace:Common.LightYear
runMyParser, called at src/Language/Hull/Parser.hs:30:24 in sol-core-0.0.0.0-inplace:Language.Hull.Parser
Error: yule generation failed
Processing: test/examples/dispatch/Revert.json
Compiling to Hull...
Configuration is affected by the following files:
- cabal.project.local
Emitting hull for contract Foo
Writing to output1.hull
Generating Yul...
Configuration is affected by the following files:
- cabal.project.local
yule: /home/ben/work/solcore/build/output1.hull:200:34:
|
200 | return dispatch_$impl$std.$impl$abi_encode$uint256(val)
| ^
unexpected '.'
expecting "assembly", "false", "fst", "function", "if", "in", "inl", "inr", "let", "match", "return", "revert", "snd", "true", '$', '(', '_', '{', '}', alphanumeric character, integer, or letter
CallStack (from HasCallStack):
error, called at src/Common/LightYear.hs:26:15 in sol-core-0.0.0.0-inplace:Common.LightYear
runMyParser', called at src/Common/LightYear.hs:21:22 in sol-core-0.0.0.0-inplace:Common.LightYear
runMyParser, called at src/Language/Hull/Parser.hs:30:24 in sol-core-0.0.0.0-inplace:Language.Hull.Parser
Error: yule generation failed
mbenke
requested changes
Feb 25, 2026
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
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.
This PR is a PoC for the new module/namespace system and focuses on language behavior and import/export semantics.
The current implementation keeps a transitional flattening bridge so existing passes continue to work. If this direction is accepted, I'll start refactoring to remove that bridge by introducing module-aware lookup in name resolution/type checking and then cleaning up related paths.
TODOs:
Module and Namespace System
1. Entry File and Import Roots
-f/--file.takeDirectory(entryFile)--include(colon-separated, default:std)2. Module Identity and File Mapping
import foo;resolves tofoo.solc.import foo.bar;resolves tofoo/bar.solc.3. Import Syntax and Semantics
Supported forms:
Behavior:
import M;andimport M as A;add qualifier-based access only.import M.{X, Y};imports selected exported names into unqualified scope.import M.{*};imports all exported names into unqualified scope.Validation rules:
import A as M; import B as M;).Data constructor selection detail:
{True}) brings its parent data type declaration too, but only with selected constructors.4. Export Syntax and Visibility
Supported forms:
Current enforcement:
export {*};exports all importable top-level declarations (except pragma/export declarations).5. Namespaces and Name Resolution
Duplicate checking is enforced separately for:
Unqualified lookup order:
import M.{...}/import M.{*}Module qualification:
import foo.bar;), prefix qualifiers are also registered for qualified access paths.6. Constructor Model
Current constructor model is type-qualified constructors, with dot shorthand support.
Bool.True,Option.Some).mod.Bool.True,alias.Bool.True).Dot shorthand:
7. Pragma Scope