Can people interested in this topic be more precise about their needs?
Because so far from my experience, I don't understand the point. Maybe I am a bit particular because I know javascript and somewhat popular framworks, I don't mind doing web but I still prefer Python. That's why I created Pythonium (pip install pythonium) in the first place.
Emscripten (+ asm.js) thing is nice, but sincerly, for the kind of web app I need, I doesn't help much. I won't load a 10+ Mo blob of cryptic javascript to share some links and stuff on the Internet. Mozilla claim they run 3D FPS in Firefox with it? With which kind of hardware exactly? My 2 year old top tier desktop computer crashed after 10min of loading.
That said, this is (probably) the way to go in the *long* run, because it keeps the number of libraries to maintain to a minimum. (Even if (computer) people together are not rationale anyway, so it doesn't mean anything).
Another example, I created an app using Pythonium veloce mode, basicaly Javascript with a Python 3 syntax, it is as fast JavaScript can be, but you don't have all the nice things of Python builtins and stdlib, getting the code faster can only be done by inlining the generated javascript code, which Javascript compiler already do. The app, is a cover flow music player like old-time itunes, a basic media player that said, but the UI part was already too greedy for my computer because of the animated reflection... Long story short, doing the same in Kivy is a 2 hour hack session and it won't suck down electricity from the kitchen refrigerator while still leaving room for optimizations.
Web browsers are not flexible.
Since when did you see a fully animated website (without glitches) since Flash dissappeared?
Immediatly, I think the best solution to get "Kivy" working in the browser would be Pythonium (no, no brython, not current brython at least). Right you can not drop your kivy app at Pythonium and get a (nice) Javascript file to load in your browser, but it is the kind of thing that it's meant to be able to do.
With Pythonium, you will need to glue some things together, and probably hack directly Pythonium, it's not a big codebase anyway, not everything in Python 3 is supported, but it's doable, simpler and more manageable than a pharaonic blob javascript or hand crafted javascript-the-good-parts©.
Translating a Kivy app to run in the browser can be done in so many ways, at different level in the stack, so the "best" would be to deal with it case by case or get together a set of required features. Right now, .kv files and canonical coordinates are a no-go-to-translate-vanilla-kivy-to-javascript-with-pythonium, but it might change.
If you don't believe in the fully translate a language to javascript thing, you might surprised to know that LightTable code editor is written in ClojureScript and runs in WebKit and it's desktop app, same for github's
atom.io, without the good part ;)
I can help you to achieve that.
(It can bring good money, see mono, see titanium, see gwt, see blob inc.)
In order to be able to understand fully my ideas, I need to add the following:
The *only* reason why the browser is interesting is because a *lot* of people are doing it, so:
- a lot of buzz
- a lot of money
- a lot of tooling
- a lot of documentation
The same thing that happened with PHP, happened to Javascript and browsers.
For instance firebug and the like are very impressive softwares but they also rely a lot on the killer feature of browsers as VM: never fully fail. If there is an error, it's still displays the page, so things are a bit nicer that a generated core dump or blue screen of death. The other killer feature is "application streaming" ie. you don't need to download "the full app" to get an idea of what it is - most of the time. I see no other feature, that you can not have with "desktop" applications, better, everything else is easier and better in "desktop" applications (even if not always readily available).
Browsers as UI stack is kind of a toy, you can quickly bootstrap something, but complex things are ugly for ever and for everyone. HTML5 ? Broken. CSS? Broken. Javascript? Broken. The only thing I like that comes out of W3C the DOM API as general API for manipulating & exploring trees, I find it easier than lxml.etree API. jQuery API is nice if you know css selectors. SVG is nice, but Inkscape is way better, I dream of Inkscape-like API in Python (or Javascript :p).
You want to experiement with NUIs and future UI concepts? Forget about the browser.
A lot of people say and think that Web == FOSS. This is fully wrong except from the ground, 20 or 30 years ago when it was created to be some kind of literate computing plateform. It is not anymore since js blobs and hipster grew older. Do you know any end-user kind of distro for the web even as crude as gentoo or name-of-a-distribution-without-package-management that is FOSS that can compute somewhat with fbk, ggl and whatnot? The only software that looks like something like that is MediaGoblin from GNU (& CC) and the ruby app that was all the rage a few years back but nobody cares today. Wordpress and Drupal could qualify, if and only if it was written for todays needs (or my need) in Python or Racket.
In my far reaching goal, of creating my super-dupper-socialite-personal-assistant-kind-of-app, I think the web part will be static html and a download link to a (probably) kivy binary.
I like Kivy as I can quickly experiment stuff, while preserving the nice canvas offered by Python, crafting wanna be nice abstractions, APIs, User Interface and ultimatly applications.
Many times, I see Javascript libraries readily available with nice screenshots or demos, it already runs in my browser, so I think «it works, I can do the same»! Whereas in Python, I pip search something dozen of results none works on my workstation. So broken? Kind of. But the source code is still their, the algorithm is their, you can adapt the thing to work with kivy and whatnot. It's not because your computer make some colored pixels dancing day and night that it's easy to do. Thinking that if it works in my browsers, I can do the same, is like running a binary on windows and saying I will hack the thing. Good luck.
That said, keeping an eye or two on what is done in the browser is very important. A lot of concept I know, I learned in the browser, like reflow/layout optimisation which is similar to the same concept in kivy but also share ideas with opengl context management. Reactive/Declarative/Flow/Model programming is old time thing, but back in the show thanks to so many people looking for "ways" to do GUI stuff. Learning JavaScript Design Patterns book is inspiring.
In the end, I recognize, I "loose" a lot of time looking for "how to do things" instead of "getting things done" and I forget completly how to start small, taking back the «white-belt», in particular with Kivy.
Best regards,
Amirouche