Live data from Hacker News

Chrome Is The New C Runtime

mobilespan.com

71–80 of 149 posts

Re: Chrome Is The New C Runtime

#71
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 do)

But, dont know if it worth the trouble otherwise..

For instance, it takes a very long time to compile everything, it takes long to debug (the final chrome binary with debug symbols end with 2G.. all loaded in the heap) and you got a big codebase to know about.. so use it with care and in need.. otherwise you will waste your precious time trying to kill a fly with a canon

Re: Chrome Is The New C Runtime

#72

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…

Avoiding exceptions isn't the worst practice. You still get automatic resource cleanup with RAII when you return from a function with an error code, which is a big win over completely unmanaged C.

I generally agree though, error paths are the last area I want to expose myself to flaky manual propagation and the 'well, I think I handled/freed everything' discipline. The regimental 'goto cleanup' type code you see in the kernel is not something I want in my projects.

Re: Chrome Is The New C Runtime

#75

Chromium is _huge_. If I just wanted to use the HTTP library (with tls and spdy) then how would I build just that, and cleanly integrate the build into my own project in a way that won't require constant revisiting every time I update my chromium sources?

I wouldn't go there. If I needed high level HTTP access I'd go with libcurl [0]. If I wanted a HTTP parser I'd consider Joyents http-parser library from nodejs (no dependencies at all) [1]. If I wanted a SPDY library, I'd consider spdylay (used by aria2 I think) [2].

All of these libraries are MIT licensed, well documented, and designed to be very focused libraries with very little feature-creep.

For TLS: PolarSSL has worked for me, but its GPL and tends to break ABI quite a bit [3]

[0] http://curl.haxx.se/

[1] https://github.com/joyent/http-parser

[2] http://tatsuhiro-t.github.io/spdylay/

[3] https://polarssl.org/

Re: Chrome Is The New C Runtime

#76

Earlier quoted context omitted.

Can you give us some insight into how you develop on ChromeOS? What editor do you use? How do you run things like GIT? What surprised you that was so easy? What did you find more difficult that you wish was easier?

I'm the kind of guy who lives in the terminal. The only GUI program I use is a web browser. I've been trying out Nitrous.io, and it's pretty great. I also SSH into a Digital Ocean droplet too. I just use Vim and git and everything else as normal. > What surprised you that was so easy? Mostly that it works. > What did you find more difficult that you wish was easier? I still haven't done any international travel with…

I've tried out a little development on a Nitrous box using Vim myself. It seems like it would be possible to be pretty productive in it, if you were really good with Vim and all of the command-line tools. I managed to get some things done, but working with Vim just seemed to put so much friction into things. I try to keep working with Vim enough to get more comfortable/productive in just that, but it seems like a pretty long road.

I tried it out on a VM chromeOS when I was thinking about getting a Chromebook Pixel, but I ended up going with a Macbook instead - seems like more features for the same amount of money.

Re: Chrome Is The New C Runtime

#77
post #50

Earlier quoted context omitted.

And what about source and binary compatibility. What are the current guaranties? (his second question) Edit: to be clear after you get your app up and running with the current version how much time has to be spent on ongoing maintenance down the road?

You build the libraries and link them into your libraries. If you maintain a cadence of updating your Chrome checkout every month, you will mostly be OK (though this can vary, of course).

Why not just stick with a stable version for a while? Updating every month sounds like a huge headache.

Re: Chrome Is The New C Runtime

#80

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…

> 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 are far from a perfect solution. The Linux kernel is an impressively complicated, and robust piece of software and they get along just fine without exceptions. One just needs to be vigilant when handling errors.

Post reply on HN