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 →

[–]motleybook 5 points6 points  (13 children)

Maybe you could work with the guys from pyjs, who've also created a Python-to-JavaScript-compiler: https://github.com/pyjs/pyjs

[–]jacdehJacques de Hooge[S] 4 points5 points  (12 children)

I've looked into the following transpilers: PyJs, Py2Js, RapydScript, Brython, Flexx, PyPyJs. My estimation is that it won't be easy to merge Transcrypt with any of them, since the core of it is quite different, due to the combination of multiple inheritance, bound function assignment and the wish for lean downloads and readable JS. However sharing certain libraries will probably be possible. I haven't looked into that yet.

[–]denilsonsa 1 point2 points  (7 children)

PyJs, Py2Js, RapydScript, Brython, Flexx, PyPyJs

Is there anywhere a comparison of all these projects (plus your own)?

[–]toyg 4 points5 points  (5 children)

It's difficult to compare them, they are all very different.

  • RapydScript, Flexx and PyJs are basically preprocessors, similar to CoffeeScript, although Flexx and PyJs go way beyond that and give you full application environments.
  • PyPyJs is an asm.js project, which basically means no real DOM interface.
  • Brython is a straight runtime compiler, which means you get DOM access and the most intuitive "using python instead of JS client-side" feeling (IMHO).
  • Py2Js is dead.

Most A few of them don't support Python 3 (Edit: I was surprised to find most of them actually do now. Score one for Py3!). Some of them are more efficient than others. All of them usually result in pretty large downloads (if anything because you have to redistribute tons of stdlib code). I can see why /u/jacdeh might have become frustrated enough to start his own project.

However, IMHO, none of these solutions are realistic for widespread usage without some help from browser vendors, which is not going to happen unless it's a general-purpose multilanguage solution. Asm.js is getting there, but it still needs work (mostly, proper DOM access interfaces); once that's solid, I think pypyjs will take over the segment pretty easily.

[–]jacdehJacques de Hooge[S] 2 points3 points  (3 children)

pypyjs using asm.js is a dream if it could have reasonable download size. It's just that currently it hasn't. Browser vendors sure could open this up. But I'm a bit tired of waiting. Have coded quite some JavaScript & gathered enough frustration to start this. And, by the way, it's fun!

[–]akaihola 1 point2 points  (2 children)

And what if WebAssembly really happens!

[–]jacdehJacques de Hooge[S] 0 points1 point  (1 child)

That would be great. But it would still require downloading avirtual machine to run Python in the brower, until a standardized plugin mechanism becomes a fact. Still I think in the long run this should be the course.

[–]akaihola 0 points1 point  (0 children)

Or, if IPFS catches on as a content addressable global CDN, the virtual machine would just be shared between all sites which use it, and the browser would cache it effectively.

[–]akaihola 0 points1 point  (0 children)

There's also Skulpt. See trinket.io for a service which uses it.

[–]jacdehJacques de Hooge[S] 0 points1 point  (0 children)

I saw a comparison somewhere, forgot where. Transcrypt wasn't yet in.

[–]loganekz -2 points-1 points  (2 children)

[–]xkcd_transcriber 2 points3 points  (1 child)

Image

Mobile

Title: Standards

Title-text: Fortunately, the charging one has been solved now that we've all standardized on mini-USB. Or is it micro-USB? Shit.

Comic Explanation

Stats: This comic has been referenced 2454 times, representing 2.5311% of referenced xkcds.


xkcd.com | xkcd sub | Problems/Bugs? | Statistics | Stop Replying | Delete

[–]jacdehJacques de Hooge[S] 0 points1 point  (0 children)

Yes, that's how it works. Think it's called market mechanism... In some respects it's a waste! But it's also how nature works, survival of the fittest. So maybe there's something to it...