pyjs - a compiler from Python to JavaScript

134 views
Skip to first unread message

Uri Even-Chen

unread,
Aug 7, 2015, 7:01:33 AM8/7/15
to django...@googlegroups.com
To Django users,

Are you familiar with pyjs? I saw the website and I see that the latest stable release is from May 2012. Is it possible to use pyjs to compile Python to JavaScript? Which versions of Python are supported? Are versions 2.7 and 3.4 supported? And is it possible to use Django (in the client side) and JavaScript frameworks such as jQuery, jQuery UI and jQuery plugins together with pyjs?

Thanks,

Russell Keith-Magee

unread,
Aug 7, 2015, 9:19:24 PM8/7/15
to Django Users
Hi Uri,

There are multiple projects out there trying to bridge the gap between Python and Javascript. PyJS was one of the first I was aware of, but to the best of my knowledge, it hasn't been very active for the last couple of years. Brython and Skulpt are two other projects - those two *have* been kept up to date. There's also PyPy.js, which is the full PyPy interpreter running in browser - which means you get CPython like performance inside your browser. 

Are they ready for production? That's another story. At the moment, I wouldn't recommend it, especially if you're a beginner - but it's certainly possible. However, you'd need to have a pretty good reason. You're going to experience a lot of friction in the interface between the two languages, so there would need to be a good reason for taking on that overhead.

Yours,
Russ Magee %-)

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAMQ2MsHy4hwdxgZ8uXo36LtZrKZC_0GgjsGybcdbwpAP14AN5g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Uri Even-Chen

unread,
Aug 8, 2015, 3:41:39 AM8/8/15
to django...@googlegroups.com
Hi Russ,

Thanks for the information. Yes, I'm looking for software that is ready for production, or at least works well in most platforms. I also know JavaScript, but I was thinking about programming in Python for the client side too. I will check the projects you mentioned, thank you!

Uri Even-Chen

unread,
Aug 8, 2015, 4:28:36 AM8/8/15
to django...@googlegroups.com, Russell Keith-Magee
Hi Russ,

I checked the projects you mentioned, but is it possible to communicate with other JavaScript scripts such as jQuery, jQuery UI and plugins for jQuery? I would like to have a way to communicate from Python to JavaScript in the client side, otherwise I really think we will not be able to use these projects in production.

Thanks,
On Sat, Aug 8, 2015 at 4:18 AM, Russell Keith-Magee <rus...@keith-magee.com> wrote:

Robert

unread,
Aug 8, 2015, 9:31:25 AM8/8/15
to django...@googlegroups.com


On 8/7/2015 7:00 AM, Uri Even-Chen wrote:
To Django users,

Are you familiar with pyjs? I saw the website and I see that the latest stable release is from May 2012. Is it possible to use pyjs to compile Python to JavaScript? Which versions of Python are supported? Are versions 2.7 and 3.4 supported? And is it possible to use Django (in the client side) and JavaScript frameworks such as jQuery, jQuery UI and jQuery plugins together with pyjs?

Thanks,
Uri.


Hi,

I tried to test it recently, and found that some of the examples don't even work.  That's as far as I got, which is too bad, cause I really don't like Javascript.

Robert

Russell Keith-Magee

unread,
Aug 8, 2015, 9:06:03 PM8/8/15
to Uri Even-Chen, Django Users
On Sat, Aug 8, 2015 at 4:27 PM, Uri Even-Chen <u...@speedy.net> wrote:
Hi Russ,

I checked the projects you mentioned, but is it possible to communicate with other JavaScript scripts such as jQuery, jQuery UI and plugins for jQuery? I would like to have a way to communicate from Python to JavaScript in the client side, otherwise I really think we will not be able to use these projects in production.

Hi Uri,

It's possible - but it depends on the project and the tooling they provide. I know PyPy.js, for example, provides a JS/DOM bridge. 

However, as I said in my last email, at the moment, this isn't the easy path. Essentially, if you're asking the question "Is it possible", the answer for all practical purposes is effectively "no". Technically, it's possible, but you have to know what you're doing.

Yours
Russ Magee %-)

Uri Even-Chen

unread,
Aug 11, 2015, 7:45:38 AM8/11/15
to Russell Keith-Magee, Django Users
Thank you Russ. If it's not possible to do it easily in production then I guess we are stuck with JavaScript, although I prefer Python. But without jQuery, jQuery UI and other jQuery plugins I find it very difficult to write client side scripts in Python. So I think we will write client side scripts in JavaScript in Speedy Mail Software and other projects we will have.

Uri Even-Chen

unread,
Aug 11, 2015, 7:56:29 AM8/11/15
to Billy Earney, Ian Kelly, Python, Russell Keith-Magee, django...@googlegroups.com, speedy-mai...@googlegroups.com
Thanks for the feedback. Actually I asked this question also in the django-users mailing list and Russell Keith-Magee told me about Brython, Skulpt and PyPy.js (I hope it's OK that I reply to these 3 mailing lists) but I also asked if I can use JavaScript scripts such as jQuery, jQuery UI and other jQuery plugins from the scripts in Python and Russell said it's possible but not practical for production. And I'm thinking about developing Speedy Mail Software or other projects for production (of course after the alpha & beta are over) so I guess we are stuck with JavaScript for the client side programming. And I don't mind if they use a compiler or an interpreter or any other method to run Python in the client side, as long as it works. But without using jQuery and other plugins it would be very hard to use these projects in production.

On Mon, Aug 10, 2015 at 7:40 PM, Ian Kelly <ian.g...@gmail.com> wrote:
On Fri, Aug 7, 2015 at 5:00 AM, Uri Even-Chen <u...@speedy.net> wrote:
>
> Are you familiar with pyjs? I saw the website and I see that the latest stable release is from May 2012. Is it possible to use pyjs to compile Python to JavaScript? Which versions of Python are supported? Are versions 2.7 and 3.4 supported? And is it possible to use Django (in the client side) and JavaScript frameworks such as jQuery, jQuery UI and jQuery plugins together with pyjs?

And if you check the commit history on GitHub, there are only two
commits in the past year. The project was hijacked (i.e. forked plus
"we're taking the domain name and the mailing list too") a few years
ago (also in May 2012, I think not coincidentally), and that sadly
seems to have slowly killed the development momentum on the project.

I'm not really familiar with the space, but I tend to hear good things
about Brython. PyPy.js and Skulpt are other alternatives. However, I
think that all of these are implementations of Python in Javascript,
not Python to Javascript compilers.
--
https://mail.python.org/mailman/listinfo/python-list

Uri Even-Chen

unread,
Aug 11, 2015, 2:49:19 PM8/11/15
to Fabio Zadrozny, Billy Earney, Ian Kelly, Python, django...@googlegroups.com, Russell Keith-Magee, speedy-mai...@googlegroups.com
Thanks Fabio, it's very interesting. Are you related to Pyjeon Software? Do we have to pay to use RapydScript? Is it ready for production?

On Tue, Aug 11, 2015 at 8:54 PM, Fabio Zadrozny <fab...@gmail.com> wrote:

On Tue, Aug 11, 2015 at 8:55 AM, Uri Even-Chen <u...@speedy.net> wrote:
Thanks for the feedback. Actually I asked this question also in the django-users mailing list and Russell Keith-Magee told me about Brython, Skulpt and PyPy.js (I hope it's OK that I reply to these 3 mailing lists) but I also asked if I can use JavaScript scripts such as jQuery, jQuery UI and other jQuery plugins from the scripts in Python and Russell said it's possible but not practical for production. And I'm thinking about developing Speedy Mail Software or other projects for production (of course after the alpha & beta are over) so I guess we are stuck with JavaScript for the client side programming. And I don't mind if they use a compiler or an interpreter or any other method to run Python in the client side, as long as it works. But without using jQuery and other plugins it would be very hard to use these projects in production.

Uri.



​I think that you could try RapydScript: http://rapydscript.pyjeon.com/

Cheers,

Fabio


Uri Even-Chen

unread,
Aug 11, 2015, 3:22:49 PM8/11/15
to Fabio Zadrozny, Billy Earney, Ian Kelly, Python, django...@googlegroups.com, Russell Keith-Magee, speedy-mai...@googlegroups.com
Thanks Fabio, we'll check RapydScript and we might use it for Speedy Mail Software as well! I will check with the other developers (which are on the speedy-mail-software list). In the past I had Speedy Mail online from 2000 to 2005 and it was based on a Perl script (Perl was popular in 2000). But since it didn't support Unicode/UTF-8 encoding and didn't have a spam filter I decided to close it in 2005 (after Google introduced Gmail). But I think today it's easier to create software than it was in 2005, and I hope next year we can launch Speedy Mail again, based on the Speedy Mail Software we are developing (which will be free software & open source). I'm looking forward to launching Speedy Mail as an alternative to Gmail.

On Tue, Aug 11, 2015 at 10:08 PM, Fabio Zadrozny <fab...@gmail.com> wrote:
Hi Uri,

No, I'm not related to it. -- I'm the PyDev/Eclipse maintainer... that already takes a lot of my time ;)

It's license is BSD (so, no need to pay). As it's just a way to convert from a Python-like syntax to JavaScript syntax you can even switch to plain JavaScript later on if you want -- in fact, when you debug the code you'll be debugging JavaScript and not Python (it's like CoffeScript but with a Python-like syntax).

Cheers,

Fabio
Reply all
Reply to author
Forward
0 new messages