.net programming, computers and assorted technology rants

Archive for March, 2014

Pic of the Day: 10 Years of Social Media

Courtesy Mat Smith, Engadget

Advertisements

Is Hack the Programming Language of the Future?

Courtesy Cade Matz, Wired.com

Jon Snyder/WIRED

Facebook engineers Bryan O’Sullivan, Julien Verlaguet, and Alok Menghrajani spent the last few years building a programming language unlike any other.

Working alongside a handful of others inside the social networking giant, they fashioned a language that lets programmers build complex websites and other software at great speed while still ensuring that their software code is precisely organized and relatively free of flaws — a combination that few of today’s languages even approach. In typical Facebook fashion, the new language is called Hack, and it already drives almost all of the company’s website — a site that serves more than 1.2 billion people across the globe.

“We can say with complete assurance that this has been as battle-tested as it can possibly be,” says O’Sullivan, a veteran of iconic tech companies Sun Microsystems and Linden Lab who has long played an important role in a popular language called Haskell.

O’Sullivan and company publicly revealed their new language this morning, and at the same time, they “open sourced” it, sharing the technology with the world at large and encouraging others not only to use it, but to help improve it.

The software world is littered with programming languages, and new ones appear all the time. But according to some who have used it or who know the past work of those who built it, Hack has a design and a pedigree that immediately set it apart. “If Bryan O’Sullivan built it,” says programming guru David Pollak, who only yesterday heard about the new language, “I would walk across hot coals to use it.”

In the Beginning

When Mark Zuckerberg started work on Facebook in late 2003 — a moment recreated to such great effect in the Hollywood film The Social Network — he used a programming language called PHP. It was one of the most popular web languages of the day — a language that let you build and rebuild sites with extreme speed. PHP is what’s called a dynamically typed language. Basically, this means you needn’t take the time to define specific parameters for each and every routine in your code, and once you finish a piece of code, you can almost instantly run it — without taking additional time to compile it into another form. The code essentially compiles in the background, as you write it.

The new language is called Hack, and it already drives almost all of the company’s website — a site that serves more than 1.2 billion people across the globe.

For the next decade, Zuckerberg and his rapidly growing company continued to build their site with PHP. It suited “The Hacker Way,” the Zuckerberg coding philosophy that encourages engineers to constantly look for ways of improving the technology at hand. But eventually, as Facebook expanded to hundreds of millions of people, the language started to show its limitations. As a PHP site grows, you need far more computer servers to run the thing than you would with other languages, and it can be difficult to manage all your code and keep it free of bugs.

At a certain size, you’re better off with statically typed languagessuch as Java, where you’re required to carefully define your variable types. You can’t move as fast with these languages — you have to compile code before running it — but you need fewer servers to run your code, and in the long run, it’s easier to manage what you’ve built.

Last year, after a brainstorm from three top engineers, Facebook solved the server problem by running all its PHP code on a new software creation called HHVM, short for Hip Hop Virtual Machine. HHVM was a new foundation for the Facebook website, letting the company run its site on significantly fewer machines. Now, with Hack, their new programming language, Bryan O’Sullivan and his tiny team have solved the other problem. Hack makes it easier to manage code and eliminate errors.

“It arose out of a desire to improve the efficiency of our developers,” says the Irish-born O’Sullivan. “As our engineering team grew, their own jobs were becoming more complicated because PHP is a dynamically typed language. It made it harder for them to easily apprehend the consequences of some of the work they were doing.”

The New PHP

You can think of Hack as a new version of PHP. It too runs on the Hip Hop Virtual Machine, but it lets coders use both dynamic typing and static typing. This is what’s called gradual typing, and until now, it has mostly been an academic exercise. Facebook, O’Sullivan says, is the first to bring gradual typing to a “real, industrial strength” language.

What this means is that Facebook was able to gradually replace its existing PHP code with Hack — move from the old dynamically typed system to a statically typed arrangement. “It allows you to slide the dial yourself on the continuum between dynamic types and statics — so you can start out with dynamically typed code and then gradually add more statically typed code, benefiting from each little bit of work you do as you go along,” O’Sullivan says.

In doing so, he explains, Facebook built much more precise code — code with fewer flaws. Hack provides a kind of safety net for developers. What’s more, engineers can more easily understand code when they revisit it. Static typing acts a lot like documentation.

But the big trick is that Hack provides these benefits without slowing down the developer: Unlike other statically type languages, Hack can run without compiling. “You edit a file and you reload a webpage and you immediately get the feedback of: Here’s what the page looks like after I made that change. There is no delay,” O’Sullivan says. “You get both safety and speed.”

hack screen

Nils Adermann, a software engineer and the co-founder of a company called Forumatic, has used the language, and he says he knows of nothing else quite like it. James Miller and Simon Welsh, engineers at a company called PocketRent, who have also used Hack, agree. The closest thing, they say, is Haskell, a statically typed language that provides a way of executing code relatively quickly. But Hack, they indicate, takes the idea much further.

Hack will be particularly attractive, Adermann says, to existing PHP shops. “Ironically,” he says, “its chief advantage is how little it differs from PHP.” Like Facebook, these shops can gradually move their operations from one language to the another. But Adermann also believes that some developers will adopt the language even if they’re not already using PHP. “While PHP is the most widely used language on the web, it’s unpopular in many places because of its inconsistencies,” he says. “Hack addresses these … and thereby makes the language more attractive to users of other languages.”

But the biggest endorsement for the new language is that Facebook already uses it to run its own site, the world’s most popular social network. It’s not every day that a new language debuts with such an impressive track record. Some, however, question whether Hack should really be called a new programming language. There’s a fine line here between an update to PHP and a replacement for PHP. Where does Facebook draw that line? “That,” Sullivan says, “is a good question to discuss late at night over whiskeys.”


Kinect for Windows version 2 hardware

Courtesy Mary Jo Foley, zdnet.com

kinectforwindowsv2sensor

Microsoft is inching closer toward releasing the second version of its Kinect for Windows sensor.

On March 27, the company posted images of the new Kinect for Windows v2 sensor itself, as well as the hub and power supply for the device.

The second-generation Kinect for Windows sensor looks a lot like the Kinect for Xbox One, except that it says "Kinect" on the top panel, and the Xbox stylized green "x" is a "simple, more understated power indicator," according to a new blog post. The image of the new Kinect for Windows sensor is embedded in this post above.

The new Kinect for Windows hub and power supply are pictured below. The hub, the top image, accepts three connections: The sensor, USB 3.0 output to PC and power. The power supply, which supports voltages from 100 to 240 volts, is the bottom image.

kinectforwindowshubpower

Microsoft launched its closed Kinect for Windows v2 developer program last summer. Developers received an alpha version of the sensor hardware, along with early access to the software development kit, and a promise of a final version of the Kinect for Windows v2 hardware at no additional cost.

At that time, company officials said the second generation Kinect for Windows product would be available by summer 2014.

Preview participants are experimenting on a range of business and consumer applications that might make use of the updated Kinect. Here’s what some Razorfish developers built as a proof-of-concept with the preview hardware and software.

Microsoft released the first-generation Kinect for Windows product in early 2012.


Facebook Buys Oculus VR for $2 Billion

Courtesy Brad Stone, BusinessWeek.com

I recently wrote about Oculus, which is developing the Rift virtual reality system for PCs. It’s racing against Sony (SNE), which also has its own prototype VR technology, called Project Morpheus, for the PlayStation 4. The Rift, which looks like a thick pair of darkened goggles, lets gamers immerse themselves in a rich, computer-generated 3D world. It’s not yet for sale in stores, but the company just unveiled a kit for developers, which sells for $350. The startup, based in Irvine, Calif., was founded by the excellently named 21-year-old Palmer Lucky. It has one of the most famous game developers in the world as its chief technology officer—John Carmack, the maker of iconic shoot-’em-ups Doom and Quake.

So imagine chatting with your Facebook friends not just via instant messages or VoIP calls, but by settling into a virtual café with them for an imaginary cup of coffee. Or visiting a doctor halfway across the world and explaining your symptoms in a virtual examination room. Remember Second Life? Like that, but with electronic headwear.

For now, the Rift is aimed at gamers. But Zuckerberg seems to be paying more attention to the Rift’s other potential uses. He writes:

After games, we’re going to make Oculus a platform for many other experiences. Imagine enjoying a court side seat at a game, studying in a classroom of students and teachers all over the world or consulting with a doctor face-to-face—just by putting on goggles in your home.

This is really a new communication platform. By feeling truly present, you can share unbounded spaces and experiences with the people in your life. Imagine sharing not just moments with your friends online, but entire experiences and adventures.

Facebook stock dropped slightly in after-hours trading on the announcement. It recently announced an acquisition of text-messaging company WhatsApp for $16 billion.

Oculus raised $91 million from investors such as Andreessen Horowitz. Chris Dixon, a partner at the venture capital firm, said he didn’t quite believe in the Rift until he visited the company’s headquarters and tried it on for the first time. He says he was instantly sold and compared previous attempts at VR to the ill-fated Apple Newton in the 1990s: “People in tech knew we would have handheld computers. The only question was when.” In VR, he added, “The reality is that the technology—like screens, sensors, and software—hasn’t been good enough until now.” (Bloomberg LP, the parent of Bloomberg Businessweek, is an investor in Andreessen Horowitz.)

Dixon’s bet, and now Facebook’s, is that the Rift is the iPhone for virtual reality. And the acquisition gives Facebook a way to combat Google (GOOG), Amazon(AMZN), and others in the hardware business.

It should be noted, though, that while the Rift can unlock new kinds of online social experiences, it also isolates its users in the boring ol’ real world. (I played a few games on a prototype and posted a video of my experience.) While you can presumably interact with other people’s avatars, the Rift also blots out absolutely everything around you—like any friends who might be sitting in the same room. There’s nothing social about that.


Google Releases .NET Framework API’s

Courtesy David Ramel, VisualStudioMagazine.com

The company announced general availability of theGoogle APIs Client Library for .NET version 1.8.1 in a blog post by Dan Ciruli of the Google Cloud Platform Team. "This library is an open source effort, hosted at NuGet, that lets developers building on the Microsoft .NET Framework to integrate their desktop or Windows Phone applications with Google’s services," he said.

He noted that the company tries to make its APIs accessible to developers working with any platform, from almost every language on nearly any hardware, with support for REST, HTTP and JSON. "However, to be truly useful on many platforms, it helps to have a client library–one that packs a lot of functionality like handling auth, streaming media uploads and downloads, and gives you native language idioms," he said.

That usefulness comes in the library’s integration with OAuth 2.0, the capability to stream media uploads and downloads, support of batching requests, and more. "Whether you are plugging Google Calendar into your .NET Framework-based application, translating text in a Windows Phone app or writing a PowerShell script to start Google Compute Engine instances, the Google APIs Client Library for .NET can save you tons of time," Ciruli said.

The library, hosted on NuGet, sports dozens of APIs, letting developers work with AdSense, Blogger, Cloud SQL database management, YouTube features and more. The new .NET library joins other client libraries for Java, JavaScript, Objective-C, PHP (in beta) and Python. Early-stage work is being done on libraries for Go, Node.js, Ruby and the Google Web Toolkit.

A Getting Started page and APIs Explorer are available for developers who want to dive into the new library.

Google said no major changes have been made from the release candidate version, but the documentation has been expanded.

Just one day after the .NET library announcement, Google on Tuesday announced a project to extend Android to the new breed of wearable computing devices, called Android Wear. The company is first focusing on computerized watches, which will provide all kinds of information at a glance, monitor your health and fitness, get answers to spoken questions as with Apple’s Siri and control other devices, among other capabilities. You can now sign up to gain access to a developer preview, intended only for development and testing, while an Android Wear SDK is promised "in the coming months." The preview focuses on notification APIs to help developers enhance their app notifications to create useful UXes. To aid in the development testing, Google is providing a Design Principles for Android Wear page.

Also this week, Google announced a paper to provide information on working with various existing configuration management tools on its Google Compute Engine, a "virtual datacenter" provided via a host of virtual machines (VMs).

"Over the last decade, a vibrant ecosystem of open source tools has emerged to manage the complexity of large-scale compute deployments," said solutions architect Matt Bookman in a blog post. "These tools allow you to deploy changes more rapidly, recover faster from failures, and take unused resources out of service, enabling you to keep your services’ uptime high and operational costs low."

He noted that an existing Compute Engine API and gcutil command-line tool are available for resource management, but technical leads and others might find it useful to also work with tools designed for software management.

"Puppet, Chef, Salt and Ansible are configuration management tools that provide software and resource management," Bookman said. "They are open source and support Google Compute Engine. If your organization already uses one of these tools for managing other systems, we hope to help you get started using it with Google Compute Engine."

This getting-started guidance is available in the recent paper, "Compute Engine Management with Puppet, Chef, Salt, and Ansible." It discusses working with the Puppet, Chef, Salt andAnsible configuration management tools.


.NET to iOS/Android? Microsoft Buying Xamarin?

Courtesy Keith Ward, VisualStudioMagazine.com

Mary Jo Foley’s reporting that Microsoft may be either buying tool-maker Xamarin outright, or making a big investment in the company. It’s all speculative at this point, but this is an idea that just makes too much sense.

Xamarin makes it possible for .NET/C#-focused developers to create apps for the two most popular mobile platforms — iOS and Android — without leaving the comfort of their favorite language  and IDE (that would be Visual Studio, of course). Xamarin has been making these products for a number of years now; they used to be called MonoTouch and Mono for Android, and have morphed into Xamarin.iOS and Xamarin.Android. Xamarin has been churning out frequent updates, and furtherintegrating the products with Visual Studio. I’ve felt for some time that Xamarin would be absorbed into Visual Studio, eventually becoming a transparent part of the IDE.

Note that these reports are only substantial rumors at this point. But the rumors have credibility, at least in part, based on the natural fit of these parts. It’s not the type of head-scratcher that some other deals were. Xamarin and its founders, Miguel de Icaza and Nat Friedman, are serious software developers, and make a serious product that many developers think is the best way to write cross-platform code for the mobile platform (you may have noticed that we think it’s serious enough to have a column dedicated to the topic).

It would also be a forward-looking move for Microsoft. It needs to get iOS and Android developers to use both Visual Studio and Windows Azure, and integrating Xamarin into its core IDE would do that. It would also encourage more development in C# among the non-C# crowd, who may like what the language offers, but are wary of any Microsoft-branded stuff.

It’s hard to think of any downsides for developers of such a deal. One fear could be that the pace of innovation that Xamarin now shows could be slowed, once it’s absorbed in the Redmond behemoth. But, at least in the dev area, Microsoft has truly adopted a speedy release cycle of upgrades and fixes. After all, Visual Studio 2013 came just a year after the previous major version, and is now approaching Update 2. It’s hard to imagine that Xamarin wouldn’t be similarly upgraded, especially since it’ll be baked in.

Worth noting, too, is that new CEO Satya Nadella is a techie, so the potential acquisition might appeal to his geeky nature. He understands development in a way ex-CEO Steve Ballmer couldn’t hope to, and may be quicker to understand the benefits involved.

This is all speculation, of course, but it’s something I think should happen. What do you think?


Why Does My Cell Service Suck. Check OpenSignal

Courtesy Mark Gibbs, NetworkWorld.com

Whenever one of my friends calls me from the 118 just east of Somis her cell signal gets choppy then dies. Why? Go to OpenSignal and you can see why; according to their data there’s a stretch of several miles of road where cell service completely vanishes.

OpenSignal is a great tool for checking which carriers provide the best service in any given locale and their heat map display shows the signal strength data collected by crowdsourcing users of their eponymous iOS and Android app, OpenSignal.

The site lets you filter the data by coverage or towers and cell service type (any combination of 2G, 3G, and 4G) as well as by provider. The Web service also shows the percentage that the selected location is better or worse than the average city and similarly for worldwide average.

An OpenSignal cell service heatmap of Nairobi

The app shows the same data as the Web site plus it adds

  • a "signal compass" that shows you the direction your current signal is coming from
  • which carrier you are currently using and the connection quality
  • the WiFi network you’re connected to and the number f networks nearby (it can also show you a list of all nearby WIFi networks)
  • a Wi-FI map to locate nearby public networks.
  • a speed test feature allows you to see the true speed of your connection.
  • a stats page to track your cellular and Wi-Fi data usage

You can also share your findings on Twitter and Facebook and compare your connection with other users. To round all of that off, OpenSignal even provides an API so you can access and massage the data yourself.

This is a great service and one of the best ways to figure out why you, or your friends, have lousy cell service.