Live data from Hacker News

Chrome Is The New C Runtime

mobilespan.com

131–140 of 149 posts

Re: Chrome Is The New C Runtime

#131
post #103

Recommending Chrome is a bit like recommending bionic when everyone else is enjoying (e)glibc? The Chrome runtime has some good libraries but using that over say Qt really only makes sense if you're a (former) Chrome developer. For everyone else it's just needless pain.

No, please. Bionic is not a replacement for (e)glibc, its a small subset of a libc for Android. Now Musl, thats a real usable implementation.

Re: Chrome Is The New C Runtime

#132
post #90

Earlier quoted context omitted.

Where does "must" come from in this case? You could choose to practice browser fetish on anything.

Which other OS is like ChromeOS but without Google?

Linux? FreeBSD? Haiku? There's plenty of choices, and all of them have modern web browsers available (and frankly, better browsers than Chrome. People should really stop drinking google kool aid and take a look at the chrome codebase first before using it).

Re: Chrome Is The New C Runtime

#133
That's how NSPR was/is used by projects other than Netscape/Mozilla, too. Producing such a library is generally an unavoidable consequence of writing a popular multi-platform application -- unless you reuse someone else's.

Re: Chrome Is The New C Runtime

#134

Contrary to many, I'm profoundly concerned about the culture around Chrome development, and the attitude here is indicative of that. There really is a belief by those that work on it, or have worked on it, that it's much better than it really is, when what actually happened was it was much better than the competition at launch, but now there isn't much between them at all. This notion that Chrome is decent on mobile…

Do you have an example, or just paragraphs of mad ramblings?

Re: Chrome Is The New C Runtime

#135

Earlier quoted context omitted.

Finally, somebody with some sense. If you want a fairly high level, cross platform C++ library, there is no reason NOT to use Qt.

How about JUCE, a cross platform c++ lib that is really nice coded and accessible.

The UI component of it is ugly as hell, and the API style is a little antiquated. It also isn't as comprehensive as Qt, and there isn't as many resources out there for it.

I worked for a high end audio company and used it in one of their acoustic simulation softwares.

One of my main jobs was porting this project to Qt.

Re: Chrome Is The New C Runtime

#136

Im using the chromium codebase to build a sort of netxgen "browser" (not web browser).. but more akin to a application platform with p2p in mind (and other crazy ideas). While the idea proposed by the author may sounds cool, i think chromium is a huge codebase to be used like the author says so trivially.. Its ok; if you need multiprocess ipc + net + actor-based thread concurrency + gpu compositor + webkit.. (like i…

This is the argument that resonates with me the most. Unless you're already intimately familiar with the codebase and build system (with all their attendant quirks), it could consume a huge amount of time and effort to tease apart the stuff you need from the vast chromium codebase.

For the record, I'm working on a new C++ project where I ended up picking up small (very small) pieces of chromium codebase with the rest being in conservatively written C++ (but not as conservative as described in google code-style guide). In general, I'd say /base and /threading libraries are useful sources to raid at the beginning of your project. These are high quality implementations of basic things most programs would need and somewhat easier to disentangle from the rest of the code.

Re: Chrome Is The New C Runtime

#137

Im using the chromium codebase to build a sort of netxgen "browser" (not web browser).. but more akin to a application platform with p2p in mind (and other crazy ideas). While the idea proposed by the author may sounds cool, i think chromium is a huge codebase to be used like the author says so trivially.. Its ok; if you need multiprocess ipc + net + actor-based thread concurrency + gpu compositor + webkit.. (like i…

This is the argument that resonates with me the most. Unless you're already intimately familiar with the codebase and build system (with all their attendant quirks), it could consume a huge amount of time and effort to tease apart the stuff you need from the vast chromium codebase. For the record, I'm working on a new C++ project where I ended up picking up small (very small) pieces of chromium codebase with the rest…

i think theres a safe threshold someone can use as a rule, before things get too much complicated..

first: know how to use gyp and ninja build tools then.. you can embed: base, crypto, net and ipc..

Anything more than that, things start to get more complicated.. for instance: if you want to use the 'ui'.. then you have to embed 'cc' and 'gpu'.. and to work right.. you will need the browser process + the gpu process.. and will have to create a custom-renderer, or adapt the renderer process to yourself.. so now you will realize you are doomed!

The other Chrome components past the ones i've pointed out, will need to use the IPC and multiprocess logic from chrome.. so that part should only be used in very specific scenarios..

Edit: i think the 'cc' module, the chrome compositor, also has some sort of autonomy from the multiprocess IPC core.. so could also be used with: base, crypto, net and ipc

Re: Chrome Is The New C Runtime

#138

Earlier quoted context omitted.

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

> 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. Exceptions do not "explode your call stack", and any function can fail in ways both documented and undocumented. Consistent use of exceptions that derive from a small and well-chosen set of base classes means that callers ca…

The key is "small and well chosen set of base classes" for your exceptions. This is where you got the most benefit, and you probably know it. Without exceptions, you can have a class that represents well defined state such as either success or an error code, with the error code being well defined, returning an object of this class for all methods that need to return success/failure codes, and requiring that it be handled, so compilation fails if callers ignore the return value.

What's great about this is I might call a method that simply concatenates two strings, that is all it does, and I know this won't fail(OOM can always happen, but good luck recovering from that), so I don't return a status. I can call this method assuming no failure and no boiler plate is needed. With exceptions, there's always that possibility that an exception can be thrown. What if I call this method from code that needs to close resources? Great, now I absolutely must have RAII for cleanup, which is more complicated than just doing close(x). Also, what are you going to do when using 3rd party code with its own base exception class? Now, at the upper layers of your code, you have to have a handler for each base class. Without exceptions, someone might have their own status object they return, and I'll need to translate that, else my code won't compile. Your code will compile even though you might not handle that 3 party base exception class.

Of course, most times code just propagates the error up so that adds to boiler plate without exceptions.

I think the talk of using exceptions vs returning a status is a red herring. They have their positives and negatives, and we can argue this until the cows come home. The most important thing is to use a set of well defined success/error codes, whether this comes from exceptions or a returned status isn't really important. I've seen codebase with C++ exceptions working just fine, and I've seen c++ code with no exceptions, and it worked well. The commonality between these two cases is .... well defined error codes.

Re: Chrome Is The New C Runtime

#140

Im using the chromium codebase to build a sort of netxgen "browser" (not web browser).. but more akin to a application platform with p2p in mind (and other crazy ideas). While the idea proposed by the author may sounds cool, i think chromium is a huge codebase to be used like the author says so trivially.. Its ok; if you need multiprocess ipc + net + actor-based thread concurrency + gpu compositor + webkit.. (like i…

Any more information about your project? Sounds interesting
Post reply on HN