My platform, my eco-system, my language
Sometime back Facebook launched Hack.
A modern version of pHP which lets developers mix both static and dynamic typing thereby making it easier to manage and write error free code.
The other reason for Hack was that pHP needs a lot of servers to run all code vis- a vis Java which is a statically typed language. You can’t move as fast with these languages ( e.g. Java) because you have to compile code before running it. However, you need fewer servers to run your code, and in the long run, it’s easier to manage what you’ve built.
WIth Hack, you can have a bit of both. A mix of static and dynamically typed languages which allows you to manage code and run it on lesser servers. Also it’s proprietary to Facebook and is coding language to which Facebook is slowly changing its platform. What it means is that in due course of time, application developers will need to learn Hack to code on Facebook’s API and create applications that are native to its eco-system. Sure pHP will still work, but when a program does API call outs, then even small changes in code may make it very difficult to complete the run flow or pass data. Unlike other statically type languages, Hack can run without compiling. You can edit a file, reload a webpage and can immediately get the feedback - “Here’s what the page looks like after I made that change.”
There is no delay. You get both safety and speed.
But Hack, while created as an update to pHP, is actually replacing the entire pHP code as we see on Facebook today.
It’s Facebook’s platform, creating Facebook’s eco-system , written on Facebook’s language.
And this is not a one-off.
It is a trend.
Today, Apple launched Swift at WWDC. Basically a new programming language to replace Objective C as the de-facto language to write code for iOS and MacOS apps.
Now those who have coded on Objective C, they will know, it’s not easy to pick up. Takes patience and time and without knowing it, you cannot really code good iOS native apps.
Sure in today’s world you can go HTML5 and create a basic web app and then publish it using Phone GaaP or something similar on iOS platforms, but the experience is nowhere close to what it can be when you go native.
Ironically, Swift looks to take a page out of this book - make it easier to code applications, so that more developers- even non developers can start coding.
The barrier of entry to Swift is relatively lower compared to Objective C. Mostly because Swift builds on the best of C and Objective-C, without the constraints of C compatibility. Swift adopts safe programming patterns and has a clean slate, backed by the Cocoa and Cocoa Touch frameworks, presenting an opportunity to reimagine how software development works.
This means that developers can now create native iOS apps by writing much less code on Swift than grapple with Objective C. Even non developers with a bit of endurance can pick up Swift and create apps on their own.
This is because of the change in Syntax . Since Swift is a script it doesn’t need to be compiled into a syntax which the computer understands to be executed ( like Objective C)
Much like Python- when you use Swift , it executes as its written, line-by-line thereby giving developers ( especially those making games - real time input on changes the code is effecting)
So then why the fuss on creating a new script? Why not just use Python.
While Python is easy to write and easy to test, it isn’t particularly powerful and generally doesn’t perform well when it comes to complex codes in games et all - i.e. not ideal when you’re writing, say, a game that needs access to the full power of your device.
Traditional programming languages, like Objective-C, give better access to the power of the device and enable the creation of more comprehensive apps, but are difficult to learn and tedious to compile and test.
Swift promises to have all the good with none of the bad. Apple promises that, at least in a few key benchmarks, it is considerably faster to execute than Python and faster even than Objective-C.
Apple already had a closed eco-system. It had its own platforms.
Now it has it’s own language.