Live data from Hacker News

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

allievi.sssup.it

41–50 of 63 posts

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

#41
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 :-)

D has all the features C++ should have, and implemented in a sane way.

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

#42

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.

i.e. That "robustness" is why we now use VMs instead of native code everywhere.

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

#43

Earlier quoted context omitted.

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?

Downvoting comes around 500 maybe? Not actually sure. Anyways, lest you think my observation is just a "non-constructive comment": The great thing about the browser is that it is free of a lot of garbage we have to deal with in C++. The antics required to make C++ work in the browser, while laudable, are absurd. If you need cross-platform code, write in Java and avoid native extensions. If you need cross-platform cod…

Have you ever had to maintain a code base with more then a few hundred thousand lines of code across Flash, Javascript, iOS, Android, PC, OSX, Xbox, PS, Wii, Vita, NintendoDS, ...and whatever other gaming platform is popular at the moment? The "popular platform of the day" changes a lot faster then being able to write new code for it. You need to support that new platform within 3 months or less. Good luck rewriting your entire code base into another language in that time ;)

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

#44

Earlier quoted context omitted.

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 t…

"Pray tell us, where does C++ need to be?" In my honest opinion, C++ needs to separate low level concerns from high level constructs. How variables are captured in lexical closures is a very low-level concern, but lexical closures are a high-level construct -- by mixing in such low-level details, the overall utility of closures in C++ is reduced. This is made even worse by the fact that the programmer must manually m…

I love C++ to death--it gives me a level of control I need to get at very small fiddly bits when I need to, and also to abstract away great swathes of things when I want to.

That said, I very much agree with your point--the middle ground between those two modes is cluttered and there lies madness.

The problem with the new features of C++11/14/42 is that they are never going to remove the existing jank of the language; these folks don't seem to understand--or want to understand--that there is never going to be a magical fucking tabula rasa onto which they'll scrawl their code, unless they want to rewrite all the things from scratch (which may actually be a good idea).

That being the case, they're going to get run circles around by people who either stick to existing jank and libraries or use a language with a better set of batteries and more flexibility (Ruby, Python, etc.).

The power and speed of C++ is not worth the difficulty, usually, of finding people who can use it properly.

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

#45

Earlier quoted context omitted.

Cut them some slack, jeez.

Done.

I really appreciate it. We are doing our best with the limited capabilities of three persons. Thanks a lot. - Alessandro of Leaningtech

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

#46

Earlier quoted context omitted.

"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 t…

> Is there a book that teaches best practice C++11 without teaching any of the old cruft? http://www.stroustrup.com/4th.html

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

#47

Earlier quoted context omitted.

Is there a book that teaches best practice C++11 without teaching any of the old cruft?

Only the good parts: http://www.amazon.com/C-Programming-Language-2nd-Edition/dp/...

What an amazingly unhelpful, snarky, useless comment. If you don't like the question or I guess the topic, just skip it.

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

#48

Earlier quoted context omitted.

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

Disclaimer: speaking strictly from a game-devs perspective: I remember that post and from a game dev's perspective the pre-allocated-memory vs. reclaimed-through-garbage-collection argument is a bit weak IMHO. Games have predictable memory usage, and game devs are used to see memory as a static, finite resource anyway (since that's how it is on consoles). Grabbing a chunk of memory upfront is quite common for games.…

From the link:

"Since I do not expect native platforms (i.e. GLibc) to preallocate gigs of memory at application startup to make it faster when dynamic memory is actually used, I do not expect this from a compiler for the JavaScript target either."

So, it would actually make very good sense to have the thing slab allocate a big honking array upfront, and then manage it with brk/sbrk/malloc, and perhaps just add more memory as needed.

Like, if we're going to be writing C/C++ in the browser, why not do this? Why make us deal with the GC at all?

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

#49

Earlier quoted context omitted.

Done.

I really appreciate it. We are doing our best with the limited capabilities of three persons. Thanks a lot. - Alessandro of Leaningtech

You guys are doing great work! Please don't confuse my disdain for the concept of C++ in the browser for a lack of appreciation for your work.

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

#50

Earlier quoted context omitted.

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 t…

"Pray tell us, where does C++ need to be?" In my honest opinion, C++ needs to separate low level concerns from high level constructs. How variables are captured in lexical closures is a very low-level concern, but lexical closures are a high-level construct -- by mixing in such low-level details, the overall utility of closures in C++ is reduced. This is made even worse by the fact that the programmer must manually m…

Ownership is something that is central in C++. Programmers who come from languages where they can rely on a garbage collector probably find it odd that they would have to specify how variables are captured. For a C++ programmer, it is natural to think about who owns something and in which scope it lives.

To generalize a bit: a lot of the things that might seem odd to non C++-programmers are perfectly natural to C++-programmers.

It's not often that I hear that C++ is too narrow. Being able to add new operators and changing the way the type checker works both seem like niche things and something that is more fit for a research language.

Post reply on HN