News for hackers. Stuff that matters.
Re:Why people think C++ is complicated? by xamuel on Thursday July 02, 2015 @09:50AM (#9818818)
If you pry open your computer and look through a microscope, you won't see any closures or lambdas. You won't see any private class members, much less any kind of inheritance or dynamic types. You won't see any microchips dedicated to try/catch/throw, you certainly won't see an 'exec' circuit. You won't see any kind of DOM, shadow or not.
Re:Why people think C++ is complicated? by cmpitg on Thursday July 02, 2015 @10:10AM (#9818953)
I don't think it has anything to do the relationship between the language and its (compiler/interpreter) performance. Besides, the subset of a large number or programming language could be considered bare metal, right? If so, why mentioning bare metal at all?
Re:Why people think C++ is complicated? by xamuel on Thursday July 02, 2015 @11:49AM (#9819665)
Most things you do in a language like C, have direct counterparts in the physical machine. If you get into stuff like game hacking, you can literally "see" these things through whatever RAM-hacking tool you're using.

Dereference a pointer? That translates to a tiny fragment of machine code for "dereference pointer".

Create a lambda? That translates to a big blob of machine code for "set up this bunch of paperwork that will be used to painstakingly emulate a lambda".

Re:Why people think C++ is complicated? by cmpitg on Thursday July 02, 2015 @11:57AM (#9819723)
And what does it have anything to do with C++ compared to any other language X? The bare-metal characteristics could be created as a subset of any non-safe non-garbage-collected language.
Re:Why people think C++ is complicated? by xamuel on Thursday July 02, 2015 @12:11PM (#9819825)
You're right. I think someone else already pointed out asm.js as a good example.

Of course, it won't happen magically: someone has to go to the effort of defining the subset and building the compiler for it.

You can't expect the general-purpose compiler to automatically be as optimal as possible just because a program happens to use the subset. For example, the program might be being compiled into something like a java .class file meant for importing to a less conservative calling program. This would be incompatible with putting those bare metal optimizations in the .class file.