Slashdot is powered by your submissions, so send in your scoop

 



Forgot your password?
typodupeerror
×

Chrome Is the New C Runtime 196

New submitter uncloud writes "Cross-platform app development is more important than ever. But what about when you need the features and performance of native code, across platforms? And you're a startup with a small team and impossible deadlines?" His answer? Take advantage of cross-platform Chrome. From the article: "Out of necessity, the Chrome team has created cross-platform abstractions for many low-level platform features. We use this source as the core API on which we build our business logic, and it's made the bulk of our app cross-platform with little effort. Most importantly -- Chrome code has been battle-tested like almost nothing else, with an installed base in the hundreds of millions. That makes all the difference when you want to spend your days working on your company's business logic instead of debugging platform issues."
This discussion has been archived. No new comments can be posted.

Chrome Is the New C Runtime

Comments Filter:
  • Bloat. (Score:4, Insightful)

    by qubex ( 206736 ) on Saturday January 18, 2014 @08:05AM (#45997457) Homepage

    This is how bloat begins: with an apparently clever insight that ignores actual common sense.

    • by quax ( 19371 )

      Insightful only if you haven't read the article or didn't understand it.

      As even the headline stated they use it as a library to compile against.

      /. has really dumbed down considerably when people fail to grasp this and moderate this cluelessly.

  • How big is chrome?

      $ls -lh /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.17
    -rw-r--r-- 1 root root 953K Apr 15 2013 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.17

    And libc is a mere 1.8M.

    There are plenty of very well battle tested ways of targeting C code to multiple systems.

    I think I'm going to stuff mine into libreoffice. That's only a few hundred meg and a start up time of a second or two.

    • by tibit ( 1762298 )

      You're just being obnoxious here. You seriously think that the stuff they're after is in the C++ standard library? Most of it, like 95% of it, isn't, and what is, is already used as-is by Chrome code.

    • by HiThere ( 15173 )

      That's pretty much irrelevant. He's talking about using the Chrome libraries, so the linker will strip out any unused functions.

      What this means is that it's likely providing a bunch of useful functions above and beyond the standard library. The problem is, he only talks about those routines in such general terms that you can't figure out whether they're useful, and he doesn't give any links to documentation, so you don't even know if they're documented.

      N.B.: You *could* check the source and see if it was

  • And also... (Score:5, Interesting)

    by serviscope_minor ( 664417 ) on Saturday January 18, 2014 @08:23AM (#45997517) Journal

    From TFA:

    Unless you are building your app for Windows 3.1, chances are that you want to talk to a server of some kind.

    Why does everyone assume that everyone else is doing stuff exactly like them? For work I don't think I've ever written code that makes any kind of network calls.

    In fact the main reason for me not to use any of the "highly optimized interfaces" they provide is that professionally none of them are of the slightest bit of use to me. It's interesting but there are more programs in this world than web-2.3.1-rc4 apps for phones.

    • by maxwell demon ( 590494 ) on Saturday January 18, 2014 @08:42AM (#45997587) Journal

      Unless you are building your app for Windows 3.1, chances are that you want to talk to a server of some kind.

      That's true: Sooner or later I get hungry, so I'll go somewhere to eat and ask the server to give me some food.

    • by Anonymous Coward on Saturday January 18, 2014 @09:21AM (#45997709)

      The software development industry used to consist of professionals. These were people who knew enough to know that not everybody works on networked software.

      Then sometime around 2006 to 2008, the whole "Web 2.0" phenomenon started. It flooded the industry with hipsters. These are people who have no technical or professional training. They just like wearing fedora hats, glasses with no lenses, and expressing "opinionated" ideas about stuff they know nothing about.

      To them, "software development" does not extend beyond JavaScript and Ruby on Rails. They don't know assembly, C, C++, or even Java and C#. They don't know about embedded software. They don't know about industrial control systems. They don't know about financial, scientific and engineering modeling software. To these people, all there is is web development. They can't even conceive the idea that there might be software that isn't networked.

      Hipsters are an infection upon the software industry. They bring nothing but ruin and stupidity.

      • Except the industry has had several waves of clueless "programmers" flooding it before already (eg dotcom - 'nuff said)

        People who truly know what they're doing have always been few - hmm, I guess that explains a lot.

      • Then sometime around 2006 to 2008, the whole "Web 2.0" phenomenon started. It flooded the industry with hipsters.

        Fiber is OK for the masses, but the bits sound "warmer" when transported by avian carriers.

    • What if I want to run my code *on* a server? Does this newfangled Chrome thingy run on Solaris/AIX/IRIX/HPUX/etc?
  • Mozilla NSPR (Score:5, Interesting)

    by abies ( 607076 ) on Saturday January 18, 2014 @08:30AM (#45997541)

    I have a strong feeling of deja vu - I have heard same pitch about Mozilla NSPR (https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR). Same thing - base library for many platforms, which is very well tested, developed for the needs of browser coding, but not really tied to hmtl rendering in any way.

    So, assuming I want to be hipster should I:
    - use NSPR, because it was available before reusing browser base libraries went mainstream
    or
    - use Chrome library, because really cool guys use Chrome rather than Firefox
    ?

    • by maxwell demon ( 590494 ) on Saturday January 18, 2014 @08:36AM (#45997567) Journal

      Obviously you should make your product cross-platform by supporting both NSPR and Chrome ;-)

    • by rvw ( 755107 )

      So, assuming I want to be hipster should I:
      - use NSPR, because it was available before reusing browser base libraries went mainstream
      or
      - use Chrome library, because really cool guys use Chrome rather than Firefox
      ?

      As hipster and nerd, you should DYOFF (Develop Your Own Fucking Framework)!

    • Re:Mozilla NSPR (Score:4, Informative)

      by Florian Weimer ( 88405 ) <fw@deneb.enyo.de> on Saturday January 18, 2014 @09:49AM (#45997823) Homepage

      And Apache has the Apache Portable Runtime, with similar goals, but probably geared more towards writing server code.

      • And an API that makes the standard Java libraries seem clean, consistent, and concise.
      • by HiThere ( 15173 )

        Also note that the Apache Portable Runtime is highly lacking in introcuctory documentation. What it has is DOxygen generated comments for poorly documented routines. They're probably quite adequate if you already know what they do, and just need reminding, but otherwise....sheesh!

    • How is NSPR?
    • Chrome libs includes a free cloud based backup solution for your data and passwords, all paid for by the NSA.
    • serious question - do you have to use XPCOM and all that sort of cruft to do non-XULrunner things with NSPR?

      • by abies ( 607076 )

        No, NSPR is really low level. You can think about it as less readable libc+libsocket+libthread, which gives you platform-independent API.
        So, it is
        PRUint32 PL_strlen(const char *str);
        instead of
        size_t strlen ( const char * str );
        (saves you from worry about what size_t is on given platform). And every other function you know from above libraries will be converted into some with strange prefixes, but well defined data types.
        Well, there are few other goodies like hashtables, but generally it is about being reall

  • by Anonymous Coward

    LOL. The 90s are calling, they want their Java applets back.

    On a side note, articles containing the phrase "business logic" can be safely ignored as irrelevant trash.

    • What's a better term than "business logic" for that which should be kept separate from presentation? There's "game logic", but that too is domain-specific. "Application logic" perhaps?
      • What's a better term than "business logic" for that which should be kept separate from presentation? There's "game logic", but that too is domain-specific. "Application logic" perhaps?

        Yes, I think "application logic" would be good. The problem with "business logic" is that it's domain-specific too; an awful lot of interesting algorithm development and implementation is taking place outside the realm of what would normally be considered business applications. Games are one example; scientific programming is another. In both cases, many of the principles that are useful in business programming can be usefully applied, but the purpose of the final application is very different.

  • How about no? (Score:4, Informative)

    by loufoque ( 1400831 ) on Saturday January 18, 2014 @08:54AM (#45997617)

    Pretty much all the features they need are standard features or are better addressed by a dedicated library.
    Also it's more a framework than a runtime. Learn the difference, it could save your life.

  • by msobkow ( 48369 ) on Saturday January 18, 2014 @08:57AM (#45997633) Homepage Journal

    When I think "business logic" I'm usually thinking "RDBMS interface".

    What does Chrome's library do to deal with business data?

    Nothing.

  • or not (Score:4, Insightful)

    by smash ( 1351 ) on Saturday January 18, 2014 @08:58AM (#45997641) Homepage Journal
    Lets talk about this again in 12 months. Given the NSA bullshit, Chrome, Apple and Microsoft all being involved, I'm not sure people are going to be keen on yet another layer of abstraction for surveillance to be hidden in.
  • by hyades1 ( 1149581 ) <hyades1@hotmail.com> on Saturday January 18, 2014 @09:17AM (#45997689)

    ...why would any sane person build their whole business on Google, with its reputation for pulling the plug on projects for no obvious reason, little or no warning, and absolutely no interest in granting stays of execution?

    Seems like a recipe for disaster.

    • by tibit ( 1762298 ) on Saturday January 18, 2014 @11:08AM (#45998251)

      Seems more like an understanding fail to me. Their business is not built on Google. It's built on a platform abstraction library that currently works for their intended uses. It's a closed book, they don't need any further involvement from Google. If they want to, they can fork it and maintain it themselves. They've already got a big trampoline so it'd still be less work to maintain that code than to come you with a yet another in-house, buggy, under-tested "framework".

    • Google, with its reputation for pulling the plug on projects for no obvious reason

      That reputation is a product of /. groupthink, not reality. The reality is that Google has a history of pulling the plug on projects that aren't successful, niche products used only by a tiny percentage of the user base.

      Chrome, however, is wildly successful. Plus, the code is all open source and has an active developer community outside of Google. Google isn't going to drop Chrome, and even if Google did, Chromium wouldn't be going away any time soon.

  • by Anonymous Coward on Saturday January 18, 2014 @09:48AM (#45997815)

    They should have chosen Java instead of C++ in the first place.

  • Jesus Slashdot (Score:5, Insightful)

    by gbjbaanb ( 229885 ) on Saturday January 18, 2014 @09:59AM (#45997865)

    this is worse that usual, I read the article (well, skimmed through it) and all the guy is saying is: Chrome is built on some libraries that you can pick and chose and build your own programs using. So if you need a http server or xml lib or any other of the myriad bits that Chrome needs, there's a nicely set up way of getting all those for free, and cross platform. Then he describes the library-picker tool and how it can create project files for various platforms to make your life easier.

    But all the comments in /. are:

    why would you build it on big old bloated Chrome (I assume the browser);

    but that's what java was designed for;

    but that's way bigger than libc;

    So google now want us to write plugins instead of HTML5

    and so on, no-one really got what the article was about, thinking its somehow building programs inside Chrome, or using Chrome as a kind of new webkit.

    Pathetic. I blame the editoral summary TBH, but the kids here just got to a new low in not RTFA.

    • Maybe they are kids, maybe they are old dogs who got burned by environments who were devise to be weaponized, increasing some corporations' hold on the market. It is irrelevant to scream "but it is open source!", google itself has shown how raw engineering power can be used to control a project with android.

    • by reikae ( 80981 )

      this is worse that usual, I read the article (well, skimmed through it)

      This is a serious condition. Luckily a few more Bitcoin and Samsung lawsuit articles should make it go away.

  • In 2014, why do we need non-native libraries to handle DNS lookups, crash reporting, logging? Surely these are part of what a proper platform should offer, yet none of them do. It is pretty sad when at least one GUI toolkit (QT) feels the need to include a networking API.

    • Because you don't want to use differents API for DNS lookups on different platforms, you want to "write once, run everywhere". Considering the above-mentioned Qt already exists, I thought this was a solved problem, but apparently Chrome-fans have to reinvent the wheel.

      • by amorsen ( 7485 )

        So your proposed solution is that every platform should just include QT networking? Fair enough. It would certainly be an improvement. It would be nice with a C API as well though.

      • by tibit ( 1762298 )

        Exactly. Qt is an application development framework. Networking is done differently on every fucking platform.

  • by w_dragon ( 1802458 ) on Saturday January 18, 2014 @11:05AM (#45998229)
    This guy talks like this is some new idea, but there are excellent libraries that already provide this stuff. A quick look at the list tells me that boost and openssl cover most of the functionality, and unlike chromium they are made to be libraries, so you can be pretty confident they work under all conditions and the developers won't screw around with the api between versions.
  • by TheloniousToady ( 3343045 ) on Saturday January 18, 2014 @11:08AM (#45998249)

    Though I found TFA interesting, it seemed like actually doing what it suggested would be equivalent to learning a large new cross-platform API. Compared to the familiar wxWidgets, QT, and GTK+, the Chrome API may have some advantages in terms of features, but I doubt it would be nearly as well documented. It would probably be a pretty big mountain to climb.

    Regardless of which of these things you adopt (or even Java), you always have the basic problem of learning a large API, so it's hard to commit to more than one of them. So, although the idea of using the Chrome source as a cross-platform API is interesting, I wouldn't actually get involved unless it offered something that I actually needed which the other cross-platform toolkits didn't already provide.

  • by account_deleted ( 4530225 ) on Saturday January 18, 2014 @01:08PM (#45999061)
    Comment removed based on user account deletion
  • by istartedi ( 132515 ) on Saturday January 18, 2014 @02:58PM (#45999771) Journal

    10 years ago, you just whipped out your Visual Studio when you needed a client application, but not anymore.

    No. I whipped out Visual Studio and created a header called plat.h and a source called plat.c. There were no more than 2000 lines devoted to platform issues, vs. something like 40k for the whole thing at its largest point. They allowed my application to run on Windows, Linux and FreeBSD. And yes, it did threads and networking! It used pthreads on Windows, and it worked very well. Eventually, the kernel module component (yes, kernel module) ran on all 3 systems in kernel mode. The plat.h/plat.c business never got out of hand. It was pretty manageable. At some point, we interviewed a manager who wanted us to switch to Eclipse, and couldn't understand how I could do what I did without using Java. Fortunately he was not hired.

  • At work we use Skia, the 2d drawing library for Chrome/Android, in a server application, to render charts and graphs based from seismic data into png images.

    The library is a fairly light weight dependency, lightning fast and designed to take advantage of the power of C++, rather than sticking to a C api. However, dealing with Google's custom build system and the relatively sparse documentation made getting started a bit harder.

    Depending on the kind of application being built, I would definitely consider tak

"Protozoa are small, and bacteria are small, but viruses are smaller than the both put together."

Working...