Can I create a function in Serpent, LLL, or Mutant? When will it be implemented?

LukeDLukeD Member Posts: 23
edited May 2014 in Smart Contracts and Dapps
I haven't found any road map for the languages. I noticed that functions don't seem to be implemented in Serpent yet. When will they be implemented? Classes? Is there any way to hack them together at the moment? For instance, is there any way to use jump commands or inline EtherScript/EVM code?

Comments

  • JasperJasper Eindhoven, the NetherlandsMember Posts: 514 ✭✭✭
    Jump commands are dark arcane tools of evil to modern programmers.

    There are some languages but they dont do stuff like that. I dont think it is good to go that way, because contracts need to be very simple and very understandable. And running code on ethereum is very expensive relative to on your own computer.

    That said, I think essentially contracts themselves are functions. And i think you can go pretty far with that. I hope in the future msg(to_address, value, gas, datastart, datalen) if you just want to run a function you can do to_address(...arguments...), of course you'd use a name for the address, the function name. Maybe even formalize the first argument to ask for a particular 'member function'.
  • LukeDLukeD Member Posts: 23
    Ah OK. So you want us to program each function as a separate contract? I can see how that would maximize code reusability.

    Makes sense. Thank you.
  • JasperJasper Eindhoven, the NetherlandsMember Posts: 514 ✭✭✭
    There is currently still a nag in there in that each call needs to indicate how much gas is allowed. I expect probably this will be removed and have a system where only the transaction on the blockchain specifies how much gas to buy and contracts maybe buying more, but messages/callings never specifying it. That said, maybe they find another solution.
Sign In or Register to comment.