

Qt GUI Toolkit Ported to JavaScript via Emscripten - adamnemecek
http://badassjs.com/post/43158184752/qt-gui-toolkit-ported-to-javascript-via-emscripten

======
Wilya
I'm not sure whether I should be impressed, consterned or scared.

It's the sort of things I would love as a developer (Hey ! Portability! Less
code to write ! awesome mature toolkits !) and I would never want as an user (
Hey ! It's the same as old Qt apps, except five time slower !).

------
adamnemecek
From the comments: "From Qt came KDE, KDE produced KHTML which became WebKit
which I can now use to render Qt. Full circle indeed!"

~~~
eyko
Just that KJS -> JavascriptCore. Is that understood as part of KHTML/WebKit?

------
przemoc
"it’s actually really fast and responsive"

Is everyone today equipped with at least 4-core 3GHz i7s or what?

Text Edit demo is barely responsive on my Athlon 64 X2 4600+ in recent Google
Chrome beta (25.0.1364.84) on up-to-date debian wheezy. To the point it's
unusable, unfortunately.

I admire the project, it must have been a great fun to build it and it is
impressive achievement. Really!

I still hope it may be optimized more, so it will be truly responsive. Even
then it doesn't mean it's the right way to go. Web developers, please, do not
write your websites as Qt apps to compile them later with emscripten-qt!

~~~
azakai
It is not optimized at all yet - still using software rendering in pure JS.
Will be more interesting with hardware acceleration, I intend to work on that
with the author of these ports.

------
kombine
Well, this is no more than a showcase. On my fairly modern computer with
powerful graphics card it is unbearably slow even in Chrome, while remember,
Qt used to run on embedded devices with no hardware acceleration whatsoever .
Everyone and her granma is excited about web technologies, but this is not the
future I want.

Native Client approach is a lot more promising, despite not being welcomed
well in the industry.

~~~
rtpg
it might be more of a canvas issue than anything. emscripten gets some good
results most of the time (something like 10x speed down compared to g++ -O3).

Canvas (and webGL notably) support is there, but its super flaky and hard to
make fast.

~~~
kombine
And at which point in history 10x speed down has become acceptable? In certain
industries people are trying to squeeze the last bit of performance out of
their code, fine tuning cache usage, SSE and whatnot. I just don't see it as
an innovation in technologies, quite the opposite in fact.

~~~
jevinskie
Extreme portability is often worth 10x slowdown.

~~~
kombine
It sure may be, but JavaScript can't be "extremely" more portable than, say,
C++, since all JavaScript engines with majority market share to date are
implemented in C++.

Also its portability is not an inherent property of JS, it is because of the
history.

------
shadowmint
Cute idea; compile C++ -> LLVM -> Javascript.

...but the problem is that relatively few business GUI applications _do
nothing_. The front end has no purpose other than to trigger some kind of
backend action, or update some database, or read some data from some source
and display it.

...and that backend, non-QT code, which talks to system libraries, is never
ever ever going to compile to javascript.

So other than tech-demo, what's the use case for this?

~~~
adamnemecek
Say no more, say no more! There is just the thing for you:

<http://www.webtoolkit.eu/wt>

To answer your question, I'm not sure what is the use for this, since you
know, it does not compile to coffeescript /sarcasm. But in all seriousness, I
did not post this to advocate it's use, but because I found it somewhat
strange.

~~~
shadowmint
What on earth are you talking about?

I'm not dissing this project; I think the c++ to javascript compiler is really
neat.

I just don't think I've ever seen any real QT applications that would compile
and run with it; they all talk to databases or system services, which isn't
supported.

~~~
briantrice
The Emscripten use-case seems to be all about components rather than
applications.

------
eksith
Good news for browser centric thin clients/devices, I suppose. There was a lot
of criticism of devices, particularly Chromebook, that rely on the cloud; that
you're fairly limited by what you can reach via the browser. Well, it looks
like you can reach a lot more now.

I hope we can look forward to getting rid of pointless apps that are forced on
you just to read a web page though. That's really, really annoying.

------
curiousdannii
I really hope this includes QtWebKit!

~~~
BonoboBoner
i heard you like browsers...

~~~
eyko
... so i put a browser in your browser so you can browse while you browse.

------
pjmlp
Why on earth would I want to use this?!

~~~
jrogers65
Because you can write web applications without having to use crippled, half
baked JS frameworks. GUI programming was solved over a decade ago. The things
we do in the browser these days, in terms of complicated web apps, mostly
consist of reinventing the wheel. Backbone, ember, knockout, etc are all toys
with missing wheels in comparison to a serious GUI toolkit. In contrast, Qt is
well tested, very well designed and elegant. It's been around since 1992 - 21
years old!

~~~
pjmlp
I will take the desktop over the web any day for complex applications.

My experience in web development projects makes me every day more convinced
that the only thing the browser is good for, is documents.

------
MatthewPhillips
Are there any projects using emscripten that aren't just demos?

~~~
azakai
In practical terms, most of the publicly available stuff is demos. It's easy
to create demos of open source projects and publish them immediately.

It takes longer for commercial codebases to be ported, pass all the stages of
productization, and be officially launched. My prediction is for a few such
projects to show up later this year.

With that said, there are some uses of emscripten that are not demos. For
example emscripten was used to port the crunch decoder to JS in gl-matrix, and
that might well be used in non-demos. Also there are educational sites using
compiled languages like repl.it as another commenter mentioned. I've also seen
a few other practical uses, e.g. of sql.js in sqlfiddle.

~~~
MatthewPhillips
It doesn't have to be commercial to be more than a demo. Sql.js was a great
concept but hasn't been updated in 10 months (unless there is a fork that is
maintaining it), even though it has major issues.

I know you Mozilla guys don't have time to maintain ports, but are you doing
anything to encourage open source devs to actually use and maintain this
stuff? I'm working on an emscripten port of a game myself that I _do_ want to
actually maintain and improve upon, but I get the impression that I am in the
minority.

~~~
azakai
> I know you Mozilla guys don't have time to maintain ports

I used to have time to maintain at least sql.js, ammo.js and box2d.js, but
recently work on asm.js and some porting projects has monopolized my efforts
I'm afraid. My hope is people that use it will maintain those.

> but are you doing anything to encourage open source devs to actually use and
> maintain this stuff?

Do you mean ports like sql.js and ammo.js that I began, or new ports people
make?

I don't know how to encourage people to work on my ports - either they do or
they don't ;) I ask for help and mention the projects, but it's up to people
to be interested of course.

Regarding other people's ports, I definitely try to support them as much as
possible. Fixing bugs that those ports encounter is always high priority for
me.

> I'm working on an emscripten port of a game myself that I do want to
> actually maintain and improve upon, but I get the impression that I am in
> the minority.

There are a few serious/long-running ports, like jsmess and nebula3. But most
ports are more short-term: they accomplish the goal, and then not much is left
to do.

There are also commercial emscripten ports, but most commercial work by nature
is secret until it launches.

------
fosap
I'd love to see a (either ported or native) Unix in javascript that can run
all these ported programms. I know emscripten already does have a filesystem
and stuff. But I mean something bigger, something with filesystem backends for
webdav and local storage, a shell, process management and all the usual stuff.
I'd be a victory over the walled garden, because today everything speaks
javascript.

------
regularfry
What a wonderful, pointless, hilarious, inpiring hack.

------
10098
No, thanks. I'm already frustrated by all the crappy "native" (non-ported)
javascript applications that never work as expected, so let's not keep adding
to this.

------
joezydeco
I'm curious how this would run inside an Android webview. Anyone have some
hardware to try it out?

------
hemancuso
I was kind of hoping it could run a Qt Webkit demo!

