hyperledger-solang / solang

Solidity Compiler for Solana and Polkadot
https://solang.readthedocs.io/
Apache License 2.0
1.26k stars 210 forks source link

Add print functionality to Soroban contracts #1659

Closed salaheldinsoliman closed 2 weeks ago

salaheldinsoliman commented 2 months ago

This PR adds static string print functionality to Soroban contracts. This serves the following:

  1. print() statements
  2. Logging runtime errors.

However, the following findings might be interesting: In both Solana and Polkadot, the VM execution capacity can grasp a call to vector_new in the stdlib: https://github.com/hyperledger/solang/blob/06798cdeac6fd62ee98f5ae7da38f3af4933dc0f/stdlib/stdlib.c#L167

However, Soroban doesn't. That's why Soroban would need Solang to implement a more efficient way of printing dynamic strings. @leighmcculloch

salaheldinsoliman commented 3 weeks ago

@seanyoung Can I get a second look on this one?

seanyoung commented 2 weeks ago

LGTM, thank you!