-
Notifications
You must be signed in to change notification settings - Fork 220
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 print functionality to Soroban contracts #1659
Add print functionality to Soroban contracts #1659
Conversation
fd5cdca
to
1b8aba0
Compare
535e648
to
2bbba8e
Compare
c656939
to
38dde1c
Compare
src/codegen/expression.rs
Outdated
loc, | ||
ty, | ||
size: _, | ||
initializer, |
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 should really be: initializer: Some(initializer),
src/lib.rs
Outdated
@@ -95,7 +95,7 @@ impl Target { | |||
|
|||
/// Size of a pointer in bits | |||
pub fn ptr_size(&self) -> u16 { | |||
if *self == Target::Solana { | |||
if *self == Target::Solana || *self == Target::Soroban { |
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 thought Soroban uses wasm which has 32 bit address space, unless it's wasm64
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.
Thanks, that was a typo
@seanyoung Can I get a second look on this one? |
.github/workflows/test.yml
Outdated
run: | | ||
export DBUS_SESSION_BUS_ADDRESS=/dev/null | ||
export NO_AT_BRIDGE=1 | ||
xvfb-run --auto-servernum --server-args="-screen 0 1920x1080x24" npm test -- --disable-gpu |
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.
These changes don't fix the issue of the vscode test not working. For some reason the tap package is not installed, it's not xvfb-run
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.
Let me just remove that and address it in a further PR then
LGTM, thank you! |
Signed-off-by: salaheldinsoliman <[email protected]>
d37c0af
to
f2695f1
Compare
This PR adds static string print functionality to Soroban contracts. This serves the following:
print()
statementsHowever, the following findings might be interesting:
In both Solana and Polkadot, the VM execution capacity can grasp a call to
vector_new
in thestdlib
: https://github.com/hyperledger/solang/blob/06798cdeac6fd62ee98f5ae7da38f3af4933dc0f/stdlib/stdlib.c#L167However, Soroban doesn't. That's why Soroban would need Solang to implement a more efficient way of printing dynamic strings.
@leighmcculloch