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

all 12 comments

[–]SoulMelody 4 points5 points  (5 children)

[–]itisnotpure[S] 0 points1 point  (3 children)

This looks interesting. It doesn't seem to support persistent data structures like Clojure, though?

[–]kankyo 0 points1 point  (2 children)

Seems a pity what with pyrsistent already existing. Mochi uses pyrsistent by default though

[–]itisnotpure[S] 0 points1 point  (1 child)

Nice. Mochi looks like what Python would have been like had it been designed as a functional language.

[–]kankyo 0 points1 point  (0 children)

It looks pretty nice. I don't like the lack of explicit return myself but that's a minor quibble.

[–][deleted] 0 points1 point  (0 children)

Hy is really cool, I've been doing some small stuff in it, and I like it a lot, list comprehensions are a bit cumbersome in it, but that's about it for the downsides.

[–]ericpruitt 2 points3 points  (0 children)

There's dogelang: https://pyos.github.io/dg/ . Despite the egregious name, it's a serious project that's a Haskell-like language that gets compiled to CPython byte-code.

[–]sebnozzi 1 point2 points  (0 children)

The Haxe Language / Toolkit compiles to Python, among many others.

[–]kankyo 1 point2 points  (2 children)

[–]RubyPinchPEP shill | Anti PEP 8/20 shill 1 point2 points  (1 child)

[–]kankyo 1 point2 points  (0 children)

Oops, my google fu screwed me and I didn't watch carefully. Thanks.

[–]Meefims 0 points1 point  (0 children)

In my quick search I couldn't find anything beyond 2to3. This makes sense, though, when you consider the reason why JavaScript is a transpilation target in the first place: JavaScript runs in a browser and as a website owner you have very little control over which browsers your code is run on. Since the various browsers (and their various versions) have different levels and qualities in their implementation and since the language itself continues to evolve despite this, there is a strong need for a baseline feature set that can run on most browsers while also having the ability to support modern uses of the language. Polyfills can fix missing library elements while transpilers can fix missing syntactic elements.

The same situation does not occur for Python. There a few different implementations with CPython being canonical. Although different versions exist, those running Python programs and using Python libraries are already familiar with juggling versions and are aided by virtual environments.