Juvix: Haskell-to-Michelson source transpiler for writing smart contracts

Very interested in the Tezos project; compelling long-term vision and promising technical progress so far.

I think quite a lot of progress can be made from Ethereum / competitors in terms of smart-contract language development. Michelson is already a step forwards security-wise, but I think it may be difficult for developers to reason directly in, and while the stack type-checking prevents many kinds of execution errors, it doesn’t provide the same ability for the programmer to ensure particular invariants that a full typesystem would.

To this end, I’ve written up a proof-of-concept Haskell-to-Michelson transpiler - Juvix - https://github.com/cwgoes/juvix. Juvix allows you, the smart contract developer, to write smart contracts in the existing Haskell language, using the Haskell typesystem and frontend syntax, which are then transpiled through GHC Core into Michelson code which can be executed on the Tezos blockchain.

Please see the README for further explanation and usage information. This is a proof-of-concept release - the basic architecture is in-place, and demonstrative examples work, but some implementation is only partially completed (algebraic datatypes, some case statements).

Download Juvix, play around with a Haskell smart contract or two - I’m glad to help with any bugs, but I’m more interested in what you think of the concept in general: advantages/disadvantages of Haskell as a frontend language, putting side effects in the IO monad, suitability of the Haskell typesystem, etc. See further discussions of architecture, examples, and a potential future roadmap.

5 Likes

Will be presented tonight at the Tezos NYC meetup; hope to see you there!

Slide deck for anyone interested: http://slides.com/cwgoes/juvix-tezos-nyc-deck

1 Like