metadata: {"type": "project", "title": "Vyper", "logoImg": "bafkreidebmi7kndhxvugqdbejh6f7gjewa2bena6m6zsqo6a77djl6gmty", "website": "https://github.com/vyperlang/vyper", "createdAt": 1694826022236, "userGithub": "PatrickAlphaC", "credentials": {}, "description": "Vyper is a contract-oriented, pythonic programming language that targets the Ethereum Virtual Machine (EVM).\n\nPrinciples and Goals\nSecurity: It should be possible and natural to build secure smart-contracts in Vyper.\n\nLanguage and compiler simplicity: The language and the compiler implementation should strive to be simple.\n\nAuditability: Vyper code should be maximally human-readable. Furthermore, it should be maximally difficult to write misleading code. Simplicity for the reader is more important than simplicity for the writer, and simplicity for readers with low prior experience with Vyper (and low prior experience with programming in general) is particularly important.\n\nBecause of this Vyper provides the following features:\n\nBounds and overflow checking: On array accesses and arithmetic.\n\nSupport for signed integers and decimal fixed point numbers\n\nDecidability: It is possible to compute a precise upper bound for the gas consumption of any Vyper function call.\n\nStrong typing\n\nSmall and understandable compiler code\n\nLimited support for pure functions: Anything marked constant is not allowed to change the state.\n\nFollowing the principles and goals, Vyper does not provide the following features:\n\nModifiers: For example in Solidity you can define a 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. Vyper 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.\n\nClass inheritance: Class inheritance requires people to jump between multiple files to understand what a program is doing, and requires people to understand the rules of precedence in case of conflicts (\u201cWhich class\u2019s function X is the one that\u2019s actually used?\u201d). Hence, it makes code too complicated to understand which negatively impacts auditability.\n\nInline assembly: Adding inline assembly would make it no longer possible to search for a variable name in order to find all instances where that variable is read or modified.\n\nFunction overloading: This can cause lots of confusion on which function is called at any given time. Thus it\u2019s easier to write missleading code (foo(\"hello\") logs \u201chello\u201d but foo(\"hello\", \"world\") steals your funds). Another problem with function overloading is that it makes the code much harder to search through as you have to keep track on which call refers to which function.\n\nOperator overloading: Operator overloading makes writing misleading code possible. For example + could be overloaded so that it executes commands that are not visible at a first glance, such as sending funds the user did not want to send.\n\nRecursive calling: Recursive calling makes it impossible to set an upper bound on gas limits, opening the door for gas limit attacks.\n\nInfinite-length loops: Similar to recursive calling, infinite-length loops make it impossible to set an upper bound on gas limits, opening the door for gas limit attacks.\n\nBinary fixed point: Decimal fixed point is better, because any decimal fixed point value written as a literal in code has an exact representation, whereas with binary fixed point approximations are often required (e.g. (0.2)10 = (0.001100110011\u2026)2, which needs to be truncated), leading to unintuitive results, e.g. in Python 0.3 + 0.3 + 0.3 + 0.1 != 1.\n\nVyper 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.", "logoImgData": {}, "projectGithub": "vyperlang", "projectTwitter": "vyperlang"}
name: Vyper