Slashdot Mirror


Examining Chrome's Source Code

An anonymous reader writes "Chrome is open source, and there's clearly still some work to be done on it. In this article, Neil McAllister decided to take a peek under Chrome's hood and view it through the eyes of the developers who will improve and maintain it in the coming years. It seems Google's open source browser currently has much to offer prospective hackers — provided they use Windows. Quoting: 'The Chromium site explains how to download the source code for Linux, Mac OS X, or Windows. Unfortunately, if you're eagerly awaiting a Mac version of Chrome, you shouldn't hold your breath. As the Mac OS X area of the Chromium developer site explains, "Right now, the Mac build is a work in progress that is much closer to the start than the finish." In fact, according to the latest status report, the Chrome developers have yet to get even the browser core running under Mac OS X. Rendering actual Web pages is still a long way off, to say nothing of a usable Aqua GUI. Then again, the Linux version is in arguably even worse shape.'"

30 of 288 comments (clear)

  1. It's not over for Mozilla after all by Anonymous Coward · · Score: 4, Funny

    They still have a near monopoly on the entire Linux desktop market!

    1. Re:It's not over for Mozilla after all by Simias · · Score: 5, Insightful

      And google is really happy with that. They don't need to target the linux market because Mozilla is already working for them here.

      The target is obviously internet explorer.

    2. Re:It's not over for Mozilla after all by dotancohen · · Score: 5, Interesting

      They still have a near monopoly on the entire Linux desktop market!

      Truth is, I don't really care if Chrome runs under Linux or not. What _is_ important is that there is a lot of buzz about a non-IE browser out there, and that will help Linux users no matter which browser they use. Chrome will get the attention of at least some PHBs and Frontpa^w webdevs who code IE-only websites. I have been complaining about this for years but now there finally is a product that they will have a hard time ignoring. Firefox was close, but was only talked about by gearheads. Even my mother-in-law asked me about Chrome. Which is too bad, as she's on Ubuntu and feels left out...

      --
      It is dangerous to be right when the government is wrong.
    3. Re:It's not over for Mozilla after all by wisty · · Score: 5, Insightful

      And they don't want to destroy the innovative, anti-Microsoft, pro-Google Firefox or Safari browsers. No sensible parasite kills its host. They only want to take down IE, which drives traffic to MS search.

    4. Re:It's not over for Mozilla after all by Firehed · · Score: 5, Insightful

      But of the eleventy billion IE users who still haven't switch to !IE, why would they switch to Chrome? I think the vast majority of them can be split into two groups: their bank/intranet/some stupid thing/fucking activex/etc doesn't work right elsewhere, and "the blue e takes me to the internet!". The first group can't switch and the second just doesn't care - why/how would Chrome change that?

      --
      How are sites slashdotted when nobody reads TFAs?
    5. Re:It's not over for Mozilla after all by kripkenstein · · Score: 4, Interesting

      And google is really happy with that. They don't need to target the linux market because Mozilla is already working for them here.

      The target is obviously internet explorer.

      I disagree for two reasons.

      First, we can only presume Google wants Chrome to run on Android, Google's handset OS. Which is based on Linux. So clearly Google has a direct and powerful motivation to target Linux with Chrome. (In fact a much stronger motivation than to get Chrome running on OS X - I wouldn't be surprised to see the Android/Linux version out earlier.)

      Second, one of the best ways to weaken IE is to weaken Windows - the less people running Windows, the less run IE. But if Chrome is Windows-only, that just strengthens Windows as the only platform able to run the 'best' browser ('best' at least in Google's eyes and those that like Chrome).

      In other words, every IE convert to Chrome is still locked in to Windows. Whereas Google's long-term goal is to make the OS irrelevant so long as it can access Google's web services.

    6. Re:It's not over for Mozilla after all by Fumus · · Score: 5, Interesting

      If a large enough subgroup of "the blue e takes me to the internet" group starts thinking that google=internet, then a convenient "Download chrome! Make your google experience even better." link on every search page can easily convert them.

    7. Re:It's not over for Mozilla after all by TwistedSymmetry · · Score: 4, Insightful

      I've tried removing the icon on her desktop, but that just makes her confused and annoyed =P

      So make a firefox shortcut with the IE icon. :P

    8. Re:It's not over for Mozilla after all by Firehed · · Score: 4, Insightful

      And give the developers of that site an excuse to keep producing bad code?

      I think not.

      --
      How are sites slashdotted when nobody reads TFAs?
  2. What I don't get... by Angstroem · · Score: 4, Interesting

    So they want to develop a cross-platform browser.

    Why exactly is it then tied that tightly to a platform that porting it over to other platforms seems to basically mean starting all over again? After all, it's not like all 3 platforms would be completely alien in the backend -- they are POSIX compliant. Then the GUI: it's not like there aren't any cross-platform widget sets out there. But even if you want to go for individual approaches for each platform, then you still can separate functionality from the GUI.

    So why again is the Mac port "closer to start than finish" (especially when reminding that Chrome is based on Webkit) and the Linux port "even worse"?

    1. Re:What I don't get... by mikeplokta · · Score: 4, Insightful

      Cross-platform widget sets are always dreadful. An application developed using cross-platform widgets will, at best, work well on one platform, and more usually on no platforms. OS X and Windows have different UI philosophies, and an OS X application needs a different UI from a Windows application.

    2. Re:What I don't get... by FooBarWidget · · Score: 4, Informative

      "After all, it's not like all 3 platforms would be completely alien in the backend -- they are POSIX compliant."

      Uh, sorry? Since when is Windows POSIX compliant? Windows seems to be the only major modern OS in existence that's not POSIX compliant.

      I know that Windows provides some POSIX support, but it's broken and non-compliant in various ways. For example fork() is not supported.

    3. Re:What I don't get... by Anonymous Coward · · Score: 4, Funny

      They even did worse, they made it for MS Windows 32 bits from the start. Too bad for them.

      Yeah, now they're stuck with 90+% of the existing desktops on the planet. Whatever will they do?

    4. Re:What I don't get... by itsdapead · · Score: 4, Insightful

      So they want to develop a cross-platform browser.

      Not really - they want a Windows browser to deliver their apps on which, largely thanks to the Google name, might stand a chance of making some inroads against IE.

      Mac and Linux versions would be nice too - but those users already use either Firefox or Webkit/Safari which have a better reputation for standards compliance and aren't controlled by Microsoft. That last is particularly important if your name is Google and you produce webapps which compete with Microsofts office products.

      So why again is the Mac port "closer to start than finish"

      Because they obviously chose to develop for Windows and port later, rather than develop all 3 versions in parallel. So maybe they delayed the Mac and Linux versions at the expense of Windows, but the upshot is that they got the Windows beta out before IE8 launches. Kinda strategic.

      Chrome is based on Webkit

      So what if they don't have to write WebKit for Mac? They didn't have to write WebKit for Windows, either! What Google are spending their time on will be the not insubstantial bits that wrap around Webkit to make it Chrome.

      it's not like there aren't any cross-platform widget sets out there

      Looks to me like they're using their own Widget set. Plus (as both MS and Mozilla have found in the past) Mac users tend to come down hard on apps that don't look as if they were born and bred on a Mac.

      --
      In a survey of 100 programmers, 111111 thought that duck-typing was a good idea.
    5. Re:What I don't get... by pthisis · · Score: 4, Informative

      I know that Windows provides some POSIX support, but it's broken and non-compliant in various ways. For example fork() is not supported.

      Not true.

      Microsoft Windows Internals, 4th. Ed (Russinovich & Solomon), p. 60:

      Because POSIX.1 compliance was a mandatory goal for Windows, the operating system was designed to ensure that the required base system support was present to allow for the implementation of a POSIX.1 subsystem (such as the fork function, which is implemented in the Windows executive, and the support for hard file links in the Windows file system).

      And to head off the next common incorrect belief, p.394:

      The POSIX subsystem takes advantage of copy-on-write to implement the fork function. Typically, when a UNIX application calls the fork function to create another process, the first thing that the new process does is call the exec function to reinitialize the address space with an executable program. Instead of copying the entire address space on fork, the new process shares the pages in the parent process by marking them copy-on-write.

      The POSIX subsystem blows for a host of reasons (you can't access most normal Win32 functionality, at least not easily), but it's got fork.

      --
      rage, rage against the dying of the light
    6. Re:What I don't get... by TheRaven64 · · Score: 4, Informative

      Have you ever used a Qt application on OS X? They stick out like a sore thumb. I think they've possibly fixed it in later versions, but until recently even trivial things like the keyboard shortcuts for skipping forwards and backwards one word in a text field were different from every other OS X application. The menus usually have a different structure, the preferences panels are typically horrendous, the services menu doesn't work correctly - they're so frustrating to use that they're typically not worth the bother.

      --
      I am TheRaven on Soylent News
    7. Re:What I don't get... by TheRaven64 · · Score: 5, Informative

      Do you mean to say that OS-X breaks convention by using non-standard keyboard shortcuts?

      In OS X, option-left and option-right skip one word to the left or right respectively. This has been the case since the first release of MacOS in 1984. Windows did not exist then, and there were no standards in early X11 toolkits (there still aren't - in 2005 I was using an X11 desktop and had four applications open with different shortcuts in text fields - gtk, tk, Qt and XUL were all doing things subtly differently). Windows standardised on control-left/right, because PCs didn't have an option key and alt was used for the menu (because PCs didn't have a meta key either). It's nothing to do with OS X 'innovating' and 'using non-standard shortcuts,' it's to do with Qt refusing to respect a core element of a user interface that has remained unchanged on a platform for 24 years.

      --
      I am TheRaven on Soylent News
    8. Re:What I don't get... by cecom · · Score: 5, Informative

      Let me clarify a common misconception. Windows is _NOT_ POSIX compliant for all practical intents and purpose for one simple reason: an application using the POSIX subsystem doesn't have access to the Win32 subsystem, making it completely useless.

      For example, you cannot use POSIX functions (fork, etc) and use Win32 GUI at the same time. Thus the need for solutions like Cygwin, which emulate POSIX with enormous performance cost.

      I hope this puts the Windows POSIX compatibility myth to rest forever and nobody on SlashDot will make it ever again :-)

  3. Good Business Sense? by txoof · · Score: 5, Funny

    I suppose it's good business sense to write software for the most popular platform. With around 75% of the OS hits being from Windows, it would be prudent to sink resources into a windows browser, rather than Mac or Linux.

    On the other hand, Mac use is steadily climbing and climbing among young people. Young people are typically drawn to free and shiny (one might say, Chromed) things. They're also good at starting and perpetuating trends. In that light, it might make sense for Google to sink more resources into making an OS X version. It's important to not only have a good product, but to make it fashionable to use that product. Lord knows how many people are still using IE, not because they like it, but rather because they don't know there's anything faster or better out there out there.

    They might as well forget about Linux though. Everybody knows that Linux users are crotchety and only really want to use wget and for really special pages, lynx. I for one can't remember the last time I used a window manager and LIKED that new fangled environment. Too many colors and flashing lights, it's like those arcades that them darn kids like to visit.

    --
    This one's tricky. You have to use imaginary numbers, like eleventeen... --Hobbes
  4. Re:the core not even running under mac? by pizzach · · Score: 4, Informative

    Likely because they added some personal customizations to Webkit like HTML 5 tweaks/additions to Webkit. Also, if JavaScript is considered part of the core, that is likely a reason also. Chrome's implementation of JavaScript is totally different than the one used in Safari.

    --
    Once you start despising the jerks, you become one.
  5. Not open source! by emiraga · · Score: 5, Informative

    There are parts of Google Chrome that are shipped closed source. For starters: GoogleUpdate and RLZ.DLL.

  6. Tracemonkey vs. V8 by Anik315 · · Score: 5, Interesting

    Chrome is currently faster than Firefox at most things even when Tracemonkey is enabled. I mostly work with browser based math/finance apps, and one of the most intensive things that can be done is a numerical integral. No other browser even comes close to Chrome in terms of speed. The only drawback is that it isn't cross platform yet. From what I hear, Tracemonkey is working really well on different processors so it will be an interesting match up. Try pasting this code into JavaScript Shell from Chrome and Firefox for a comparison.

    Math.precision=function (x, eps) { var dec = Math.pow(10, Math.floor(Math.log(1 / eps) * Math.LOG10E)); return Math.round(dec * x) / dec; };function asr(f, a, b, eps) { var c = (a + b) / 2; var h = (b - a) / 6; var fa = f(a); var fb = f(b); var fc = f(c); return Math.precision(recursive_asr(f, a, b, c, eps, h * (fa + fb + 4 * fc), fa, fb, fc), eps); };function recursive_asr(f, a, b, c, eps, sum, fa, fb, fc) { var cl = (a + c) / 2; var cr = (c + b) / 2; var h = (c - a) / 6; var fcr = f(cr); var fcl = f(cl); var left = (fa + 4 * fcl + fc) * h; var right = (fc + 4 * fcr + fb) * h; if (Math.abs(left + right - sum) <= 15 * eps) { return left + right + (left + right - sum) / 15; } return recursive_asr(f, a, c, cl, eps / 2, left, fa, fc, fcl) + recursive_asr(f, c, b, cr, eps / 2, right, fc, fb, fcr); };asr(Math.sin,0,100,1e-15);

  7. Re:the core not even running under mac? by maxume · · Score: 5, Interesting

    It uses webkit for layout, but it uses a (sort of) homegrown library for rendering:

    http://gigaom.com/2008/09/02/google-open-sources-skia-graphics-engine/
    http://src.chromium.org/viewvc/chrome/trunk/src/skia/

    --
    Nerd rage is the funniest rage.
  8. Re:Does it really matter? by Peganthyrus · · Score: 4, Insightful

    They've surrounded the tasty nugget of Mac-compatible Webkit code with a thick layer of Windows-only user-interface and thread-maintenance code.

    --
    egypt urnash minimal art.
  9. Portability between architectures by chrysalis · · Score: 4, Informative

    Worse : Chrome (especially V8) is only designed to work on ARM and i386 (32 bits) architectures. Yes, no AMD64 support, and don't even think of other architectures yet.

    However, there is a lot of manpower behind the project and the developpers are very skilled. So this is not hopeless.

    --
    {{.sig}}
    1. Re:Portability between architectures by evilNomad · · Score: 5, Informative

      It isn't designed just to work on those, they just haven't done others yet. When building a VM it is bad to start out having to support 10 different architectures as it requires you to test them all for every little change you do. It also requires that all developers know these architectures very well if they are to do proper changes.

      Besides V8 is probably the most portable thing there is in Chrome, it already works on Linux, OS X and Windows, and they provided two different architectures, making it much easier to do a 3rd and a 4th for anyone who should wish to do so.

      How do i know this? Because Lars Bak who leads the V8 team happens to be teaching my VM course, and a guy asked that specific question.

  10. Okay, explaining Beta by SmallFurryCreature · · Score: 5, Funny

    When MS uses the word Beta, they really mean pre-alpha. Release is Beta. If you want a release quality MS product you need to look for the discontinued tag.

    Google is simpler, they got beta, beta and beta. One works, one doesn't, the other works for everyone except you and just when you became totally dependent on it, they kill the project.

    Linux has Beta and RC. RC is solid but out of date so nvidia doesn't have drivers for it anymore, beta is solid but nvidia doesn't have drivers for it yet.

    Solaris has only one version, more solid and sensible then a rock, it is labelled "Giving your accountant a heart attack".

    --

    MMO Quests are like orgasms:

    You may solo them, I prefer them in a group.

  11. Re:It's going to have maintainability problems. by skeeto · · Score: 4, Interesting

    And, yuck, they checked in a whole bunch of binaries. If you so a checkout of the Subversion repository (weighing in at 1.5G for the single revision checkout, 8G or so to build!) it is a huge mess. I don't think Chrome is going anywhere for a long time due to these maintainability problems you mentioned, and you won't find hackers poking around Chromium with the mess that the codebase is in. Plus, it's all tied very closely to Windows, and who wants to hack in the hacker-unfriendly Windows?

    Once I saw this, I sort-of forgot all about Chrome/Chromium. It's all hype for now.

  12. Truly, wtf? by fabs64 · · Score: 4, Insightful

    What is it with google and their inability to write cross-platform GUI's? If nearly every OSS app can do it, why can't google?

    It's a really confusing situation that in my eyes loses them serious geek points. Hell, use .NET if you must, but this seemingly raw win32 nonsense is just silly.

    As for the old argument that nothing cross-platform can look good: eclipse.

  13. Re:the core not even running under mac? by Dolda2000 · · Score: 4, Interesting
    What a weird question to ask. WebKit is a just a library for HTML rendering. It's like asking why Windows games don't run on Linux; after all, they're written in C, known to be a cross-platform language.

    Chrome naturally consists of many other components as well, such as the actual user interface, all the glue code to actually read and write files (like the cache), doing network connections, DNS lookups, checking SSL certificates, handling its famous sandbox processes, loading plugins and all sorts of other things.