Archive for October, 2013
Duetto: a C++ compiler for the Web going beyond emscripten and node.js
Posted by Alessandro Pignotti in Uncategorized on October 31, 2013
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:
Duetto: a C++ compiler for the Web going beyond emscripten and node.js
Posted by Alessandro Pignotti in Uncategorized on October 31, 2013
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:
Duetto (C++ for the Web) to be released soon: licensing model
Posted by Alessandro Pignotti in Leaningtech on October 24, 2013
Duetto — our C++ compiler for the Web — is getting close to its first public release, due in a few days, and we would like to spend a few lines to present and explain our licensing model, as many people have been asking recently.
When we started working on duetto around a year ago, we knew that we were going to release it as a FOSS project. We believe that duetto, by enabling truly seamless client/server C++ programming, can become a corner-stone of Web applications and games development. But this can only happen if an ecosystem of libraries, extensions and frameworks will be built around duetto itself. We know that the only way for this to happen is to make the core of our technology available to everyone, for free. In addition to that, since duetto is heavily based on the LLVM/clang framework and could not have existed otherwise, we really feel that giving back to the community is the most fair thing to do.
At the same time, we have also always been determined to build a company around this project. For this reason, we will be offering a premium package that includes the same core FOSS technology plus personalized support, proprietary friendly licensing and auxiliary perks including, but not limited to, integration with development environments.
Let’s now talk licenses. The duetto compiler itself is derived from LLVM and clang, both released under the University of Illinois/NCSA Open Source License. We are releasing our duetto compiler under the same license, both to make it easier for the community to contribute with code, to contribute back with some of our code to LLVM and clang, and because it does not make much sense to use a dual licensing scheme on a compiler.
In addition to the compiler, there are a bunch of headers and libraries which are essentials to develop using duetto. All those will be released under a classic dual licensing scheme: GPLv2 for everyone and a proprietary non-copyleft license for paying customers.
To summarize, here is how duetto licensing will work:
-
duetto core compiler: University of Illinois/NCSA Open Source License (like the LLVM and clang projects)
-
duetto core libraries/headers: dual license GPLv2; proprietary non-copyleft license available for a fee
-
duetto premium features: proprietary and closed source, available for a fee
We think this choice represents a good balance between being open and giving back to the open source community, and building a viable business model. We hope the open source community will appreciate our choice!
Follow us on twitter @leaningtech and visit our website http://www.leaningtech.com to get updates on our upcoming release and for further information.
Duetto (C++ for the Web) to be released soon: licensing model
Posted by Alessandro Pignotti in Leaningtech on October 24, 2013
Duetto — our C++ compiler for the Web — is getting close to its first public release, due in a few days, and we would like to spend a few lines to present and explain our licensing model, as many people have been asking recently.
When we started working on duetto around a year ago, we knew that we were going to release it as a FOSS project. We believe that duetto, by enabling truly seamless client/server C++ programming, can become a corner-stone of Web applications and games development. But this can only happen if an ecosystem of libraries, extensions and frameworks will be built around duetto itself. We know that the only way for this to happen is to make the core of our technology available to everyone, for free. In addition to that, since duetto is heavily based on the LLVM/clang framework and could not have existed otherwise, we really feel that giving back to the community is the most fair thing to do.
At the same time, we have also always been determined to build a company around this project. For this reason, we will be offering a premium package that includes the same core FOSS technology plus personalized support, proprietary friendly licensing and auxiliary perks including, but not limited to, integration with development environments.
Let’s now talk licenses. The duetto compiler itself is derived from LLVM and clang, both released under the University of Illinois/NCSA Open Source License. We are releasing our duetto compiler under the same license, both to make it easier for the community to contribute with code, to contribute back with some of our code to LLVM and clang, and because it does not make much sense to use a dual licensing scheme on a compiler.
In addition to the compiler, there are a bunch of headers and libraries which are essentials to develop using duetto. All those will be released under a classic dual licensing scheme: GPLv2 for everyone and a proprietary non-copyleft license for paying customers.
To summarize, here is how duetto licensing will work:
-
duetto core compiler: University of Illinois/NCSA Open Source License (like the LLVM and clang projects)
-
duetto core libraries/headers: dual license GPLv2; proprietary non-copyleft license available for a fee
-
duetto premium features: proprietary and closed source, available for a fee
We think this choice represents a good balance between being open and giving back to the open source community, and building a viable business model. We hope the open source community will appreciate our choice!
Follow us on twitter @leaningtech and visit our website http://www.leaningtech.com to get updates on our upcoming release and for further information.
Bringing C++ to the Web: some background on Duetto
Posted by Alessandro Pignotti in Leaningtech on October 10, 2013
While I am a big-time fan of C++, I don’t go so far as to say it’s “the best programming language ever, period.” As an engineer, still, I really believe it’s an extremely effective tool for proper programming. Fans and advocates of more dynamic programming languages such as Python, Ruby and JavaScript typically consider C++ a boring, verbose language with a pedantic compiler that never stops complaining about seemingly unimportant details.
Well, if you ask me, that is the most relevant feature of C++. I don’t see it as a limitation, but as a framework that helps structuring my ideas into machine compatible form. Over time I have grown to appreciate that the C++ compiler is a programmer’s best friend.
More recently I’ve also become fascinated with the incredible progress that browsers vendors have made in bringing standard-compliant modern capabilities to the general user. While HTML5 canvas and WebGL are definitely the most visible additions, we should not forget about local storage, programmatic audio support, video support, web sockets and everything that is being standardized. This extensive feature set is amazing and, to me, this depicts a future where almost-native applications and games are available on every single platform through browsers.
So far, taking advantage of the great platform that the Web is, has required programming in JavaScript. JavaScript is terrible. I am no JS ninja, and I find it incredibly frustrating having no hint about what kind of thing will be passed as an argument of a function, or if anything at all will be passed, for that matter. How some people can build and effectively maintain a large-scale code base in JS is beyond my comprehension. I am sure many developers feel that same way that I do.
So we have some pretty awesome Web APIs, tightly coupled in a programming environment that, to me, looks like a joke. Since that sounds like a problem to me, and I like to solve problems [1], I decided to bring my language of choice, C++, to the Web platform.
My solution was to write duetto, a C++ compiler for the Web. With a couple of friends, we are trying to build a company around it.
duetto is a C++ compiler for the Web, not for JavaScript. Most of the work involved in writing duetto was related to finding a way to generate good JavaScript from C++. To do that, we wrote a special LLVM backend, based on a couple of (hopefully) clever tricks. But we did that only because we had no choice. JavaScript is currently the only practical way to deploy code to browsers. But in our vision JS is only a mean to our goal of enabling C++ as a programming language for web apps and games.
What we want to do is to provide a better programming language for the Web, to take the most advantage of all the fantastic underlying technologies such as HTML5 and CSS, which do their job more than well. With duetto, designers can still work using tools they know, while developers can write a sound application logic in robust C++ code. And, by the way, we are not trying to provide an half-backed widget library that would always be lagging behind what browser APIs can provide. With duetto you access the browser directly, with no need of any middle layer.
One of the intended uses of duetto is to port existing C++ applications, especially games, to the Web. But we also want to make it a primary choice to write new web apps. One of the requirements of modern apps is continuous communication with remote servers, for example to receive other users’ updates. This is why we have also introduced an experimental support for transparent RPC to server side code.
Calling this RPC is actually kind of limiting. Our objective is to provide a seamless experience to make it possible to write client and server side code in the same codebase and let the compiler generate the two sides of compiled code. Take a look at some example code.
We are all standing on the shoulder of giants. In our case the giant is the LLVM/clang project. Generating JavaScript required some improvements to the compiler core that we hope to include in the upstream projects. LLVM provide a large array of optimizations passes on code generated by clang, which means that JavaScript code reaching the browser has been already heavily optimized, lowering the burden on the JS engine. In general, the JS generated by duetto tries to play well with modern JS engines, by providing hints that should make it possible to generate good native code. Currently the code is generic, but we plan to explore the possibility of generating code tailored for each JS engine (e.g. Chrome’s V8 or Mozilla’s SpiderMonkey). In the end this would be not different from the CPU specific optimizations that are available on regular architectures.
The release date for duetto is now getting really close and we are really excited about shipping it and see what people can do with this technology. If you want to take a preview please visit http://leaningtech.com, there are still a few slots open in our extended beta program.
[1] Maybe I like solving problems too much, I wrote Lightspark because Adobe’s Flash Player was too slow in rendering full screen videos of kittens on my workstation
Bringing C++ to the Web: some background on Duetto
Posted by Alessandro Pignotti in Leaningtech on October 10, 2013
While I am a big-time fan of C++, I don’t go so far as to say it’s “the best programming language ever, period.” As an engineer, still, I really believe it’s an extremely effective tool for proper programming. Fans and advocates of more dynamic programming languages such as Python, Ruby and JavaScript typically consider C++ a boring, verbose language with a pedantic compiler that never stops complaining about seemingly unimportant details.
Well, if you ask me, that is the most relevant feature of C++. I don’t see it as a limitation, but as a framework that helps structuring my ideas into machine compatible form. Over time I have grown to appreciate that the C++ compiler is a programmer’s best friend.
More recently I’ve also become fascinated with the incredible progress that browsers vendors have made in bringing standard-compliant modern capabilities to the general user. While HTML5 canvas and WebGL are definitely the most visible additions, we should not forget about local storage, programmatic audio support, video support, web sockets and everything that is being standardized. This extensive feature set is amazing and, to me, this depicts a future where almost-native applications and games are available on every single platform through browsers.
So far, taking advantage of the great platform that the Web is, has required programming in JavaScript. JavaScript is terrible. I am no JS ninja, and I find it incredibly frustrating having no hint about what kind of thing will be passed as an argument of a function, or if anything at all will be passed, for that matter. How some people can build and effectively maintain a large-scale code base in JS is beyond my comprehension. I am sure many developers feel that same way that I do.
So we have some pretty awesome Web APIs, tightly coupled in a programming environment that, to me, looks like a joke. Since that sounds like a problem to me, and I like to solve problems [1], I decided to bring my language of choice, C++, to the Web platform.
My solution was to write duetto, a C++ compiler for the Web. With a couple of friends, we are trying to build a company around it.
duetto is a C++ compiler for the Web, not for JavaScript. Most of the work involved in writing duetto was related to finding a way to generate good JavaScript from C++. To do that, we wrote a special LLVM backend, based on a couple of (hopefully) clever tricks. But we did that only because we had no choice. JavaScript is currently the only practical way to deploy code to browsers. But in our vision JS is only a mean to our goal of enabling C++ as a programming language for web apps and games.
What we want to do is to provide a better programming language for the Web, to take the most advantage of all the fantastic underlying technologies such as HTML5 and CSS, which do their job more than well. With duetto, designers can still work using tools they know, while developers can write a sound application logic in robust C++ code. And, by the way, we are not trying to provide an half-backed widget library that would always be lagging behind what browser APIs can provide. With duetto you access the browser directly, with no need of any middle layer.
One of the intended uses of duetto is to port existing C++ applications, especially games, to the Web. But we also want to make it a primary choice to write new web apps. One of the requirements of modern apps is continuous communication with remote servers, for example to receive other users’ updates. This is why we have also introduced an experimental support for transparent RPC to server side code.
Calling this RPC is actually kind of limiting. Our objective is to provide a seamless experience to make it possible to write client and server side code in the same codebase and let the compiler generate the two sides of compiled code. Take a look at some example code.
We are all standing on the shoulder of giants. In our case the giant is the LLVM/clang project. Generating JavaScript required some improvements to the compiler core that we hope to include in the upstream projects. LLVM provide a large array of optimizations passes on code generated by clang, which means that JavaScript code reaching the browser has been already heavily optimized, lowering the burden on the JS engine. In general, the JS generated by duetto tries to play well with modern JS engines, by providing hints that should make it possible to generate good native code. Currently the code is generic, but we plan to explore the possibility of generating code tailored for each JS engine (e.g. Chrome’s V8 or Mozilla’s SpiderMonkey). In the end this would be not different from the CPU specific optimizations that are available on regular architectures.
The release date for duetto is now getting really close and we are really excited about shipping it and see what people can do with this technology. If you want to take a preview please visit http://leaningtech.com, there are still a few slots open in our extended beta program.
[1] Maybe I like solving problems too much, I wrote Lightspark because Adobe’s Flash Player was too slow in rendering full screen videos of kittens on my workstation
Update: Duetto (C++ for the Web) limited public beta extended!
Posted by Alessandro Pignotti in Leaningtech on October 4, 2013
Well folks, we are very happy about the success of our limited beta campaign having already filled up the 100 slots we have offered for our first public beta. We decided to raise the threshold to up to 200 beta testers. Apply here:
and you will receive a link to our most recent build.
Moreover, take a look at the incredibly awesome demo that our friend Daniele Di Proietto made for us using an earlier beta. It is an implementation of the “Not Tetris” concept. And just to be clear, it’s fully implemented in C++ using direct access to WebGL. For more info, see the demo page.
For more info take a look at our original blog post here.
Update: Duetto (C++ for the Web) limited public beta extended!
Posted by Alessandro Pignotti in Leaningtech on October 4, 2013
Well folks, we are very happy about the success of our limited beta campaign having already filled up the 100 slots we have offered for our first public beta. We decided to raise the threshold to up to 200 beta testers. Apply here:
and you will receive a link to our most recent build.
Moreover, take a look at the incredibly awesome demo that our friend Daniele Di Proietto made for us using an earlier beta. It is an implementation of the “Not Tetris” concept. And just to be clear, it’s fully implemented in C++ using direct access to WebGL. For more info, see the demo page.
For more info take a look at our original blog post here.
Duetto (C++ for the Web) available for download: limited public beta
Posted by Alessandro Pignotti in Leaningtech on October 2, 2013
Did we ever tell you that writing a full-feature compiler is not a job for the faint of heart? During the last couple of months we have been marching forward in our quest to bring a great, seamless C++ programming experience for the Web. And we see victory at the end of our journey!
Duetto is our clang-derived C++ compiler which makes it possible to really translate the value of C++ to Web programming. What we want is for you to be able to reuse your oh-so-hard-to-reimplement C++ code (like simulation libraries, or physics engines) in your shiny new HTML5-based app or videogame, with no need of rewriting it in JavaScript. But not only.
We are aware, of course, that there are already other solutions, such as Emscripten, to solve this problem. What makes Duetto different is that it is a C++ compiler with a C++ mindset.
We believe that the strength of C++ comes from enhancing the platform capabilities, without trying to hide the limitations from the developers. In Duetto, JavaScript is our machine architecture and an HTML5 browser is our OS. Our tool compiles standard, compliant C++11 code to JavaScript and exposes all the awesome HTML5 features of modern browsers, including WebGL. There is no middle layer, no inefficiencies, no custom half-crippled widget library. You write you web page in HTML and CSS, and code the logic with C++. We truly believe this is taking best of both worlds.
We have worked long and hard to polish Duetto and we are now almost satisfied by its capabilities and robustness. We are now ready to share this tool with the first 100 developers that are going to share their interest, in order to collect the most feedback and provide the best possible support and experience.
Interested in trying out Duetto for free? Visit http://leaningtech.com to get your copy.
If you’re not one of the 100 lucky beta testers, do not despair. We will be releasing Duetto in roughly a month. Just enough time to hammer out some bugs, add some more awesomeness and figure out last details on our licensing model. Duetto will be released under a dual licensing scheme, so it will be an open source/free software project, available for anyone. We will also be offering paid commercial licenses for people which are not comfortable with free software libraries and/or want enterprise-grade support.
UPDATE: I forgot to link the incredibly awesome demo by Daniele Di Proietto. He used Duetto to port his own implementation of the “Not tetris” concept to the Web.
Duetto (C++ for the Web) available for download: limited public beta
Posted by Alessandro Pignotti in Leaningtech on October 2, 2013
Did we ever tell you that writing a full-feature compiler is not a job for the faint of heart? During the last couple of months we have been marching forward in our quest to bring a great, seamless C++ programming experience for the Web. And we see victory at the end of our journey!
Duetto is our clang-derived C++ compiler which makes it possible to really translate the value of C++ to Web programming. What we want is for you to be able to reuse your oh-so-hard-to-reimplement C++ code (like simulation libraries, or physics engines) in your shiny new HTML5-based app or videogame, with no need of rewriting it in JavaScript. But not only.
We are aware, of course, that there are already other solutions, such as Emscripten, to solve this problem. What makes Duetto different is that it is a C++ compiler with a C++ mindset.
We believe that the strength of C++ comes from enhancing the platform capabilities, without trying to hide the limitations from the developers. In Duetto, JavaScript is our machine architecture and an HTML5 browser is our OS. Our tool compiles standard, compliant C++11 code to JavaScript and exposes all the awesome HTML5 features of modern browsers, including WebGL. There is no middle layer, no inefficiencies, no custom half-crippled widget library. You write you web page in HTML and CSS, and code the logic with C++. We truly believe this is taking best of both worlds.
We have worked long and hard to polish Duetto and we are now almost satisfied by its capabilities and robustness. We are now ready to share this tool with the first 100 developers that are going to share their interest, in order to collect the most feedback and provide the best possible support and experience.
Interested in trying out Duetto for free? Visit http://leaningtech.com to get your copy.
If you’re not one of the 100 lucky beta testers, do not despair. We will be releasing Duetto in roughly a month. Just enough time to hammer out some bugs, add some more awesomeness and figure out last details on our licensing model. Duetto will be released under a dual licensing scheme, so it will be an open source/free software project, available for anyone. We will also be offering paid commercial licenses for people which are not comfortable with free software libraries and/or want enterprise-grade support.
UPDATE: I forgot to link the incredibly awesome demo by Daniele Di Proietto. He used Duetto to port his own implementation of the “Not tetris” concept to the Web.