Mochi – Dynamically-typed language for functional and actor-style programming
github.com
github.com
(edit: damn autocorrect!)
Hy aims to be bidirectional. Swapping around data structures will mess with that. Hy doesn't want to be intrusive, you should really be able to tell when you use Hy code.
>>> import hy
None
>>> from foobar import test ;; Hy module
None
>>> test()
Test
None
>>>
EDIT:
From looking at the source, it look's like Mochi is actually a lisp, without the parens. Really neat.The one thing I didn't see, though: lambdas? Is it python syntax for those? Is there support for pattern matching inside of lambdas?
Edit: another user posted this link re: lambdas. https://github.com/i2y/mochi/blob/master/examples/bind.mochi
It recently reached 1.0 and is production ready: http://elixir-lang.org/
https://wiki.python.org/moin/Why%20is%20Python%20a%20dynamic...
* I prefer statically typed languages as a rule
* However, I do python at my job (which is not statically typed)
* there are many features which tend to be found in statically typed functional languages, which I would love to see in a dynamically typed, python-like language.
However, Python doesn't use Landin's off-side rule; colons are required, c.f. Haskell's usual syntax. Emacs works anyhow.
My only gripe is that unfortunately the reverse isn't true (you can't 'mochi' in python). I wonder how much could be achieved with a 'Dynamic functional programming for humans' type thing that stays pure python.
I would be interested to see some performance comparisons with regular Python.
Coffeescript is a transpiler. It converts its own code directly into javascript code. This project converts its code to AST, not Python code itself. You can generate the Python code off from the AST, but it dosnt always imply the resulting Python code is runable.
I believe this is incorrect. Can you show an example of a valid abstract syntax tree that could not be represented in the grammar of the original language?
A great example is with gensym, here we will make an ast.Name node with a prefix ":", if you run astor over this, you produce AST containing that very character. What happens if you try run this Python code? Syntax error. There is also a few other cases i can't think off right now.
What technical factors could prevent this from being used in production? (not right now, but in the future)
Even the macros look very similar. Surely this has drawn inspiration from Elixir.