Solidity vs. idiomatic EcmaScript

pinoyyidpinoyyid Member Posts: 17
I'm finding that contract development is forcing me to abandon my familiar workflows and tooling. I get that Solidity pays homage to JavaScript syntax, which is cool, but that's only a small portion what goes into writing code. So I ran a thought experiment along the lines of "what if Solidity was in fact idiomatic ES6.5 and TypeScript".

contract NameReg

would become

class NameReg

This would give two huge benefits.

Firstly, I can use my existing development environment for both front-end and contract development. As things stand, I need two parallel environments, both of which need to talk to the client, which currently only supports a single CORS origin. If I could develop both in say WebStorm, that would allow me to use familiar tooling/keystrokes (I'm a vim-head), etc.

Secondly, it opens up the possibility of running the transpiled (or soon, native) code in an evm simulator under node.js A dev library would provide implementations to the ES7 decorators which in turn drive the emulator. This would make writing end2end tests very much simpler since the whole environment is simulated offline.

Clearly, Solidity isn't about to get rewritten, but I don't see it as a massive task to write an ES7 -> Solidity transpiler (s/@Contract class foo/contract foo/).

It may well be that there are equivalent dev environments out there that I'm not aware of. For example I only just learned of , so perhaps this is otiose.
Sign In or Register to comment.