Chrome Is the New C Runtime
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 is how bloat begins: with an apparently clever insight that ignores actual common sense.
"Place me in the company of those who seek Truth, but deliver me from those who believe to have found it."
How big is chrome?
$ls -lh /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.17 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.17
-rw-r--r-- 1 root root 953K Apr 15 2013
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.
SJW n. One who posts facts.
Chrome is a complete OS running on top of another complete OS.
...the fuck?
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.
SJW n. One who posts facts.
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
?
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.
So Google.. the company that made such a huge thing out of HTML5 and how they hated flash and wanted to do away with plugins..
Have now made their own plugins? That only works in their own browser.. But don't worry! They own it, and they say it's the best, so it's apparently quite all right...
"The more things change, the more they stay the same." I think is the line.
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.
When I think "business logic" I'm usually thinking "RDBMS interface".
What does Chrome's library do to deal with business data?
Nothing.
I do not fail; I succeed at finding out what does not work.
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.
I run: Windows, OS X, Linux, FreeBSD. Just because you have a hammer, doesn't mean everything is a nail.
At concealing ads as actual articles. The AI is getting smarter. Fuck!
For those of you who don't know, NPAPI is the common interface used by several browsers that allowed plugins to be written: Flash, Silverlight, Facebook Video, etc. Lately there's been a lot of talk about NPAPI being blocked by default, and will be completely removed from future versions of various browsers. While there are plenty of issues with this standard (The least of which is noticeable because the N stands for Netscape), everyone's solution seems to be a resounding "We've got our own new, similar way to do this that offers X, Y, and Z, is better because of this, and if you want to participate in the future you should use it.
Just googling replacements for NPAPI gives a huge list of new alternatives, each of which seem to be supported by only one browser. As a developer, I'm not looking forward to this.
Chrome Is the New C Runtime
No, it's not. Use the proper APIs on your target systems. But considering the authors name is Sanjeev Radhakrishnan and he's blogging "from the uncloud", what did I expect?
Well, the secretive undertones of the can are about to temper at some point anyway. Why not simply adjust to the tougher hue and dispatch the categories of mirror images.
Hmm ... What ???
Seems like a recipe for disaster.
I've calculated my velocity with such exquisite precision that I have no idea where I am.
This is how bloat begins: with an apparently clever insight that ignores actual common sense.
Yeah, and soon we'll need i7s to run 'Hello World'.
10 years ago, ...
and ..
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.
20 years ago, Java was invented to do all of this and it has been tested even MORE than Chrome.
Geeze! I think all CS programs should have CS history. What next? Someone is going to 'figure' out how to page memory?
I have this idea to allow objects to be moved without having to pick them up or slide them, it's based on a circle, it called a Pi Mover (TM) and with an Axel (TM - NOT axle) and another Pi Mover, you can amplify your strength!
Yep, I'm looking for VC funding ...
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.
Everybody love non-native controls!
http://youtu.be/X7b0AwVTx8g?t=31m10s
1. logically it just semms stupid to have a non-network related application dependent upon chrome source code.
2. there exists already battle hardened and well tested libraries ideally suited for cross platform development. think libevent.
3. those libraries which are open soured have extensive support and are thus not dependent upon some large corporate entity.
4. yes, there are applications, such as medical imaging applications, which have fuck all to do with a network and should in fact not access any network of any kind.
5. c++ , driven by boost development, has undergone a revolution in the last couple of years which means that platform issues, while still a concern, are not the disaster that they once were.
6. the author of the article use to work for google.
7...you get the idea
What the fuck? Are you seriously claiming that Java is less bloated that the C and C++ libraries underlying Chrome?
Come on. Have you ever worked with the JVM? It is by far the slowest, ugliest, most bloated cross-platform runtime there is. Java makes Mozilla's XUL/JavaScript monstrosity look clean and efficient!
A lot of hipsters will claim "The JVM is a great runtime!", but that's only because they're neck-deep in the latest Scala and Clojure crap, and they're resorting to the most unrealistic and misleading micro-benchmarks known to mankind to support their nonsense claims. They also have never used C or C++, and really have no idea what efficient software without any bloated external runtime is actually like.
Java isn't even that portable compared to C, C++, or even Python, for crying out loud. Modern versions of those run on systems where no JVM exists, or if it does exist, it's an ancient version from years ago.
At this point, Java and the JVM should be treated as an experiment that got out of hand. Yes, we'll be supporting Java-based software systems for decades to come, but that's no reason to use it for new systems, or to pretend like you do that it's somehow "less bloated" than real software developed using C or C++.
...which C runtime is Chrome using?
I don't want to use a base library supported by a huge ad network, thanks.
They should have chosen Java instead of C++ in the first place.
Write them faggot!
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.
Just a shit new UI design. Come to reddit where it's -6 with no comments:
http://www.reddit.com/r/programming/comments/1vhfys/chrome_is_the_new_c_runtime/ ;-)
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.
Finally! A year of moderation! Ready for 2019?
i would not call this c runtime , this is huge library for programming . not "C Runtime" specifically
(nt)
There is a very efficient, hardware-assisted Java runtime available from Azul, but that pretty much just proves your point. You need dedicated hardware to make Java scream.
Modern C++, if you're not dumb about how you use it, lets you avoid all of the C's unsafety, automagically, and it can enforce many safety constraints for you at compile time, too. I don't really understand why anyone writing big, scalable server applications would want to use Java when running the same stuff on C++ will cost you less in datacenter power & cooling.
A successful API design takes a mixture of software design and pedagogy.
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.
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.
Azul stopped chip development a few years ago. They found that the speed benefits in GC with their custom hardware were offset by the fact that everything else was slower than on a commodity x86 chip. They now primarily sell x86 systems, and do some insane stuff with the page tables to make the GC fast.
I am TheRaven on Soylent News
Thanks for resetting my mind. I was a bit stressed today, but after reading this I don't even remember why.
WTF did I just read?
Pretty stupid headline for someone saying "we're getting good mileage out of using the libraries that Chrome uses". So has my company, and we're not limiting ourselves to Blink/V8 - there's also Gecko, Webkit, and a whole WORLD of software out there. Standardizing on just the Blink libraries because they're convenient is a recipe for disaster.
Qt is. HTH.
Holy moley, I can't believe what I'm reading.
Your claimed "2x performance gain" is usually actually 10 to 15 times, for real-world software written in C++ versus Java, and 25 to 50 times for software written in C++ versus JavaScript or Ruby.
Don't bother trotting out your totally unrealistic Fibonacci sequence micro benchmarks where some Rubyists or Javaists have spent months highly tuning some Ruby or Java code so it's only 5 times slower than the equivalent unoptimized C++ code. That's not the kind of Ruby or Java code that exists in the real world.
And modern C++ is an extremely efficient language to program in. Maybe you're ignorant of C++11, but it adds many high-level language features that we don't even see in Java yet. C++ also has very mature tooling and libraries which further makes it very fast to develop with.
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?
The code isn't the same so long as 1. HTML5 prefix hell is allowed to continue and 2. companies like Apple continue to deliberately leave things like WebGL and getUserMedia unimplemented.
> "Out of necessity, the Chrome team has created cross-platform abstractions for many low-level platform features.
like java
> 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.
like java
> Most importantly -- Chrome code has been battle-tested like almost nothing else,
> with an installed base in the hundreds of millions.
like java
so I kind of dont see a difference to just using what would be considered a higher-level language.
A good 10 years ago now (or was it 11?) the Mozilla folks were touting the "browser is the platform" and suggesting that people right their applications to target the browser to get cross-platform portability.
They had a good point, since Firefox was and is cross-platform.
Stick Men
Start your own router business and build it then sell it if you could do better!
Depends on your definition of bloat, C and C++ there does seem to have a lot of CODE BLOAT!
Mozilla was being used as a platform more than 10 years ago; not the browser but the framework underlying it which powered the browser, email client, irc chat, etc. I remember seeing a few books on it before Chrome even existed.
Apache has been running on everything forever; one could say similar things about using Apache for writing server software... in fact long before Chrome they made the common elements into a library called the Apache Runtime Library.
Lets not forget all the general frameworks out there which are not without their own complications but they are DESIGNED for this purpose instead of a spin off side project that is closely coupled to a single purpose.
All that said, making an HTML5 app with hooks into a browser engine looks to be the most portable with the least long term maintenance (aside from the issues with javascript - which are more style than language related, just like C++ it gives you plenty of rope with which to hang yourself.) More labor upfront, you bet it is... but to support every device quickly and not have to suffer every system upgrade (and support many versions of systems,) it probably pays off - more so with time.
Democracy Now! - uncensored, anti-establishment news
But talk about 3D printers or private space colonies, and there are no skeptics, because software got better, therefore everything gets better.
As a web developer I like to use standards and expect every browser to honor them.
IE and Webkit (therefore Safari and Blink based browsers) do not. When firefox and opera (pre-blink) work, chrome has a weird display bug and IE crashes or hangs. At least that's my experience with chrome so far.
They emulate their hardware in software. So their GC is highly concurrent, reducing latency, but on the whole their JVM is significantly slower than others.
This leads to the new 'thin client' model. A business can have fat servers storing user data in an LDAP format, and users at the business connect with a thin client like a Chrome laptop. Users get all the performance they need, data is secure on company servers, no need for IT to ever have to visit users because their system is 'messed up'. Better, licensing costs are zero, the business can upgrade or not as they desire. The software 'just works'.
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.
For all intensive purposes, "whom" is no longer a word. That begs the question, "who cares"?
They want CICS and 3270's back.
Oh wait.. they never went away..
It isn't that insane. Instead of remapping one page at a time the queue up a number of changes and commit them all at once. This is because on stock Linux every page table re-map creates a lot of cache coherency traffic to make sure all the processors know of the new mapping. By committing them all at once they only need one round of that.
http://www.azulsystems.com/sites/default/files/images/c4_paper_acm.pdf
Section 5.1 is where it starts going into some details on that.
md5sum
d41d8cd98f00b204e9800998ecf8427e
Hand-coded assembly in COM format running on DOS and crashing if everything isn't set up as and you don't input exactly what the programmer expected, basically. Good riddance.
Forget magic. Any technology distinguishable from divine power is insufficiently advanced.
Sorry, but which version of Gtk? Gtk3 is pretty much incompatible with Gtk2. so I've stopped paying either version much attention. (The last time I checked, Gtk3 had mad many of the things I was doing with Gtk2 not work, so I stopped active development on the Gtk projects...or switched to other libraries. Admittedly that was several years ago, but I haven't heard many people singing the praises of Gtk since then. Qt, yes, and it has many nice features, along with some I rather dislike, but not Gtk...of course Qt is C++. There's much to be said in favor of C libraries, I'm a lot less convinced about much to be said in favor of Gtk.)
I think we've pushed this "anyone can grow up to be president" thing too far.
Because as the size and age of the codebase grow towards infinity, the chances of at least one dumb person touching it grow towards one.
Limiting damage from dumb mistakes is more important than absolutely best efficiency. That's true for all projects, not just programming. It's pretty much the definition of Murphy's Law.
Forget magic. Any technology distinguishable from divine power is insufficiently advanced.
Pussy. If you want REAL performance gains, you'd write in Assembly.
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 taking advantage of other parts of the Chrome libraries, although they'd have to provide functionality not in Boost or QT.
In a somewhat related bit of news, Google recently emailed me to let me know that they were no longer going to support the desktop notifier, that tool I use each and every day to let me know I have mail. However, Google went on to tell me, I could get that functionality back if I switched to Chrome.
I'm not going to switch to Chrome. Zero interest. Nice try, though, Google.
Here's the meat of it:
I've fallen off your lawn, and I can't get up.
Oh, another one who uses cloaca.lib -- yeah, not only warmer, but you get aimed results and splash damage.
I've fallen off your lawn, and I can't get up.
I'm a C programmer but I use XUL to hack at websites. It's a very fine stuff. What's your problem w/ Xul?
If you're a startup with a small team, you damn well better have a competent team, and a team using Chrome ain't competent.
If you're a startup with a small and competent team, you'll write your native cross-platform application in C++ with Qt, and have a vast performance advantage over Chromeshit in addition to access to a vastly greater feature set.
You seem to be missing a dose of reality. A quality product at a discount price typically cannot compete with established manufacturing, distribution and advertising channels. It requires deep pockets and order of magnitude value improvements to succeed against an entrenched player. That's why we don't have flying cards and a Mars colony. Competition is so inefficient as an economic organizing principle that it is literally killing millions every day. Perhaps the only worse principle is central planning.
-I like my women like I like my tea: green-
I prefer D, myself. C++ has its own set of huge, very serious problems.