Support for line comments and docstrings in CLL?

jamtodayjamtoday San FranciscoMember Posts: 13
There has been some discussion about the user's ability to read and understand contracts. This is already very apparent with a relatively simple financial instrument or DAO contracts and will become more apparent with advanced contracts and a wider community.

I have noticed playing with http://multisig.info:3000/ that comments are sort-of supported at this time. They are not mentioned on the CLL page of the wiki (https://github.com/ethereum/wiki/wiki/[English]-CLL) or the whitepaper.

I would encourage both Python-style line comments and multiline comments. Clients could then automatically pull multiline comments at the top of a contract as documentation, or use conventions like using the line comment after a "stop" command as an error message.

The size of the comments shouldn't be a security concern if there is a hard size constraint on contract size. I can't think of too many additional downsides.

I can try to prepare a pull request for the CLL parser code, but wanted to solicit feedback first.

Comments

  • jamtodayjamtoday San FranciscoMember Posts: 13
    Yes, I left out that I would at least propose that comments are free since they don't need to be computed. This actually makes them very useful for getting across any information that you wouldn't want to accumulate fees. If this is the case then it may be necessary to institute constraints on overall comment size per contract.
  • mids106mids106 Member Posts: 188 ✭✭✭
    Yeah, Go for it! The compiler should strip them out anyway. If people want to document their contracts they can publish the sourcecode outside of the blockchain.
Sign In or Register to comment.