Why Apple, Google, and FB Have Their Own Programming Languages
An anonymous reader writes: Scott Rosenberg, author of Dreaming in Code dissects Apple's Swift, Google's Go, and other new languages — why they were created, what makes them different, and what they bring (or not) to programmers. "In very specific ways, both Go and Swift exemplify and embody the essences of the companies that built them: the server farm vs. the personal device; the open Web vs. the App Store; a cross-platform world vs. a company town. Of all the divides that distinguish programming languages—compiled or interpreted? static vs. dynamic variable typing? memory-managed/garbage-collected or not?—these might be the ones that matter most today."
So Apple named a language "Swift", Google named a language "Go", and Facebook named a language "Hack"?
Obviously it's not just the dirty FLOSS hippies who can't come up with decent software names.
New programming languages props up the publishing industry by producing dead-tree door-stoppers that detail the new programming language. I stopped buying dead-tree door-stoppers years ago, cleared off the bookshelves and get the ebook version.
Comment removed based on user account deletion
If I give you an algorithm, throw a dart at a page of programming languages to select one and if you cannot implement that algorithm in that language then you are nothing but a code monkey.
A computer scientist can implement any algorithm in any language.
Why are these companies using their own languages?
Coder lockin. That is the only reason to have your own language.
Work a few years at XYZ company working on their proprietary algorithms in their ABC programming language?
Good luck getting another job.
See, they learned the hard way with their stuff in Javascript - common language and coders - uh, I mean Javascript engineers - left for greener pastures because so many other companies were using that language.
real men have their own programming language, that's why!
Like how they used to say in the chip business, real men have their own fab.
While Mr Rosenberg claims that Go is distinguished by its approach to concurrency, his section 'The Essence of Go' is almost entirely devoted to the trivia of braces and semicolons. Yo won't learn anything about Go's approach to concurrency here.
I assumed it was a case a Not Invented Here Syndrome.
Outside of their respective organizations, I'm not sure these things are really catching on. Adoption of Go seems to have come to a standstill. Uptake of Swift has been kindda slow. And Hack seems to been ignored even by dedicated underground computer hobbyists. As well as lumberjacks.
Then Red Forman would be the mascot for Swift.
As in, a swift kick in the ass. Dumbass.
Get free satoshi (Bitcoin) and Dogecoins
Swift needed to be created because Objective C stinks, and no other modern language would have fit smoothly into the Smalltalkish legacy of the Cocoa framework. I'm just glad that the Apple fanboys who constitute most of my fellow iOS developers are finally allowed to believe bad things about Objective C, at least now that there's a nice alternative. Made me a little sick before to hear people praising Obj-C while writing reams of ridiculously verbose code that nobody will want to maintain 5 years from now.
Go is a fantastic language for server side development with concurrency that's not painful to wrap your head around, and is perfect for cloud development in Google's world.
Won't comment on Facebook Hack, since it's not clear to me why Facebook itself needs to exist. But to each their own...
http://en.wikipedia.org/wiki/A...
>. A computer scientist can implement any algorithm in any language.
ou CAN pound a nail with a screwdriver. You can even pound a nail with a saw. A hammer is a much better, more efficient tool for that job. If you need to install hundreds of nails, a nail gun is a much better tool.
I COULD use VB to convert one type of XML to another, but I use xslt (true xslt, not loops) because it's a better tool for the job. I use several languages each day, selecting the one best suited for the task at hand.
> if you cannot implement that algorithm in that language then you are nothing but a code monkey.
If you DO implement all algorithms in your favorite language (JavaScript?!?!?) ... well, you're like the "contractor" who owns nothing but a hammer, and says "I can't do it with a hammer..."
PS - generally there is one condition that decides whether JavaScript is the best choice . JS is the best choice if and only if that's the only possible option. For client-side logic in a web page that needs to work in multiple browsers, it's the best option because it's the only option. Anywhere else, there is probably a better tool for the job.
safari books online.
www.safaribooksonline.com
imho certainly worth the money...
These all strike me as iffy use cases. What is more compelling is creating a language for some more-specific need. These are generally referred-to as Domain Specific Languages, or DSLs (not to be confused with trying to push high-speed internet over a twisted pair...)
I designed one and implemented a compiler and interpreter for it in the early 1980's. It's not all that hard. I had had one compiler construction course in college. I used classic tools Yacc/Lex/Prep and wrote it in C.
The language is (was? haven't followed) called VSL, or Variation Simulation Language.
The problem was this: in the early 80's auto companies were experimenting with variation simulation. It's simulating the build of complex mechanical assemblies so that the effects of dimensional variations can be analyzed. The technique was developed at Willow Run Labs during WWII, as part of the solution to the awful-quality airplanes they were building for the war. They gathered experts to fix the problem, and they used this technique. At the time, it was done by a room full of woman working Friden mechanical calculators...
So, in the early 80's there was some Fortran code written by a university professor that ran on a mainframe. I worked for a company that set out to commercialize it. My first task was to port it from the mainframe to IBM PC.
Two problems: Models were written in Fortran, and then linked against a library. Fortran is painful, for anything. It's especially painful for manipulating representations of 3D objects. And compiling and linking Fortran on a PC was slow! Half-hour builds! And that's just to find you had a syntax error and then rinse and repeat.
My boss wanted to build a "menu system" that engineers could design in. Keep in mind, we are talking 80's and this was just to be a scrolling text menu. Yes, there were graphics workstations, but this was a new untested product, and nobody was going to pop the $20,000 that they did for, say, finite element workstations. they wanted it to work on a PC so that we could more easily convince the auto companies to try it - make it an easier decision to give it a go.
He wrote up the menu system, and presented it to us in the conference room. He rolled-out a roll of paper the length of the conference table, and then it hung over both ends! I convinced him that the time for this approach had not yet come.... Sure, point and click on graphics - but he couldn't afford either the time or money for that development. But not that silly long-ass text menu!
The alternative was VSL. It was specifically-tailored to the task, it had "objects" of a sort - and by this I mean "3D objects". You could just pass a fender around in a function call, for example.
It didn't compile to machine code, but generated bytecode. I wrote an interpreter in Fortran, and so eliminated the costly link step. The Fortran program just read the bytecode into an array and interpreted it. Was it slow? No, it was fast as heck! That's because almost all the work was done in well-optimized library functions written in Fortran or even assembly in some cases. (I also talked my boss into hiring an actual mathematician who fixed our broken edge cases, and knew the right heuristics to speed things up.)
This made it much easier for engineers to create and use models. Now they wrote them in VSL, much more expressive to the task than Fortran. And in a minute they either knew they had a syntax error or were testing their model.
In a couple years, we went from a couple of pilot projects to like 50. Every auto company took it up. Boeing used to help re-engineer the FA-18. Today probably every car, airplane, and hard drive was analyzed using VSL. (Siemens wound-up with the product eventually, after a few acquisitions.) I don't know if VSA is still under the hood, or if it really has any practical use today: the models are now written using point/click/drag/popup stuff on drawings. What my boss new we had to eventually get to, but couldn't at the time.
Of the languages mention
Go does not see significant use, even at Google. It's one of the allowed implementation languages, along with Python, JavaScript, and C/C++, but it doesn't see a lot of uptake internally at Google.
so that developers (including Apple's developers!!) can chose a transition timeline entirely at apples discretion to change everything yesterday and not tell you til next month.
Like when Bell Labs developed C to write Unix? There's a long tradition of major companies coming up with new languages to scratch an itch. Thank God is hasn't died. How boring to live in a time when we'd decided that there was nothing left to innovate?
Dewey, what part of this looks like authorities should be involved?
Go is an open language and was created because while Python was very useful to Google, it was also quite slow. Hence they wanted a faster and more parallel version of Python (which runs single threaded even on multi-core CPU platforms).
Swift was baldly needed because the time taken to write an ios app in objective-c is too long. Also Apple does not want your iOS app to be easily portable to other mobile OSes (lock-in).
The NIH mentality and largely the spirit behind what open source is. Can some other tool do it with a new api or plugin and do 99.9% of what Hack, Go or Swift does? Probably. Does this concept of a new forked language or an entirely new solution prevent changes from going back upstream? Absolutely. But it enables those involved to take risks and to experiment with things that they may not have otherwise been willing to consider, and to spur ideas and innovation from others; maybe even helping to advance our state of technology a bit.
Thirty four characters live here.
If only there were some cross platform language that could interop with Swift that you could use to write the code you wanted to be portable.....
How portable do you think an Android app is to any other mobile platform?
Have you read the bit about "Concurrency is not MultiProcessing" (or something that means the same thing). Go is a single threaded language, which is concurrent but not multiprocessing. So there's basically no payoff in many cases from using it, and you've got to run it through an interpreter (unless you use the gcc version).
So why bother?
I think we've pushed this "anyone can grow up to be president" thing too far.
Sounds more like linked-in got hacked, and this hack could be used to sign into Slashdot.
I think we've pushed this "anyone can grow up to be president" thing too far.
I'm guessing here, but you could port your java android app to a mobile windows .net app. The java and .net APIs may be different, but both languages are remarkably similar.
Other than a handful of obvious edge cases (the worst of which were fixed with fast enumeration and string and number constants), I'd argue that it mostly isn't Objective-C that is too verbose, but rather the Cocoa APIs themselves. And you'll be using those same ginormous scrubtheKitchenSink:withBrilloPad:andCleanser:byHand:usingExcessiveForce: methods in Swift, just with slightly different punctuation....
Check out my sci-fi/humor trilogy at PatriotsBooks.
Won't comment on Facebook Hack, since it's not clear to me why Facebook itself needs to exist. But to each their own...
My understanding is that Facebook needed a more statically-typed language (while still preserving the familiar syntax of PHP) in order to exploit more performance advantages when compiling their code to the HHVM, which started off as a PHP compiler.
I agree carpentry is inappropriate. Should've been a car analogy.
Libraries aren't the issue, it is the choice of primitives. The reason shell scripting languages are so pleasant for system administration is because files are a primitive. cp /X1/X2/X2 /Y1/Y2 working is huge in simplifying the code conceptually. That's why DSL's exist, to allow programers to work with better primitives.
In the case of Swift the primitives are Cocoa data structures. And there wasn't another high level language with those primitives.
I said it is the best choice for client-side processing on web pages, because it's the only plausible option. Where other options exist, the others are probably better suited to the task.
If you disagree, can you come up with a counterexample, any scenario where you'd consider using something other than JavaScript, but decide JavaScript is better than the alternative? I'm curious what solutions could be worse than JavaScript. As stated in what you quoted, I do mean solutions - things that would work, but not work as well as JavaScript.
, and you've got to run it through an interpreter
My god... did you... what?... Ok... this guy doesn't know shit about what he's talking about. Go is compiled.
If Apple had moved to a whitespace-active language I seriously would have switched to Android development.
Not even joking. I have used a lot of languages professionally and for fun, but I could not get past that aspect of Python and I can't see why such an insane design flaw would be any more tolerable in Nimrod.
It has so many dangers in terms of correctness and overlooked bugs...
There was one other language that bugged me in... Fortran... but at least there is only affected what was a comment, it didn't oversee control flow.
"There is more worth loving than we have strength to love." - Brian Jay Stanley
Yeah really. Why is the text set to 18 point? What's with the ugly graphics that just get in the way? I used a firefox plugin to disable CSS and scrolled down til I found the text. At least it was readable without resorting to a full screen browser (why do people work like that nowadays??!)
You could have said the same thing with a lot less words had you phrased it as:
No, I can't think of even one application where you'd consider two languages and decide JavaScript was better for that application.
I didn't say JavaScript doesn't have a lot of features. It does have a large mishmash of features. I said it'll almost always be the worst choice, if you have any other option.
> its intended purpose, making it exceptionally well-fit for the web.
It's the ONLY choice for client-side web. As I said twice before, that's the one place nothing is worse or better - because you have no other choice.
> Java
Since neither iOS nor most Android devices run Java applets, that means MOST users today won't run them. A "solution" that won't run at all for most users isn't a solution. You can't say "Java and JavaScript would both work, but JavaScript would be better".
If you're advocating JavaScript as a server-side language, well that's just silly. Learn any language designed for server-side and after you understand it tell me JavaScript is better suited.
> (Other popular criticisms stem from pure, unadulterated, ignorance: The behavior of this, for example.)
If a key component of the language behaves in unintuitive, surprising, and troublesome ways, that's a valid criticism. See "principle of least surprise".
You've made some good points, and ones directly responsive to my statement this time. That is true, once upon time Java was a serious option on the client side and it did have the hype. So much so that Livescript was renamed JavaScript to take advantage of the Java hype. JavaScript won, against actual competition. Ps I WAS around during that time, and I've written ActiveX controls for use on public web pages. JavaScript beat both ActiveX and Java in the browser.
The PayPal link is interesting as well. I was curious what their reasoning was, given the plethora of server-side languages, why choose one that's very much designed for a very different role in a very different environment, with very different constraints? They said the primary reason was so that there front-end Javascript developers could also author the matching server-side portion. That's interesting and a little surprising to me. Note one subtle distinction that may not be important except in the context of this thread - they did not say - JavaScript was best suited for the role of server-side development, they said that they wanted a particular team to do server-side and that team only knew JavaScript.
It turned out that for PayPal, Javascript did the job just fine for them. So I'll revise my statement:
If all you know is JavaScript, it might be enough to get the job done.
If it's client side web browser code, JavaScript is the only workable option because it beat Java in this role.
Otherwise, where you have a choice, JavaScript is NORMALLY not the best suited for any role other than client side web page code. Exceptions may exist.
I had assumed that:
meant that the go compiler was basically a "byte-code compiler", and that this code was run through an interpreter.
By "byte-code compiler" I actually mean it was used to generate a bunch of calls to library routines that did the actual work. I wasn't actually presuming that the op-codes were single bytes, as I consider that irrelevant.
The claim that "it runs as fast as C" is one that I've heard most interpreted languages since Java make, so I pretty much ignored it. I did note that they considered the LLVM to be too slow, but I interpreted this as meaning they build a customized virtual machine.
OTOH, the gcc version of go does compile to machine code, so there's nothing inherently improbable in it actually compiling to machine code. That's just not the way I read things. (I also think of Java as an interpreted language, and Python, and Ruby...though at least in the case of Java and Python the more technically correct phraseology is that they are compiled to a virtual machine.)
For that matter one could say that UCSD Pascal was compiled to a virtual machine, but it was always called an interpreted language.
I think we've pushed this "anyone can grow up to be president" thing too far.
Not only that, but I think it is more relevant to developer lock in to a particular platform. Just like C# and Apple, and say porting video games from Xbox to Playstation. They want exclusivity on applications developed for their particular platform. This is nothing new. It is just a way to exclude competition to their particular market, and to prevent or at least make it more difficult to get the same functionality from a competing service.
As probably many people mentioned, any coder worth their salt can use or learn any new language without too much effort. Coders with multiple experience would of course have an edge.