Live data from Hacker News

Duetto: a C++ compiler for the Web going beyond Emscripten and Node.js

allievi.sssup.it

21–30 of 63 posts

Re: Duetto: a C++ compiler for the Web going beyond Emscripten and Node.js

#21

Earlier quoted context omitted.

We will publish extensive tutorials soon, for now you can find some examples on http://leaningtech.com/duetto/examples/ In addition, the full source code of Nontetris ( http://allievi.sssup.it/jacopone/cnontetris/ ) will be published in a couple of days, with a 'guide' on porting a C++ game to Javascript with duetto. Stefano of Leaningtech

For games I think you need to show that duetto is just as fast as emscripten when running. emscripten-generated code is very light on the garbage collector (inside emscripten generated code no garbage is produced at all, only in some wrapper code which needs to talk to JS libs), and having the "heap" in a plain typed array usually also gives a performance advantage, since as in C++ you have exact control of the memor…

We have written a detailed post a few months ago comparing duetto to emscripten. We also explain why we think it's not a good idea to use a pre-allocated typed array heap: http://leaningtech.com/duetto/blog/2013/05/28/Comparing-to-a...

Re: Duetto: a C++ compiler for the Web going beyond Emscripten and Node.js

#22
post #5

Earlier quoted context omitted.

I really love C++ and I bet with the currently developing standard (C++11, C++14) more people will start loving C++ again :-)

"I bet with the currently developing standard (C++11, C++14) more people will start loving C++ again" I doubt it. C++11 takes C++ even further from where it needs to be. Every high-level feature is bogged down by low-level annoyances. Do you capture variables by value or by reference? Do you need a weak pointer to break this cycle, or can you use a weak pointer somewhere else (or maybe just not both with smart pointe…

I like C++ because it addresses problems relevant for building performant applications in the real world. Details matter for performance - the memory hierarchy, cost of small allocations, allocating and accessing aligned data, copying to enable concurrency are all real things.

Re: Duetto: a C++ compiler for the Web going beyond Emscripten and Node.js

#23

It's a slow morning, so this was good for a chuckle: " Bring the robust­ness and proven scal­a­bil­ity of C++ pro­gram­ming to the Web " Ha. Ha ha. Ha ha ha.

A bit unrelated, but does anyone know at what comment score one gets to downvote non-constructive comments, or is that what the flagging is for?

Re: Duetto: a C++ compiler for the Web going beyond Emscripten and Node.js

#24

Earlier quoted context omitted.

Our memory management approach is still not tuned and optimized. There are quite a few low hanging fruits that should provide great improvements, but we have not yet implemented them - Alessandro of Leaningtech

Would you mind if I suggested that arbitrarily using a couple of gigabytes of memory like that was a fairly severe problem? :-) Seriously, I would like to see a warning put on links to that example to the effect that at present it will make your browser use up to 2½ GB more RAM and will thrash your memory. Because it did render my browser (and to a lesser degree my system) unresponsive for a couple of minutes while t…

You are absolutely right, it is a severe problem and I apologize for this. We are adding a warning on our examples page right now.

Re: Duetto: a C++ compiler for the Web going beyond Emscripten and Node.js

#25
post #5

Earlier quoted context omitted.

I really love C++ and I bet with the currently developing standard (C++11, C++14) more people will start loving C++ again :-)

"I bet with the currently developing standard (C++11, C++14) more people will start loving C++ again" I doubt it. C++11 takes C++ even further from where it needs to be. Every high-level feature is bogged down by low-level annoyances. Do you capture variables by value or by reference? Do you need a weak pointer to break this cycle, or can you use a weak pointer somewhere else (or maybe just not both with smart pointe…

Pray tell us, where does C++ need to be?

All C++ programmers who I have talked to welcome most things in C++11. It simplifies their C++-code in many ways. As an example: specifying how to capture variables was something they were already dealing with when writing functors manually, now they have a shorthand syntax for it.

As for the reason why non-C++ programmers don't like C++, perhaps you are in a better position to say.

Re: Duetto: a C++ compiler for the Web going beyond Emscripten and Node.js

#26
post #5

I'm not sure why you would want something like that, unless you really have a lot of existing code C++ business code you want to reuse, or you really love C++.

I really love C++ and I bet with the currently developing standard (C++11, C++14) more people will start loving C++ again :-)

Does this thing even support C++11? I see no mention of it on the home page...

Re: Duetto: a C++ compiler for the Web going beyond Emscripten and Node.js

#27

I'm not sure why you would want something like that, unless you really have a lot of existing code C++ business code you want to reuse, or you really love C++.

Or want to run an app on very few servers instead of hundreds.

Re: Duetto: a C++ compiler for the Web going beyond Emscripten and Node.js

#28
post #2

Are there any tutorials on this so that we can compare it to emscripten?

We will publish extensive tutorials soon, for now you can find some examples on http://leaningtech.com/duetto/examples/ In addition, the full source code of Nontetris ( http://allievi.sssup.it/jacopone/cnontetris/ ) will be published in a couple of days, with a 'guide' on porting a C++ game to Javascript with duetto. Stefano of Leaningtech

You should include a link to the examples in the copy

Re: Duetto: a C++ compiler for the Web going beyond Emscripten and Node.js

#29

I'm not sure why you would want something like that, unless you really have a lot of existing code C++ business code you want to reuse, or you really love C++.

Existing code and talent and probably it. It might sound very silly, but if someone does a COBOL[1] or RPG IV to Javascript translator there would be a demand.

1) There is at least one company located in MN whose website is done in COBOL.

Re: Duetto: a C++ compiler for the Web going beyond Emscripten and Node.js

#30

As many have noticed the blog is being seriously crushed by the heavy traffic. We are mirroring the content here: http://leaningtech.com/duetto/blog/2013/10/31/Duetto-Release...

snip

EDIT:

After some consideration, I've removed my post. Though the irony is great, the fact is that this is a cool use of LLVM and a pretty interesting thought-experiment made live. I know I wouldn't appreciate the kind of heckling I'd just posted were our roles reversed.

Good work on the technical stuff folks.

Post reply on HN