Today Leaning Technologies Ltd. releases duetto, a compiler designed to develop integrated (backend and frontend) web applications in C++. duetto is now available to the public as FOSS here, and will be offered in a commercial package with closed-source-friendly licensing soon.
Browser-based applications will undoubtedly play a big role in the future of both consumer and business applications. Web apps have some clear advantages compared to native applications, like being natively cloud-based and collaborative, while also being inherently portable, especially thanks to the increased attention that browser vendors have dedicated to web standard compliancy. Modern web standards, that usually go under the umbrella term HTML5, provide incredible close-to-native capabilities and this gap will be shrinking with time.
Several tools have been developed to help programmers in writing large-scale Web application frontends, reducing the limitations and obstacles given by Javascript: CoffeScript, Microsoft TypeScript, Google Dart, Google GWT and, more recently, emscripten, which compiles LLVM bytecode (and therefore C++) to Javascript. On the server side, it is common to use languages such as PHP, Python and Ruby, leading to a separate backend codebase in a language other than Javascript. This causes duplication of code (and new bugs), having to deal with RPC manually, and overall takes time away from proper development. A very popular solution for this has been to use Javascript on the server as well with node.js.
We present duetto, our C++ compiler for the Web, which is now available to the public. Our solution integrates and surpasses features of existing tools, and allows to program both the frontend and the backend of a Web application in an integrated C++ codebase, compiling them respectively to JavaScript and native code.
Duetto combines the advantages of emscripten and node.js by allowing the programmer to:
-
write web applications in C++, reusing existing code and making porting of whole applications and games to the browser plausible.
-
code both the frontend and the backend of a web application in the same language and codebase
In addition to this, duetto provides some nice features:
-
Bring the robustness and proven scalability of C++ programming to the Web
-
You can access all browser APIs directly. Duetto inherits the C++ philosophy of exposing the platform capabilities (and limitations) to the users. There is no middle man.
-
Duetto is based on LLVM/clang. An industry standard C++ compiler is a programmer’s best friend: code sanity is verified as compile time, including RPC signatures.
-
The LLVM toolchain also guarantees that a mind-blowing set of optimizations is run at compile time, generating highly efficient code. This decreases the burden on JavaScript JIT compiler at runtime.
-
Contrarily to emscripten we do not try to emulate a traditional address space using typed arrays, but directly map C++ objects to JS objects. This reduces memory consumption since the garbage collector can delete unused object.
Are you interested in using duetto? You can now. We have just released the whole technology as a FOSS project, available here. Also, we’ve stuck to our promise of releasing in six months from our first announcement in April
The compiler itself, derived from LLVM/clang is released with the same license as LLVM/clang (UI/NCSA) and we plan to contribute generally useful code upstream. Accompanying headers and libraries will be released as GPLv2+. We will be also offering closed source friendly licensing of such components for a fee. Here are links to the various repositories on github:
-
duetto enabled LLVM
-
duetto enabled clang
-
duetto headers and utilities
Release tarballs will be available shortly on the Launchpad page of the project: https://launchpad.net/duetto. Launchpad will also be our bug reporting system, so please use it to report any problem you might find. We will be also providing builds of duetto for Ubuntu linux using a PPA. We plan to provide binary builds for Mac OS X and Windows as well, but we are still working on automating those build.
Please subscribe to our Launchpad group/mailing list to discuss bugs, desired features and usability issues on https://launchpad.net/~duetto-users. You can also follow us on twitter (@leaningtech) and visit our website to be updated on duetto related news: