Vyper is a promising smart contract language focusing on simplicity and security with a lot of support as I will show.

Design

Vyper has minimal features to make code quickly understandable and easy to audit. This also makes formal verification easier. Problematic features like inheritance, overloading and recursion are not included. Here is a simple Vyper program showing some basic types and the similarity to Python:

dapp_address: public(address)

asset_name: public(bytes[64])

token_price: public(uint256) @public

def __init__(the_dapp_address: address,

the_asset_name: bytes[64],

the_token_price: uint256):

self.dapp_address = the_dapp_address

self.asset_name = the_asset_name

self.token_price = the_token_price def __init__(the_dapp_address: address,the_asset_name: bytes[64],the_token_price: uint256):self.dapp_address = the_dapp_addressself.asset_name = the_asset_nameself.token_price = the_token_price @public

@constant

def getDappAddress() -> address:

return self.dapp_address def getDappAddress() -> address:return self.dapp_address @public

@constant

def getAssetName() -> bytes[64]:

return self.asset_name def getAssetName() -> bytes[64]:return self.asset_name @public

@constant

def getTokenPrice() -> uint256:

return self.token_price def getTokenPrice() -> uint256:return self.token_price @public

@constant

def getClientAddress() -> address:

return msg.sender def getClientAddress() -> address:return msg.sender @public

@constant

def getBlockTimestamp() -> timestamp:

return block.timestamp def getBlockTimestamp() -> timestamp:return block.timestamp @public

@constant

def isEven(some_number: uint256) -> bool:

return (some_number % 2 == 0) def isEven(some_number: uint256) -> bool:return (some_number % 2 == 0)

Note that functions are private by default and that functions are made public with a Python decorator like syntax.

KVyper

Formally specifying the semantics of programming languages avoids many possible bugs. It is arguably true that all smart contract languages should be formally specified. The KVyper project is developing a formal specification for Vyper using the K Framework programming language design tools. Furthermore, the K Framework automatically generates conforming compilers from formal language specifications! Imagine formally verified smart contracts built with formally specified compilers. That is possible with Vyper.

Support

The Ethereum Foundation and many others organizations support Vyper. Vitalik Buterin and many other blockchain notables are fans of Vyper as well.

Conclusion

The simplicity and security of Vyper may make it the right tool for many smart contract applications. Its agreeableness with formal methods is also promising. The smart design and wide support Vyper enjoys should continue to ensure a bright future.

Feedback

Feel free to leave any comments or questions below. You can also contact me by email at cs@etcplanet.org or by clicking any of these icons:

Acknowledgements

I would like to thank IOHK (Input Output Hong Kong) for funding this effort.

License

This work is licensed under the Creative Commons Attribution ShareAlike 4.0 International License.