Duetto (C++ for the Web): CMake integration, Bullet and WebGL demo


At Lean­ingTech we have been work­ing hard and it’s time for some news and updates on the devel­op­ment of duetto, our tool for pro­gram­ming the Web in C++.

Thanks to some key devel­op­ments that we are about to describe, we man­aged to com­pile our first real-world test case in Javascript, the bul­let physics library — and a small demo in webGL that takes advan­tage of it.

The com­pi­la­tion of bul­let in JS with duetto requires very min­i­mal adap­ta­tion to the vanilla code, and can be eas­ily per­formed in full inte­gra­tion with CMake infra­struc­ture. We built a min­i­mal demo to show the result of our tool in action: a tri­an­gle falling on the ground attracted by grav­ity. Please note that the demo is com­pletely not opti­mized, not even by min­i­miz­ing the JS. Any per­for­mance must be con­sid­ered pre­lim­i­nary and there is vast room for improve­ment that we plan to fully exploit

http://leaningtech.com/duettodemo/HelloWorld.html

This was our first trial at com­pil­ing a com­plex code­base, and it went sur­pris­ingly smoothly!

The fol­low­ing fea­tures are now fully sup­ported in duetto:

  • A fully work­ing libc and libc++

Our cur­rent beta fea­tures a full imple­men­ta­tion of the stan­dard C library (based on the newlib imple­men­ta­tion) and of the stan­dard C++ library (based on the LLVM/libc++). Both libraries are stan­dard imple­men­ta­tions, sup­port for duetto was included using the same infra­struc­ture used for other, native, targets.

  • Inte­gra­tion in the CMake/autotool tool­chain as a target

Duetto is now fully inte­grated with the CMake, using the infra­struc­ture nor­mally used for cross com­pil­ing (i.e tool­chain def­i­n­i­tion files). This means you can com­pile com­plex projects that use CMake with lit­tle effort. We also plan to inte­grate with auto­tools in the future.

  • Full sup­port of the DOM and HTML5 APIs (such as WebGL)

Our lat­est beta fea­tures an improved sup­port for using the DOM and WebGL API from C++. This is done by defin­ing a set of head­ers which allows to trans­par­ently access all the browser DOM and libraries. It is also very easy to add sup­port for any JS libraries, fol­low­ing the same approach.

Four months have passed since our ini­tial post about duetto. At that time we promised what we would have released our brain­child in a six months time frame. Well, I’m very happy to say that we are fully in sched­ule and we will be able to release duetto in the fall, under a dual licens­ing scheme: open-source for open-source and non-commercial use, and a paid license for com­mer­cial use.

We have already started shar­ing a lim­ited pri­vate beta with a few devel­op­ers and are inter­ested in expand­ing its release to some more, if inter­ested please con­tact us at info@leaningtech.com

  • bul­letxt

    Is this some­thing like Wt++?