Hacker News .hnnew | past | comments | ask | show | jobs | submitlogin

The browser in my phone is part Objective C and part C++, as part of the project descended from Konqueror, via WebKit. I'd contend the C++ parts are C++ for legacy reasons, aka, "It was the performant solution at the time KHTML was written".

Very little mobile phone software these days is written in cross platform C++, of that it's mostly games. Most iPhone software is still written in Objective C, most Android software is still written in Java. For cross platform code, I'd say Xamarin or Unity C#, or Adobe's product line both are still beating out C++, even counting the games.

Chrome is about 40% C++, and is now the default browser for android.

C#/Xamarin would probably be what I'd standardize on if going for a true cross platform non-game app. Javascript/Unity3D or C+/Unity3D would probably be what I standardized on for games, with Futile being looked at hard for 2D games.

Companies with a huge existing codebase (e.g. EA) likely find porting an existent engine cheaper than writing a new one, and will of course stick with their historical C++



>Chrome is about 40% C++, and is now the default browser for >android.

Chrome is 100% C++. Did you ever sync its source code from the repo? (i wonder what the other 60% are in your opinion, Js?)

edit: to be fair there are a little of objective-c and java just to glue with mac/ios and android


http://www.ohloh.net/p/chrome

The metric is probably off from the automated calculator.http://www.ohloh.net/p/chrome It's likely counting the .h files as C


this 40% metric could only be true of they are counting the third-party (with ffmpeg, webkit, etc) but then we cannot say this is chrome..

also there are a lot of tools written in python(gyp, grit, ninja etc).. but this dont get into the executable or libraries.. so i would not count (at least in the perspective of this thread) as the chrome itself. since those tools are used in other projects as well and come only with the source code to build things (it would be like to count the gcc compiler as part of the source)


> Companies with a huge existing codebase (e.g. EA) likely find porting an existent engine cheaper than writing a new one, and will of course stick with their historical C++

Can you envision an alternative for C++ with similar performance characteristics, if historical investment and reliance is taken out from the equation?

I can only think of something like Rust, because it allows such a fine-grained control over the platform which is essential for all sorts of low-level code which implement an abstraction, such as game engines.


> Most iPhone software is still written in Objective C.

Objective C shares many of the advantages of C/C++.

> I'd say Xamarin or Unity C#

Speaking of Unity, while much of the game specific code is written in C#. As far as CPU time, the vast majority of execution is spent in C++ code.

Similarly on the Web, there is more Javascript code that runs in the browser than browser code. But most of the CPU time is spent in Browser C++.


>Speaking of Unity, while much of the game specific code is written in C#. As far as CPU time, the vast majority of execution is spent in C++ code.

And much of the operating system specific code is written in C. I've always found this "My tight loop is in the language I like" argument a little weird.


I'm not sure I understand what you are saying.

I was simply saying that since we were talking about the performance of browsers (An application that pretty much is the tight loop) Bringing up examples of applications that are not in such a tight loop may not be the most relevant without also discussing where their "tight loop" is.

Does that perhaps clarify my comments?

Also, keep in mind that in a well designed system. The "tight loop" should be in application code. Not OS code. The OS should generally have a priority on latency and overhead over raw throughput.




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

Search: