Name: vyper
Owner: ethereum
Description: New experimental programming language
Created: 2016-11-11 08:56:41.0
Updated: 2018-01-17 14:33:05.0
Pushed: 2018-01-16 22:38:52.0
Homepage: null
Size: 1117
Language: Python
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Viper is an experimental programming language that aims for some of the following goals:
Some examples of what Viper does NOT have and why:
function foo() mod1 { ... }
, where mod1
can be defined elsewhere in the code to include a check that is done before execution, a check that is done after execution, some state changes, or possibly other things. Viper does not have this, because it makes it too easy to write misleading code. mod1
just looks too innocuous for something that could add arbitrary pre-conditions, post-conditions or state changes. Also, it encourages people to write code where the execution jumps around the file, harming auditability. The usual use case for a modifier is something that performs a single check before execution of a program; our recommendation is to simply inline these checks as asserts.0.3 + 0.3 + 0.3 + 0.1 != 1
.Some changes that may be considered after Metropolis when STATICCALL becomes available include:
send(some_address, contract.do_something_and_return_a_weivalue())
, enforcing clear separation between “call to get a response” and “call to do something”.Viper does NOT strive to be a 100% replacement for everything that can be done in Solidity; it will deliberately forbid things or make things harder if it deems fit to do so for the goal of increasing security.
Note: Viper is still alpha software, use with care
See the Viper documentation for build instructions.
To compile a contract, use:
viper yourFileName.v.py
Note: Since .vy is not official a language supported by any syntax highlights or linter,
it is recommended to name your viper file into .v.py
to have a python highlights.
Alternative for GitHub syntax highlighting: Add a .gitattributes
file with the line *.vy linguist-language=Python
There is also an online compiler available you can use to experiment with
the language and compile to bytecode
and/or LLL
.
Note: While the viper version of the online compiler is updated on a regular basis it might be a bit behind the latest version found in the master branch of this repository.
python setup.py test
For testing strategy, please see Testing