8 ms·
So what language should they've written it in?
by elorant 8y ago
So what language should they've written it in?
- deleted 8y ago[deleted]
- staticassertion 8y agoA memory safe one. There are many of them. They could build their own if they chose to - they've built multiple languages in the past. Picking a language for the Chrome team doesn't seem practical - we all know where your question is going to head. The point is they have to not pick C++. Again, they've invested many, many millions of dollars into security. Let's not pretend that they're priced out of using another language.
- gpm 8y agoIt doesn't even have to be memory safe, just less memory accident prone. D for example would have been an interesting choice (and I think it was usable back then).
- flukus 8y agoD was released in 2001, KHTML in 1998, it's like suggesting they should have written vim in java.
- jlgaddis 8y ago... and Chrome in 2008.
- jsjohnst 8y agoChrome wasn’t written from scratch in 2008. Chrome was a fork of WebKit, which was a fork of Konqueror, which was a fork of KHTML.
- kolme 8y agoKHTML is the rendering engine for the Konqueror browser. Webkit is a fork of KHTML. And Chrome's engine is called Blink (it used to be Webkit, but they forked it).
- kllrnohj 8y agoD would be interesting but it's also not memory-safe. Not strictly. You can restrict yourself to SafeD, but then you're stuck with a GC you don't really want. Or you can tag all your functions as @Safe, but then it's just a "best practice" and you can't do it everywhere because you can't do things like make system calls. D has some interesting bits, but it did a lot of head-scratching stuff too. It seemed really confused about what target it was going after, like some middle ground between C#/Java & C/C++ that really doesn't seem to exist.
- deleted 8y ago[deleted]
- doctorpangloss 8y agoTheir egos have priced them out of a lot of stuff though. The Chrome team is great but when you're surrounded by people who think they're god damn gods on Earth it's hard to question orthodoxies, especially old ones.
- Roboprog 8y agoAs trollish as that sounds, there's a painful amount of truth there. Program in GNU Pascal or some such thing? Not us. Pedal to the metal!
- kllrnohj 8y agoBack when Chrome was getting started there were no memory safe languages that did not come with huge downsides. Now one could argue for Rust, but let's not pretend that C++ was a bad choice. C++ was the overwhelmingly best choice at the time.
- staticassertion 8y agoI didn't say C++ was a bad choice and I've purposefully avoided making this another language war issue. What I'm saying is that Chrome is an example of a project with more security funding than just about any other project out there, and it still can't save users from the footguns of C++. I guess the question used the wording "should have written it in?", to which I said "a memory safe one", and that's not true. I'm not interested in making a judgment call on their initial choice - I totally get the decision, regardless.
- kllrnohj 8y ago> What I'm saying is that Chrome is an example of a project with more security funding than just about any other project out there, and it still can't save users from the footguns of C++. You can certainly make that argument but this doesn't seem to really be a compelling example. They had one security issue caused by a use-after-free over a decade. That's... a pretty fucking stellar track record and does not at all scream "you cannot use this language safely!!!", now does it? I would certainly argue for something like Rust instead if starting from scratch, though, but just because A is better than B doesn't make B unusable trash, either.
- staticassertion 8y agoWell, that's not really a fair interpretation of my argument, I'd say. My argument is: * We have a production, widely used codebase * This codebase is in C++ * This codebase has probably the most significant efforts to secure it of anything of its size, or at least it's in the top 5 * This codebase suffered enouguh critical vulnerabilities for users to be attacked in the wild So let's be clear - Chrome suffers from thousands of memory safety vulnerabilities, but not many make it to ITW exploits. This case is special because users actually suffered because of it. It isn't fair to say they've had "one security issue", certainly, just one that's had major user impact. I'm not judging C++ or the choice to use it. I am saying that this is an example of a very hardened system not being able to compensate for memory unsafety.
- bauerd 8y agoUse-after-free is ruled out by e.g. Rust's type system
- htfy96 8y agoNope. It's only true when all your code use safe subset/built upon a perfectly correct unsafe base (which is inevitable in a project like Chromium) with correct usage. Otherwise a single misused external call with unsanitized value can ruin all of your security guarantee.
- Ygg2 8y agoNot really. It's been proved that if your unsafe foundations are correct and don't break the rules (i.e. their precondition is correct), then anything safe built on top of that is also correct. Sure you could rely on a C/C++ library that causes problems, but then again you can either: A) fix that library B) replace that part with Rust or even stricter language.
- ancarda 8y agoC++, as that was a reasonable choice in <=2008. Today, perhaps new projects should pick something else (likely Rust). Bits of Firefox are written in Rust, so Chrome could in theory under go the same "oxidation" (gradually replace the C++ code with Rust). Edit: Clarify that Chrome was released in 2008 but was likely in development for some time before that.
- core-questions 8y ago> Chrome was released in 2008 but was likely in development for some time before that. Well, sure, didn't it end up taking WebKit from Safari, which was C++, because it came from KDE Konqueror's KHTML?
- catach 8y agoYes, Chrome was a fork.
- simcop2387 8y agoYes, the KHTML base for the rendering engine was started back in 1998, so C++ was a fine choice then. It's grown up as a code base significantly since then.
- TimTheTinker 8y agoI'll be that guy. :) Rust. (I'm a front-end dev. I have no dog in this fight.)
- asveikau 8y agoIt's funny how we define terms like "front-end" and assume a specific meaning. A web browser is certainly the front of something.
- baby 8y agoRust.