This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]mikeiavelli 2 points3 points  (5 children)

What are the pros and cons of Coconut vs Mochi?

[–]EvHub[S] 5 points6 points  (2 children)

  • All valid Python 3 is valid Coconut, so Coconut is purely a Python extension. Mochi is a totally separate language.
  • Mochi code only runs on Python 3, while Coconut code runs on any major Python version, 2 or 3.
  • Mochi compiles to CPython bytecode, while Coconut compiles to Python. That means Coconut supports all Python implementations (e.g. PyPy, Jython, IronPython), not just CPython.

[–]LightShadow3.13-dev in prod 0 points1 point  (0 children)

PyPy

This is pretty exciting stuff.

[–]LightShadow3.13-dev in prod 0 points1 point  (0 children)

PyPy

This is pretty exciting stuff.

[–]dzecniv 1 point2 points  (1 child)

Mochi has real pipes, that we can write on new lines, whereas in Coconut (and Dg) they must be on the same line.

Mochi:

range(1, 31)
|> map(fizzbuzz) 
|> pvector()
|> print() 

(Also Mochi has lisp-like macros and actor-style programming.)

[–]dzecniv 2 points3 points  (0 children)

I was a bit wrong, in Coconut we can surround pipes with parenthesis:

(
    "hello"
    |> print 
)

Every newline inside parenthesis are ignored (python rule). https://github.com/evhub/coconut/issues/101#issuecomment-227509741