Live data from Hacker News

Chrome Is The New C Runtime

mobilespan.com

91–100 of 149 posts

Re: Chrome Is The New C Runtime

#91
post #61

Earlier quoted context omitted.

> The C++ culture at Google is amazing Yet the C++ code powering downloads was pretty bad and poorly maintained, written, replaced with Go. http://talks.golang.org/2013/oscon-dl.slide#10 For sure there are great C++ programmers at Google, but across the company as a whole?

This is why I don't "get" go. If it was supposed to replace C++, why does it not compete with C++ directly? Why were they even using C++ for those projects in the first place?

Initial work on Go started in 2007.

Go was announced to the public on November 10, 2009.

So Go did not exist when the decision was made in the first place.

Re: Chrome Is The New C Runtime

#92
post #61

Earlier quoted context omitted.

> The C++ culture at Google is amazing Yet the C++ code powering downloads was pretty bad and poorly maintained, written, replaced with Go. http://talks.golang.org/2013/oscon-dl.slide#10 For sure there are great C++ programmers at Google, but across the company as a whole?

This is why I don't "get" go. If it was supposed to replace C++, why does it not compete with C++ directly? Why were they even using C++ for those projects in the first place?

Why use C++? Performance, universal familiarity, ability to access low level APIs (libraries, x86, syscalls), abundance of good tooling, manual memory management (+debug tooling), legacy.

Why not directly compete with C++? The performance and compatibility/"close to the metal" requirements are separate. Much of C++'s complexity comes from the latter. It makes sense to create a solution for applications that require one but not the other.

Re: Chrome Is The New C Runtime

#93
post #83

Earlier quoted context omitted.

You're extrapolating the rewrite of a poorly maintained C++ server to mean something about the overall C++ quality at Google? I fully concur with haberman about the state of C++ at Google.

If a simple C++ server is left in such a poor state, it stands to reason, how can there be a culture of C++ excellence? Why wasn't someone assigned to maintain the server? A culture is everybody, not just a few brilliant individuals or teams.

Because that server was not that important?

Re: Chrome Is The New C Runtime

#94

Earlier quoted context omitted.

I haven't worked with Chromium, but the main C++ code-base at Google is like this for the most part too (especially the core stuff). The C++ culture at Google is amazing, and proof that large-scale C++ can actually be really nice if you stay within best practices. It takes a lot of effort and experience from a lot of knowledgeable people to craft these practices, but thankfully Google publishes its C++ style guide (…

Avoiding exceptions is a worst practice. The guide even admits they're only doing it because they're so far beyond a critical mass of exception-unsafe code that they've lost hope of solving the problem. If the profession ever wants to produce anything reliable in C++, one of the first things that needs to happen is to start treating all unsafe legacy code like toxic waste, marking it clearly, handling it carefully in…

>If the profession ever wants to produce anything reliable in C++

This has already been done, so you are obviously wrong.

Exceptions are cute for small amounts of code. But as soon as you get a sizeable codebase, you have zillions of functions just waiting to explode your call stack in ways you could never expect.

Documentation doesn't fix it either. Even if you could somehow guarantee that every single function has detailed descriptions of its possible throws, you won't get devs to read all the documentation for every function in some piece of code that needs a small fix.

Re: Chrome Is The New C Runtime

#95
post #83

Earlier quoted context omitted.

You're extrapolating the rewrite of a poorly maintained C++ server to mean something about the overall C++ quality at Google? I fully concur with haberman about the state of C++ at Google.

If a simple C++ server is left in such a poor state, it stands to reason, how can there be a culture of C++ excellence? Why wasn't someone assigned to maintain the server? A culture is everybody, not just a few brilliant individuals or teams.

I'll just go ahead and call a spade a spade and say that this is a stupid line of conversation, and it's pretty clear that you know it.

Not only did the person you originally responded to even qualify with a "for the most part" -- thus allowing for the existence of bad code in said C++ culture -- every significant codebase in the verse has a neglected corner or three. Moreover, one man's "globally crappy" code is another man's halfway-decent code. We have no way of identifying how bad the code was, just that it was stalling a whole CPU without doing anything while I/O bound.

Finally, your whole point is ridiculous, because the slide deck you link is about finding a part of the codebase that has accumulated extreme cruft and replacing it with a new, clean implementation, which is exactly how you maintain a healthy codebase.

Go troll a new thread or find an actual point.

Re: Chrome Is The New C Runtime

#96
post #83

Earlier quoted context omitted.

If a simple C++ server is left in such a poor state, it stands to reason, how can there be a culture of C++ excellence? Why wasn't someone assigned to maintain the server? A culture is everybody, not just a few brilliant individuals or teams.

Because that server was not that important?

It was the server which allowed customers to download Google software onto their computers.

If your download server was slow and randomly disconnecting transfers for no good reason, resulting in potential customers giving up, wouldn't it be important?

Re: Chrome Is The New C Runtime

#97

Earlier quoted context omitted.

> We were looking for a great cross platform library for native (c++) apps. Isn't that what Qt is for, with the added bonus that it's what Qt is actually for and thus e.g. documented and supported?

Qt is a higher-level application dev framework with UI support (like MFC but cross-platform). We were looking for lower-level constructs - especially in the networking and P2P areas.

> Qt is a higher-level application dev framework with UI support

Qt is a C++ application framework, it has both low- and high-level components, much like e.g. Cocoa.

> We were looking for lower-level constructs - especially in the networking and P2P areas.

Which Qt provides. Qt is modular and Qt has plenty of low- or intermediate-level modules, including extensive networking, storage and concurrency systems. Using Qt does not mandate using Qt's UI components.

Re: Chrome Is The New C Runtime

#99

Earlier quoted context omitted.

Avoiding exceptions is a worst practice. The guide even admits they're only doing it because they're so far beyond a critical mass of exception-unsafe code that they've lost hope of solving the problem. If the profession ever wants to produce anything reliable in C++, one of the first things that needs to happen is to start treating all unsafe legacy code like toxic waste, marking it clearly, handling it carefully in…

> Avoiding exceptions is a worst practice You say this very matter-of-factly. Many (myself included) do not believe in exceptions, and in C++ where they are poorly implemented, think not using them is best practice. I would summarize, but this 10 year old article I've seen on HN a dozen times does a much better job than I: http://www.joelonsoftware.com/items/2003/10/13.html Error handling is essential, but exceptions…

In fact at the kernel level there are plenty of mechanisms that are comparable to exceptions, e.g. longjmps, software interruptions, signals ...

Edit: clarity.

Re: Chrome Is The New C Runtime

#100

Hi all, I'm the author of the post. Happy to answer detailed questions on using Chromium as a Dev platform. Any suggestions for a follow-up post?

Hi, maybe it's a stupid question, but could you write a C application that makes use of these libraries? I mean, when you talk about integrating with the Chromium source code you mean cherry-picking some code and dropping it into your C++ code or you're talking about linking it at compile time?

Awesome post, though.

Post reply on HN