Help us by sharing this thread on X
What time is it?
Time for the official release of Vyper 0.4.0!
BIG ROUND NUMBERS are reserved for more than just key resistance markers. The new release brings about several new features, including the much-anticipated module system…
The topline summary here is concise, masking a ton of work behind the scenes to bring the language to this state.
The implementation of VenomIR as a backend is particularly notable. For some background, the draft from the pull request:
Modules
In other words, Vyper 0.4.0 implements modules in perfectly Vypric fashion.
Code reuse through composition: Vyper supports code reuse through composition, and to help auditors, requires syntactic marking of dependencies which potentially modify state.
A snapshot of the level of thought that went into modules:
The resultant code snippet is crisp and elegant, showing off the primacy of snekmate, and usage of imports and exports:
A diff of one example file tweaked to Vyper 0.4.0:
A great guide for getting up and running using Vyper modules is up from pcaversaccio
The walkthrough shows off how to quickly get up and running importing snekmate’s elliptical curve library.
Vyper 0.3 → 0.4
To the relief of sneks everywhere, changes for the end user are minimal. The most common change in the examples/
folder is that __init__
functions are now decorated with @deploy
, not @external
, a logical change.
Structs get a more logical Pythonic structure in the new release
Enums are out… Flags are in…
Some language was changed to be more inclusive to bots
But overall, the ease of moving from Vyper 0.3 to 0.4 is even easier than 0.2 to 0.3.
Miscellanea
Some trivia about integer division
Integer division has different rounding semantics than Python for negative numbers: Vyper rounds towards zero, while Python rounds towards negative infinity. For example,
-1 // 2
will return-1
in Python, but0
in Vyper.
It’s unrelated to the Vyper 4 release, but if you missed it, using boa in Jupyter Notebook now allows browser wallet signing… a big deal for easing adoption among the academic and data science community onboard.
Vyper continues to improve rapidly, delivering an outstanding developer experience for top devs and beginners alike.
Everybody should give it a whirl.
While Vyper’s versioning guidelines may technically classify this as a “minor release,” it looks awfully major from our POV. Congrats to all involved!