3 ms·
I'm still aghast that "smart contracts" are procedural programs. No wonder a lot of bugs derive from them. Contracts are functional, being procedural should be
by raverbashing 9y ago
I'm still aghast that "smart contracts" are procedural programs. No wonder a lot of bugs derive from them.
Contracts are functional, being procedural should be the exception.
They should be functional, scoped, limited (by the VM inclusive), testable.
- gus_massa 9y agoIn this case, the problem was that the function to self destroy the contract didn't have the flag "OnlyTheOwnerCanCallMe" or something like that. A functional program wont save you of missing flags.
- davesque 9y agoThe Ethereum VM accepts opcodes like any other modern computing platform. There's a lot of work going into formal verification of contract code. There's nothing in principle that prevents compilation of smart contracts into VM code via a formally verified compiler that implements a functional language.
- KirinDave 9y agoExcept the majority of the Ethereum community being ideologically opposed...
- mbrock 9y agoWhat do you mean?
- DennisP 9y agoI'm an Ethereum smart contract dev/auditor and active in the community. I'm not aware of any ideological opposition to more functional or verifiable languages. In fact, there are several new languages in development to move things in that direction, including Vyper (originally designed by Vitalik) and Bamboo (designed by the person employed by the EF to work on formal verification).
- KirinDave 9y agoMy experience proposing actual use of these has been met with complaint and actual jeers in social circles. Further, it's pretty depressing that you suggest Vyper and Bamboo actually offer more formal verification or even correctness. I don't see either trying to adopt approaches more like Simplicity.
- KirinDave 9y agoWhile I'd also prefer something with more verifiable and with more expressive power as well, it's pretty wrong to suggest that "procedural" is somehow not what will come of any code that relies on OO. Monads sequence code too. And while I think most smart contract languages are bug-ridden disasterpieces, it IS possible to test them thoroughly. The problem is that most folks in the blockchain space, particularly contract author's, simply have no experience dealing with the difficulties of distributed, public facing systems. We see these problems over and over again.
- mbrock 9y agoSmart contracts are state transition systems. Whether you write them in a "functional" or "procedural" style is more or less a superficial syntactic question. There's a lot of hot air being blown about pure functional programming for smart contracts as a way to somehow solve all logical bugs, which is nonsense.
- raverbashing 9y agoOf course it won't solve all bugs, but it's easier to specify a series of conditions as a functional description rather than writing a stack vm program.
- mbrock 9y agoYou seem to be comparing a high-level functional language to a low-level bytecode. I don't think it's easier to specify a series of conditions in a functional language than in an imperative language, generally speaking.