Hacker News new | past | comments | ask | show | jobs | submit login
Duetto compiles C++ applications to JavaScript (leaningtech.com)
38 points by jiyinyiyong on April 16, 2013 | hide | past | favorite | 21 comments



The claim is that they will have something usable in 6 months. I'll revisit it then and see if they make that promise :)


"Hey I just made a website,

And my tech is crazy,

But it's not yet ready,

Come back in 6 months maybe?"


Considering how difficult it is to get an optimizing C++ compiler right, I wouldn't place my bets on that deadline.


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.


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.


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.


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.


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.


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.


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


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.


Would be interested to hear how it differs from emscripten.


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.


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


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 ?


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


it has similar appeal to emscripten, which got quite popular


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


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


why.


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




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: