-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add initial ULM hook implementation #26
Conversation
a89138a
to
56107a3
Compare
1c11f3c
to
cdfa557
Compare
|
||
```k | ||
rule <k> PGM:PgmEncoding => . </k> | ||
<entry> FUNCNAME </entry> |
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.
FUNCNAME does not seem to be used anywhere, so I guess it generates a kompile warning. Could you remove it?
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.
I see that you are using it in the other PR, so I guess it's fine to not remove it. However, the question above about whether the 'entry' cell with $WASM
in it is a good idea is still valid.
<k> $PGM:PgmEncoding </k> | ||
<wasm/> | ||
<create> $CREATE:Bool </create> | ||
<entry> $WASM:String </entry> |
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.
How do you plan to use this entry cell?
Also, In the "remote" case, my guess is that the $WASM
variable will not be set. If that's the case, I'm not sure what it means - will it have a default string value, or will execution fail?
|
||
```k | ||
rule <k> PGM:PgmEncoding => . </k> | ||
<entry> FUNCNAME </entry> |
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.
I see that you are using it in the other PR, so I guess it's fine to not remove it. However, the question above about whether the 'entry' cell with $WASM
in it is a good idea is still valid.
<status> Status:Int </status> | ||
|
||
rule getGasLeft(_) => #getGasLeft() | ||
rule getOutput(_) => #getOutput() |
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.
I'm not convinced that this will actually work in ULM, because ULM constructs a getOutput(configuration)
term and evaluates it. IIRC, if you have a function f(Something)
that uses the configuration (directly or indirectly) with the [[ ... ]]
syntax, then kompile transforms it into f(Something, GeneratedTopCell)
and silently passes the configuration as an argument. I.e., in the case above, the getOutput
function is actually compiled to getOutput(GeneratedTopCell, GeneratedTopCell)
, which is not what ULM expects.
I might be wrong here, @traiansf for confirmation.
Also see:
https://github.com/Pi-Squared-Inc/ulm/blob/main/kllvm/ulm_kllvm.cpp#L192-L197
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.
As discussed on Slack, it's fine to fix this in a follow-up PR.
This PR does several things:
ulm-wasm
Makefile target conditional on theULM_TEST
variable --- if this variable is set, a standalone binary will be built; otherwise, a ULM-integrated library will be builtulm-wasm.md
GAS
andCREATE
andENTRY
config variables toulm-wasm.md
ulm-wasm.md
tangle tags to conditionally build a ULM-integrated initial configuration vs. a standalone initial configuration