13 ms·
Viper: a new programming language from Ethereum
- mlangdon 9y ago> Bounds and overflow checking, both on array accesses and on arithmetic I like that one. Anyone know any widely adopted languages that do this?
- bluejekyll 9y agoRust has support for both of these, though the arithmetic overflows are effectively opt-in. Rust does define exactly what happens in overflow situations, and allows you to use different functions for controlling overflow options in others.
- myhf 9y agoFortran
- porges 9y agoSwift C# has the ability to opt-into default checked arithmetic. I don't know of anyone that uses it...
- vikiomega9 9y agoSorry, I'm confused, does bounds checking mean index out of bounds? If so, most modern languages?
- Sean1708 9y agoI think the question was more about bounds checking on arithmetic, which most modern languages don't do by default.
- dbaupp 9y agoIt's a little glib, but Python 3 (and Ruby, I believe) both has checked array access and vacuously has overflow checking given integers can't overflow (by default).
- TeMPOraL 9y agoAda?
- audunw 9y agoNim, but you can turn it off if you want
- audunw 9y agoNim, but you can turn it off if you want
- masklinn 9y agoSeems to be at runtime so, so almost every language for bounds checking. Overflow checking is a bit more rare: * Swift has it by default (error) * So do Python, Ruby, Erlang (promotion to arbitrary precision) * C# has an optional Checked Context though I don't know how common it is * Rust has checked operations (opt-in, both error and saturating), will check (error) by default in debug mode, it can optionally check (error) in release mode
- weavie 9y agoIdris has compile time bounds checking. It is a pretty special case though, you have to jump through a number of hoops using dependent types to get it.
- masklinn 9y ago> Idris has compile time bounds checking. Indeed it does, but I'm guessing it doesn't come close to qualifying for "widely adopted language", my list is already stretching it.
- haldean 9y agoBoth GCC and Clang have an extension to C that provide __builtin_xxx_overflow methods: GCC: https://gcc.gnu.org/onlinedocs/gcc/Integer-Overflow-Builtins.html https://gcc.gnu.org/onlinedocs/gcc/Integer-Overflow-Builtins... clang: https://clang.llvm.org/docs/LanguageExtensions.html#checked-arithmetic-builtins https://clang.llvm.org/docs/LanguageExtensions.html#checked-...
- oconnor0 9y agoDecidability. :) I'd love to see that show up in more languages. I believe it allows for better abstractions without optimization deficiencies because it's all decidable.
- simcop2387 9y agoThe big problem with that is that if a language is decidable it can't be Turing complete. That means that a large number of useful programs are just not going to be expressible. That said for something g like this it's a perfect fit to have it be decidable.
- chowells 9y agoThere are no useful programs that require Turing completeness. That's basically by definition. Turing completeness is what allows programs to have non-productive infinite loops. Any system that guarantees productivity isn't Turing complete. All useful algorithms are productive. The only thing you can do with a non-productive algorithm is convert electricity to heat.
- saghm 9y agoI took a course in college where we used Coq to build up an imperative programming language, and I waa surprised how much you could do (i.e. essentially anything you needed to) with a non-Turing complete language. I think that the traditional computer science curriculum makes such a big deal about Turing machines (and not necessarily wrongly so) that students just assume that Turning completeness is a natural goal to strive for rather than just a property with tradeoffs, just like any other property. It certainly doesn't help that it seems harder to create a language that's not Turing complete than one that is, at least if you aren't explicitly trying to avoid it; just look at all the random things that have been discovered to be accidentally Turing complete over the years.
- deleted 9y ago[deleted]
- avaer 9y ago
- deleted 9y ago[deleted]
- DonbunEf7 9y agoStop. Read http://www.erights.org/talks/promises/paper/tgc05.pdf http://www.erights.org/talks/promises/paper/tgc05.pdf. Then start again.
- jpolitz 9y agoIs there a particular piece of insight from that paper that indicates a mistake in the design of Viper? I love erights' work and don't doubt that there is a lot to be learned from it in this context, but some guidance on how to apply it here would help.
- DonbunEf7 9y agoThe DAO attack was plan interference. Absorb and grok that idea, and then the rest will hopefully follow. Specifically, Viper has two glaring flaws, both of which are not suffered by E, Monte, etc. The first is a lack of correct encapsulation. Viper appears to have a Python-style object model, which means that it's not possible to closely hold a value. As a test, how would you build an object with a value in its closure which no other object can access? Second, Viper doesn't have mitigation for plan interference, which means that it's possible for certain kinds of recurrences to alter your program's security guarantees. As a test, how would you mitigate the DAO attack in Viper? Finally, I fear that these flaws may be inherent to Ethereum, meaning that any language on Ethereum inherits these flaws structurally and cannot mitigate them. In that case, maybe it's time to design a capability-safe Ethereum!
- abecedarius 9y agoIndeed, in the (pre-DAO) Ethereum audit report https://github.com/LeastAuthority/ethereum-analyses/blob/master/GasEcon.md#hazards https://github.com/LeastAuthority/ethereum-analyses/blob/mas... they brought up your second issue and recommended Mark Miller's thesis (which covers the material in the OP). I haven't looked into Viper and how it might address these matters.
- lowglow 9y agoCan you give me some context on the paper here?
- lj3 9y ago> Requires python3 o_O twitch
- saghm 9y agoDoes it bother you that it requires Python3 specifically, or just Python at all? (I can empathize with not wanting to use a language that's implemented in Python, although if I had to, I'd probably prefer it was Python3)
- lj3 9y agoThe latter. It just seems wrong for a language to require python just to install.
- saghm 9y agoNot only that, but I assume it needs it to run as well, since it seems to be implemented in Python.
- tom_mellior 9y agoPackages currently installed on my system that depend on Python (2 and 3, respectively) and don't have "Python" in their name: calibre calibre-bin clang-format-3.8 creduce duplicity gimp gvfs-backends inkscape libatk-bridge2.0-dev libatk1.0-dev libatspi2.0-dev libcairo2-dev libgail-dev libgdk-pixbuf2.0-dev libglib2.0-dev libgnomecanvas2-dev libgtk-3-dev libgtk2.0-dev libgtksourceview-3.0-dev libgtksourceview2.0-dev libpango1.0-dev libsmbclient mercurial mercurial-common prosper rubber samba-libs texlive-latex-extra texlive-pictures texlive-pstricks virtualbox virtualbox-qt virtualenv-clone virtualenvwrapper vlc-plugin-samba aisleriot apparmor apport apport-gtk aptdaemon apturl apturl-common checkbox-converged checkbox-gui command-not-found compiz compiz-gnome dh-python firefox foomatic-db-compressed-ppds gconf2 gedit gir1.2-ibus-1.0 gnome-menus gnome-orca gnome-software gnome-terminal hplip hplip-data ibus ibus-table inkscape language-selector-common language-selector-gnome libbonoboui2-0 libgnome-2-0 libgnome2-0 libgnome2-bin libgnome2-common libgnomeui-0 libgnomevfs2-0 libgnomevfs2-common libgnomevfs2-extra lsb-release nautilus-share onboard onboard-data openprinting-ppds plainbox-provider-checkbox plainbox-provider-resource-generic plymouth-theme-ubuntu-text printer-driver-foo2zjs printer-driver-foo2zjs-common printer-driver-postscript-hp printer-driver-ptouch printer-driver-pxljr qml-module-io-thp-pyotherside rhythmbox rhythmbox-plugin-zeitgeist rhythmbox-plugins sessioninstaller snap-confine snapd software-properties-common software-properties-gtk system-config-printer-common system-config-printer-gnome system-config-printer-udev totem-plugins ubuntu-core-launcher ubuntu-desktop ubuntu-drivers-common ubuntu-minimal ubuntu-release-upgrader-core ubuntu-release-upgrader-gtk ubuntu-software ubuntu-standard ubuntu-system-service ufw unattended-upgrades unity unity-control-center unity-control-center-signon unity-lens-photos unity-scope-calculator unity-scope-chromiumbookmarks unity-scope-colourlovers unity-scope-devhelp unity-scope-firefoxbookmarks unity-scope-gdrive unity-scope-home unity-scope-manpages unity-scope-openclipart unity-scope-texdoc unity-scope-tomboy unity-scope-virtualbox unity-scope-yelp unity-scope-zotero unity-webapps-common update-manager update-manager-core update-notifier update-notifier-common usb-creator-common usb-creator-gtk Your mileage may vary, but the prospect of a Python-less system doesn't appear tantalizingly close :-) On the other hand, this language seems to take a subset of Python's syntax and interpret it with different semantics. I find that both theoretically neat and pragmatically smart. Making up a new syntax and writing a reliable parser is boring busywork that takes time better invested elsewhere.
- aqsheehy 9y agoWhat are some non-speculative use cases for ethereum that wouldn't be better served by just using aws?
- Moshe_Silnorin 9y agoI can't think of one that doesn't involve flouting regulations. Though we have truly awful regulations. Prediction markets are the only reason I am interested.
- aqsheehy 9y agoWhat inefficiencies are closed by using ethereum for prediction markets?
- flyGuyOnTheSly 9y agoHaving to pay for taxes, employees, hosting, ddos protection, lawyers, etc.
- tudorconstantin 9y agoYour app does not rely on a counterparty anymore. You have access to the blockchain, you have access to the prediction market. Think of all the countries where prediction markets (aka betting) is forbidden. Of course, this is not exclusive to ethereum, but they seem to be the blockchain which is both highly adopted and the one with the most features (I think they'll be the first to offer a turing complete language for programming smart contracts)
- aqsheehy 9y agoYou need an oracle for prediction markets to function. Voting on the truth doesn't work, you will be sybil attacked into oblivion. Is there an oracle present in these contracts? If there is, why wouldn't basic multi-sig work just as well?
- 9y ago
- RichardHeart 9y agoCan a blockchain project suffer from scope creep, if so, what would that look like? I have to imagine that you don't have to invent a new language for writing safe code (which in my noob mind, I think this is.) Maybe pick up where some other safety oriented languages already are. If security is the goal, is their path equal to this path: https://en.wikipedia.org/wiki/Formal_verification https://en.wikipedia.org/wiki/Formal_verification . I can't imagine so, for they're making a new language? It could be that they're making it a little safer, and a little easier, but not really too much safer. The features are described, and they look mostly like security?
- whiskers08xmt 9y agoI think both security and productivity is thought about. Having a domain specific language, built with block chain deployment in mind, is definitely useful.
- lmm 9y agoYou might find https://publications.lib.chalmers.se/records/fulltext/234939/234939.pdf https://publications.lib.chalmers.se/records/fulltext/234939... interesting.
- SkyMarshal 9y ago> wei_value: an amount of wei What is wei? Another name for gas?
- mbrock 9y agoIt's the name for the smallest unit of ETH value.
- RexetBlell 9y ago10^18 wei = 1 Ether. You need Ether to buy gas.
- deleted 9y ago[deleted]
- mycall 9y agoIs Viper Turing complete? If so, is that a mistake? Bitcoin Script specifically is not.
- RcouF1uZ4gsC 9y agoAs a bonus, it wraps all transactions in the VIP monad, where if you are an important person in Ethereum, you can get your poorly written contracts reversed. Sorry, since the DAO fiasco I don't see Ethereum having any purpose. If a poorly written/unfair contract should be invalidated, I would rather have e the judicial system with hundreds of years of jurisprudence make that decision, than a few people at Ethereum.
- runeks 9y ago> Sorry, since the DAO fiasco I don't see Ethereum having any purpose. From the point of view of speculators in Ethers, the purpose of Ethereum's continued existence is to avoid losing money. Exactly the same motivation that caused them to redefine the core protocol, in order to accommodate those who invested in a badly written contract. Also, to be fair, Ethereum Classic still exists. Just because some couldn't accept reality doesn't mean the benefits of a Turing-complete blockchain are gone.
- drdeca 9y agoYou'll note that the language in question is designed with an emphasis on guaranteeing program correctness in certain respects. You should also be aware that Ethereum Classic did not implement the DAO hack fork and continues to be used, and that this language should work just as well there. Not to say that this language is known to not have important bugs (idk), but, y'know, it is definitely work towards contract safety.
- vvillena 9y agoThe DAO contract was not invalidated. It is still there, on the blocks where it was deployed. The fact that the people running the nodes stopped seeing that fork of the chain as the interesting one is distributed consensus at work. Anyone that wants to keep observing that original fork can do so, that fork is actually alive in the form of Ethereum Classic. Ethereum was forked after the DAO fail because people saw more value in a forked chain with new rules. Speaking about contract reversals or invalidations is misleading. That is simply not possible, because Blockchain. And while anyone can decide to fork a blockchain, building consensus around the fork is what gives it its value. The DAO was a marketing horror because it promised a world ruled by code, built on top of blockchain tech. Blockchains, though, don't run on code but on consensus.
- toolslive 9y agofor max confusion, there also used to be a programming language called vyper. http://lambda-the-ultimate.org/classic/message1064.html http://lambda-the-ultimate.org/classic/message1064.html
- Temasik 9y agoEthereum or Ethereum Classic?
- kim0 9y agoHow ready is this now to write real beta quality contracts in? I'm just starting, should i pick this over solidity ?