Brython production ready?

237 views
Skip to first unread message

João Ventura

unread,
Oct 21, 2014, 12:02:58 PM10/21/14
to bry...@googlegroups.com
Hi there,

I'm currently in a crossroad where I have to choose wether I port a Python package of mine to javascript or go with Brython. Javascript developer tools suck big time (import system is terrible, must use requirejs, etc.) and I am too much used to the Python ecosystem.

Also, speed is of moderately concern because it is a numeric library, although it is not number crunching. I just want my customers to have a good user experience, and that also means fast loading and usage on the browser.

Is anyone using Brython in a moderate complexity webapp? Is it ready for prime time in production? I plan to grow this application of mine for some years into the future, and I don't want to see Brython disappear and I be left dependent of an unsupported project..


Thanks,
João Ventura

Billy Earney

unread,
Oct 21, 2014, 2:26:11 PM10/21/14
to bry...@googlegroups.com

See pyschool.net.  this actually uses a combination of brython, jeasyui, jquery. 

I would recommend to start with brython, find the bottle necks and write those portions in javascript.  Brython can access javascript code, so only convert to js what you really need to.

--
You received this message because you are subscribed to the Google Groups "brython" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brython+u...@googlegroups.com.
To post to this group, send email to bry...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/brython/67eef6d2-ab08-4c50-8109-5db310d54d87%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

João Ventura

unread,
Oct 21, 2014, 3:56:46 PM10/21/14
to bry...@googlegroups.com
Hi Billy,

that sounds like a reasonable approach, yes!

But since I'm implementing a library, eventually I would like to use javascript to interface with it. Is it possible to call Brython functions from javascript? If is not a common task, how hard would it be to make it so?


Thanks,
João Ventura

Billy Earney

unread,
Oct 21, 2014, 7:10:26 PM10/21/14
to bry...@googlegroups.com
Yes, calling brython functions from javascript is possible.  See http://reeborg.ca/index_en.html for some examples.  Andre first had his reeborg bot coded in javascript, but he also wanted to give people an opportunity to code in python.  He was able to use brython to make this happen without having to make a lot of modifications to his current code base.



--
You received this message because you are subscribed to the Google Groups "brython" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brython+u...@googlegroups.com.
To post to this group, send email to bry...@googlegroups.com.

João Ventura

unread,
Oct 23, 2014, 6:16:05 AM10/23/14
to bry...@googlegroups.com
Hi again Billy,

thanks for the indication. I've seen the example, it is a redirect of window['translate_python'] to a brython "call", very good indeed..

One more doubt I have, if you or anyone knows the answer: Brython's website initial page takes long time to start, essentially because of the imports. I know there are some "tricks" regarding py_vfs, although I still haven't searched that way. My question is if there is any plans regarding that route (improving imports)? For instance, cache the imported brython files locally in the browser (eg. using the local cache), or importing compressed python files (as zip).

Anything being discussed regarding optimizations at this (and others) level?


Thanks,
João Ventura

Billy Earney

unread,
Oct 23, 2014, 8:36:37 AM10/23/14
to bry...@googlegroups.com
Yes, I believe we are looking at optimizing imports, using some of the methods you brought up.   For pyschool.net,  I've created a custom_VFS so that personal modules can be placed in a py_VFS like file and can be searched via an import hook.   This isn't production ready yet, but should make its way into the brython repo real soon.

Billy

--
You received this message because you are subscribed to the Google Groups "brython" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brython+u...@googlegroups.com.
To post to this group, send email to bry...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages