

Duetto compiles C++ applications to JavaScript - jiyinyiyong
http://leaningtech.com/duetto/
For the length, I omitted some words. The whole sentence here:<p>Duetto is a software that compiles C++ applications to binary code and Javascript, allowing you to write high-performance, client-server distributed applications in a single C++ codebase. 
With Duetto, all your C++ applications can go to the web!
======
rrouse
The claim is that they will have something usable in 6 months. I'll revisit it
then and see if they make that promise :)

~~~
joshguthrie
"Hey I just made a website,

And my tech is crazy,

But it's not yet ready,

Come back in 6 months maybe?"

------
api
In other news: JavaScript is the new X86 assembly language.

Of course, X86 is "not that bad" according to Linus et. al. But it is awfully
full of cruft, and could be a lot better. Yet it's fixed and will probably
remain so. I wouldn't be surprised if there are x86 CPUs of some sort in 500
years.

It's the awesome power of installed userbase.

JavaScript is the same. It's not _that bad_ of a language... using node.js
converted me from a hater to a mild-disliker. But it's got some really ugly
stuff and is missing some very important things.

But it's probably going to become one of the biggest and longest lasting
languages due to its massive installed userbase.

------
simonster
Will Duetto compile to plain JavaScript, or to asm.js? It seems like
emscripten + asm.js is already on par with other VM-based languages. (Native
Client is faster, but it's not a VM, and it makes compromises for this speed,
e.g. it allows modules to segfault and kill the process they're running in to
avoid bounds checks.) An approach that compiles to plain JavaScript is
unlikely to be faster.

The Duetto folks mention asm.js in passing on the news page, but don't
specifically state that it is their compilation target.

~~~
fzzzy
Since they specifically mention compiling to normal js objects and not using
the typedarray heap approach that is used by emscripten and asm.js, likely not
asm.js.

------
anguruso
Could someone explain to me why this is useful? I'm not trying to be snarky, I
really don't understand who would want this.

~~~
neilxdsouza
I have a survey compiler that compiles to c++. Using this, I could compile the
generated code to JS and get an html like app for free and in no time at all.

emscripten is something on similar lines. If you pass --html to the compiler,
it generates and html file which when you browse will run your program.

Further, I have seen that you can pass a JavaScript file to emscripten. I
asked on the emscripten irc, if I passed Jquery UI or Dojo toolkit as the
JavaScript file to be embedded, could I have a UI Widget System embedded. But
one of the logged in persons said, no one had asked about something like this.

------
nicholassmith
I wait with some interest to see if delivers the goods. If it does then that
will be massive for me personally, as I spend most of my time building C++
code.

Great that they want to release it as open source as well, although I'm
guessing they're going to be charging for it. And if they aren't, then they
_really_ should be.

~~~
azakai
> Great that they want to release it as open source as well

That is indeed good, but I was worried to see

> Duetto is based on the LLVM stack, and uses patent-pending algorithms to
> ensure the highest performance.

on their site. Not sure how it could be open sourced if it's patented.

~~~
shared4you
Patenting by itself is no harm. Many open-source licenses grant an explicit or
implicit patent license to the source code. So, open-source + patented is
certainly possible.

A recent example is the case where Google bought patent license from MPEG-LA
for VP8 codec. And then Google sublicensed it, giving a royalty-free patent
license for every user of VP8 codec, along with the source code.

------
cjbprime
Would be interested to hear how it differs from emscripten.

~~~
voyou
This blog post from one of the people working on Duetto explains:
<http://allievi.sssup.it/techblog/?p=798>

Basically, the idea seems to be to translate more C++ features directly into
high-level JavaScript equivalents, rather than into code that primarily
operates on byte arrays, as I believe emscripten does.

------
bryansum
More information available on the author's blog:
<http://allievi.sssup.it/techblog/?p=798>

------
m00dy
if i had $100 , i wouldnt put my money on this.Im not sure about who uses this
framework thingy.Old C++ gurus turn themselves into tech-entrepreneurs and use
this framework to build web 2.0 app ? Or Rails guys may say "heyy look at C++
, it's strongly-typed and we can build web-apps like gurus? "

or did i missed some-points ?

~~~
TheCoelacanth
I think the target user is more like "we've got an existing codebase in C++;
now we can run it in a browser".

------
pcunite
I look forward to seeing this. Don't just focus on the gaming community.

~~~
ExpiredLink
gaming == money. That's why you see so many gaming companies in the mobile
market.

------
jzf
why.

~~~
flipcoder
to quote Daniel Tosh: "Nobody rocks like C++"

