-
Notifications
You must be signed in to change notification settings - Fork 6
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
Optional: Generalization to other languages #5
Comments
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Allowing all languages - fully trustless/decentralized
To enable users to write unit tests and solutions in all languages, one would like to enable the user to write and evaluate smart contracts in other languages and/or to write smart contracts that can evaluate other languages. This would be completely decentralized and trustless, the strongest form of the protocol, fully generalized. This is what we aim for. A drawback of this option is that it is relatively expensive to run unit tests a few million/billion times by everyone in the blockchain. Below are a few options listed that could be theoretically/potentially pursued to facilitate this solution/market.
EVM of Ethereum 1.0:
The EVM of Ethereum 1.0 already allows for a few languages, these are listed below. However, this is not the fully generalized option where anyone could straightforwardly submit a code in any language. E.g. a sponsor could not simply write Python unit tests and submit them, instead the sponsor would have to learn Viper and write their unit tests in Viper instead.
Yul
Solidity
Solidity Assembly
Yul+
Viper
Ewasm
The Ewasm of Ethereum 2.0 is extremely promising in this perspective, it allows almost all (practical) languages via the LLVM. A drawback is: it is not yet certain whether the Ewasm will actually make it to the Eth 2.0 implementation. Another concern voiced by the developers, is that it is more difficult for sponsors and bounty hunters to make safe contracts (spotify podcast). Templates provided by TruCol, and automated checks, could help guide the users to an increased level of safety. This project could greatly benefit from the Ewasm.
C
C++
Rust
JavaScript
Furthermore, it uses the LLVM compiler that supports the following languages:
ActionScript, Ada, C#, Common Lisp, Crystal, CUDA, D, Delphi, Dylan, Fortran, Graphical G, Halide, Haskell, Java bytecode, Julia, Kotlin, Lua, Objective-C, OpenCL, PostgreSQL's SQL and PLpgSQL, Ruby, Rust, Scala, Swift, Xojo and Zig.
Here is an overview of different hello world smart contracts for different languages on Ewasm. The answer shows solutions that are submitted to this competition to write Ewasm smart contracts in different languages, which has the pseudocode of the contract that is implemented in multiple languages.
Parity
The text was updated successfully, but these errors were encountered: