Announcement

Collapse
No announcement yet.

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

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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.

    Comment


    • #3
      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.

      Comment


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

        Comment


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

          Comment


          • #6
            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.

            Comment


            • #7
              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.

              Comment


              • #8
                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.

                Comment

                Working...
                X