Results 1 to 8 of 8

Thread: Emscripten-Qt: Bringing Qt, C++ To The Web

  1. #1
    Join Date
    Jan 2007
    Posts
    14,826

    Default Emscripten-Qt: Bringing Qt, C++ To The Web

    Phoronix: Emscripten-Qt: Bringing Qt, C++ To The Web

    Since late 2011 there has been Emscripten, the interesting project that allows generating JavaScript out of LLVM Bitcode. Emscripten thus allows for C/C++ code -- and in effect anything else that can be lowered down into LLVM Bitcode -- to be turned into JavaScript and run from a modern web-browser. Another project that has since come about is Emscripten-Qt, which is a port of the Qt tool-kit to JavaScript and HTML5 for use by web-browsers...

    http://www.phoronix.com/vr.php?view=MTI3NDc

  2. #2
    Join Date
    Jun 2009
    Posts
    2,929

    Default

    Quote Originally Posted by phoronix View Post
    Phoronix: Emscripten-Qt: Bringing Qt, C++ To The Web

    Since late 2011 there has been Emscripten, the interesting project that allows generating JavaScript out of LLVM Bitcode. Emscripten thus allows for C/C++ code -- and in effect anything else that can be lowered down into LLVM Bitcode -- to be turned into JavaScript and run from a modern web-browser. Another project that has since come about is Emscripten-Qt, which is a port of the Qt tool-kit to JavaScript and HTML5 for use by web-browsers...

    http://www.phoronix.com/vr.php?view=MTI3NDc
    It seems like a bizarre idea, but the demos are great fun, and quite responsive.

  3. #3
    Join Date
    Jul 2008
    Location
    Greece
    Posts
    3,791

    Default

    Quote Originally Posted by pingufunkybeat View Post
    It seems like a bizarre idea, but the demos are great fun, and quite responsive.
    It's not bizarre at all. Having your application run on the web from the same codebase as your desktop and mobile version can save you a crapload of dev time. Of course you still need to adapt the GUI to conform better (getting rid of the window decorations, etc.), but it's still the same codebase.

    And that's awesome.

  4. #4
    Join Date
    Mar 2009
    Posts
    13

    Default

    Amazing Stuff! Most of the demos are usable with Firefox, but everything seems to run much better with Chrome.

  5. #5
    Join Date
    Jan 2013
    Posts
    3

    Default

    everything seems to run much better with Chrome.
    Last edited by coxodoina; 01-15-2013 at 01:27 AM.

  6. #6
    Join Date
    Dec 2012
    Posts
    2

    Default

    Quote Originally Posted by RealNC View Post
    It's not bizarre at all. Having your application run on the web from the same codebase as your desktop and mobile version can save you a crapload of dev time. Of course you still need to adapt the GUI to conform better (getting rid of the window decorations, etc.), but it's still the same codebase.

    And that's awesome.
    Yep - I originally started it not only because I thought it would be cool to have, but to serve a specific need of mine: two of my upcoming Qt apps would benefit from having a rich web interface, and while I would be using native HTML elements for this rather than Qt ones, I still ran in to the problem of having to port (and maintain in parallel) a raft of C++ logic into Javascript. I had worked on GWT at work earlier (which essentially converts Java to Javascript) and had actually gone so far as to consider writing in Qt + Jambi instead of C++, when I came upon emscripten. At that point I hadn't even considered that anybody would be converting C++ to JS - it just seemed like utter lunacy, but there it was!

    So initially I was just going to port QtCore (as in the original blog post: http://ssj-gz.blogspot.co.uk/2012/11...f-concept.html) but when I saw how easy it would be (ha!) to port QtGui too, I couldn't resist

    I'm honestly astounded at how smoothly some of the demos run - I can take no credit for this: it's all up to Alon, the Qt devs, and the browser devs. Bear in mind that none of the neat features of the HTML5 canvas - image blitting, rotation, scaling etc are used here: everything is plotted and rendered pixel-by-pixel by Qt to its virtual QScreen framebuffer, which is then flushed to the HTML5 canvas. The amount of indirection and sheer abuse that the Javascript engines have to deal with is huge, and I am mightily impressed that they (the V8 guys in particular) managed to churn through it so smoothly.

  7. #7
    Join Date
    Sep 2007
    Posts
    313

    Default

    It seems as if the page is quite unresponsive... it seems as if phoronix started a DOS attack

    So using this thingy you can convert your C++ app to JavaScript and run it in the browser. How does the performance compare to GTK+'s Ansatz with their HTML5 backend? AFAIR it brings only the rendering to the browser, the calulations are still done on a server.

  8. #8
    Join Date
    Jan 2009
    Posts
    1,405

    Default

    Quote Originally Posted by phoronix View Post
    Phoronix: Emscripten-Qt: Bringing Qt, C++ To The Web

    Since late 2011 there has been Emscripten, the interesting project that allows generating JavaScript out of LLVM Bitcode. Emscripten thus allows for C/C++ code -- and in effect anything else that can be lowered down into LLVM Bitcode -- to be turned into JavaScript and run from a modern web-browser. Another project that has since come about is Emscripten-Qt, which is a port of the Qt tool-kit to JavaScript and HTML5 for use by web-browsers...

    http://www.phoronix.com/vr.php?view=MTI3NDc
    Really well done.
    I'm using FF nightly 20a1 on an old hp 8510w and the performance is quite good.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •