tl;dr:
Try Solidity in your browser - don't expect it to be stable but please report bugs via github.
As Solidity comes closer and closer to a language that supports all features provided by the Ethereum virtual machine, I would like to get some feedback from the community about the language itself.
As some of you might have noticed already, the Solidity compiler is activated in AlethZero by entering some source code that starts with the word "contract", but probably it is more convenient to just try Solidity in your browser:
Browser-based Solidity compilerNote that the planned IDE will be different, this is only to be able to play with Solidity with prerequisites close to zero. One drawback of the browser interface is that you cannot execute or debug contracts, but you will get parse errors and the compiled bytecode. It is pre-filled with an example contract that should explain most of the features, otherwise please ask here or on IRC. It may be wise to disable the optimizer while writing (untick the "optimize" checkbox). Furthermore, the emscripten build is an unofficial build and will only be updated manually by me for now, so don't expect the latest features to be available from there.
The browser interface is powered by the wonderful project
emscripten, which compiles the Solidity compiler written in C++ to javascript, so that it can be used directly in the browser without a server-side backend.
Current limitations of Solidity (which will all be resolved in the future):
- no access to blockchain data (query balance, block number, etc.)
- no access to other contracts
- no way to send messages / transactions
- no constructor / init function
- no structs as local variables or function arguments, only the first return value can be accessed in local calls
- no real, string or text types (only uint*, int*, hash*, address and bool are supported)
- "const" is not enforced
- functions can fail to compile if expressions are too complex or if there are too many variables (access to only the topmost 16 stack element)
Have fun!
Comments
Also, constructors are called now.
I have explained what I tried in
https://forum.ethereum.org/discussion/3455/how-to-use-online-solidity-compiler?new=1
I see the following issue with the web3 output: As suggested by you for my debugging issues, it is currently not possible to catch error messages. Therefore I'd suggest adding another console.log in the generated js output, I added the second line below:
Thanks
How did you guys get console.log work? I added console.log such as console.log("debug"); to the sol contract file, it got lots of errors and with a final "> stdout", don't what that means. I am running solc version 0.4.18
Thank you