Hi Benjamin,

A few more details to whet your appetite (because this is a thing I've been
*thinking* about, but don't have anything to show)

The biggest sticking point at the moment is getting Python on the client
side. I'm aware of many attempts:

 * Brython (http://www.brython.info) is an in-browser implementation of
Python 3
 * Skulpt (http://www.skulpt.org) is another in-browser implementation of
Python, but only supports Py2.6
 * PyPy.js (http://pypyjs.org/demo/) uses a clever intersection of PyPy,
emscripten and asm.js to *compile* CPython into JavaScript.
 * pyjs (http://pyjs.org) is a traditional transpiler. This project has
been around for a while (longer than Django), but it's a bit behind in it's
Python development - it supports most of Py 2.5, and some of Py 2.6.

PyPy.js is a technically interesting approach - for certain carefully
selected benchmarks, it's actually *faster* than native CPython on the same
machine [1]. There's are 2 *big* buts, though - the initial download size
is *huge* (20MB), and "faster" is heavily qualified by "after a JIT warmup".

Brython and Skulpt now the most "useful" at the moment, but they're both
650k and 450k downloads, respectively. That's a big chunk to require as a
download, especially over a mobile connection. Yes, it can be cached, but
first time visitors on slow connections are going to have a big lag.

pyjs takes the traditional transpiler approach, but it's also the least up
to date.

Another approach - and one I've experimented with - is to port a Python
bytecode interpreter to Javascript. This is a lot smaller than a full
Python interpreter, because you don't need to carry the parsing side of the
environment to the browser - you can rely on the server side to compile the
bytecode, and then ship that bytecode (which is available by introspection
to the running interpreter) directly to the browser. I got something
working (albeit very slow and inefficient) in around 20k.

I don't know how this compares to the Ruby world - but without a highly
efficient way of running Python in the browser, isomorphic web development
isn't an option.

However, assuming such an transpiling/execution option existed, I'd suggest
that it wouldn't be developed as part of the Django project itself - it
would be better suited as a third party tool - tightly integrated with
Django's components, but independently developed and maintained.

Yours,
Russ Magee %-)

[1] https://www.rfk.id.au/blog/entry/pypy-js-faster-than-cpython/

On Sun, Mar 15, 2015 at 7:25 AM, Tim Graham <[email protected]> wrote:

> I have not seen any discussion about such a thing.
>
> On Saturday, March 14, 2015 at 7:13:54 PM UTC-4, Benjamin Melki wrote:
>>
>> Hi are there any plans for isomorphic django version?
>> That runs python on both server and client (via transpiled js on the
>> client) like volt framework that appeared on ruby world?
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/django-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/6738eee6-ac93-4851-9ed2-fd869357432d%40googlegroups.com
> <https://groups.google.com/d/msgid/django-developers/6738eee6-ac93-4851-9ed2-fd869357432d%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAJxq84-uqHddNaYM-vzYaAgeEyavB9y1PgBHGQjaUsWO2R3mwA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to