J003-Content-WebAssembly-and-Open-Container-Project_SQLast week we came across two awesome projects that will make the web as we know it, an even better place. A new compiler is in the works and once implemented, it will enable an even faster web. The next project is aimed at business users and developers and it is meant to put a stop to vendor lock-in within the cloud. Doug Barney investigates the two projects below.

For users: A far faster web thanks to one sweet new compiler

Computers may seem simple on the outside, but they are more complex than ever on the inside. All that razzle dazzle and usability takes some serious programming. So bear with me a bit if it takes a while to explain how a new seemingly mundane bit of code from Google, Mozilla, Apple and even Microsoft can make your web experience far snappier – maybe up to 20 times faster for some operations.

This little bit of magic is called WebAssembly (wasm for short) which is designed to replace or augment JavaScript (depending on whom you talk to).

JavaScript is a main language and system driving today’s website. Old time code jockeys know assembly/assembler was the fastest language because it talked directly to the hardware without a middle interpretive layer – as is the case with JavaScript, now about 20 years old.

In contrast, wasm runs on the browser and at the same time acts in a native or direct fashion. The underpinnings come from Google’s Portable Native Client and Mozilla’s asm.js – both tools that try to do the same thing in terms of directly inspired performance.

The difference is asm.js, as the acronym indicates, still maintains plenty of vestiges of JavaScript. Because so many developers know JavaScript, a fairly easy to use, low-level scripting style language, Mozilla’s idea with wasm is to create a compatible subset of JavaScript that runs far faster.

In that regard, the JavaScript engine still holds the code, but the code has now been compiled to operate faster and natively against the hardware upon which the browser sits. Mozilla may be the most bullish of the partners on the JavaScript element, as a recent FAQ indicates:

“WebAssembly is designed to be a complement to, not replacement of, JavaScript (JS). While WebAssembly will, over time, allow many languages to be compiled to the Web, JS has an incredible amount of momentum and will remain the single, privileged dynamic language of the Web. Furthermore, it is expected that JS and WebAssembly will be used together in a number of configurations.”

So what’s it all about?

The whole idea of wasm is you could write one app, have it run on a browser, and still be optimized for all the back end platforms. This was the original intent of the Java programming language (which is actually distinct from JavaScript), but Java was too slow and was never as cross platform as intended.

It also means larger apps can be built to run in a browser, rather than native on the desktop.

Initially the new technology is aimed at C/C++ programmers and libraries, but will be adapted to other languages. The group points to many uses cases, including:

  • Image / video editing.
  • Games
  • Peer-to-peer applications (games, collaborative editing, decentralized and centralized).
  • Music applications (streaming, caching).
  • Image recognition.
  • CAD applications.
  • Scientific visualization and simulation.
  • Interactive educational software, and news articles.
  • Remote desktop.
  • VPN
  • Fat client for enterprise applications (e.g. databases)

Not a lot of detail

Luke Wagner from Mozilla offered some of the best detail in a blog, but information is still scant. “I’m happy to report that we at Mozilla have started working with Chromium, Edge and WebKit engineers on creating a new standard, WebAssembly, that defines a portable, size- and load-time-efficient format and execution model specifically designed to serve as a compilation target for the Web. As reflected in the high-level goals, a central requirement for WebAssembly is that it integrates well with the rest of the Web platform and that the initial version run efficiently on current browsers using a client-side polyfill,” Wagner wrote.

“It is natural to view WebAssembly as the next evolutionary step of asm.js (a step many have requested and anticipated),” Wagner continued. So far there is no tech spec for wasm and no standards bodies have been fed details. The standards issue isn’t so critical since it can take years for a standard to be approved, and the industry tends to go ahead and adopt it anyway – far before ratification. In all cases many of us on the edge of our seats until more information is revealed about WebAssembly.

 

For businesses: Cloud vendors help invent end to cloud vendor lock-in

One of the biggest problems customers have with the cloud is lock-in – once your application or data is running on a service, it is hard to get it back or migrate to another. That means prices may go up, and you can do little about it.

One answer is containers, an approach to virtualization that lets apps run in the cloud, and is designed to be portable. The only problem is containers are not portable enough, yet!

That is the reason for the newly formed Open Container Project, which is backed by container pioneers such as Docker and CoreOS, end users such as Goldman Sachs, and providers such as Google, Microsoft and Amazon – some 20 partners in all. Also part of the group are Apcera, Cisco, EMC, Fujitsu, HP, Huawei, IBM, Intel, Joyent, Linux Foundation, Mesosphere, Pivotal, Rancher Labs, Red Hat and VMware.

Project details

The Open Container Project is being overseen by the Linux Foundation. The Linux Foundation is already all about open computing, now even more so about open cloud computing.

“Containers are revolutionizing the computing industry and delivering on the dream of application portability,” said Jim Zemlin, executive director of the Linux Foundation. Zemlin has many kind words about Docker which is an open platform for developers and sysadmins to build, ship, and run distributed applications, wherever they choose and also happens to be part of the Open Container Project. He says that it is thanks to Docker that fragmentation isn’t destroying the promise of containers and giving users the ability to freely collaborate.

Docker are giving the group the code that drives its container format and runtime saying that it was time for a standard to be set in order to ensure compatibility and according to Solomon Hykes, founder and creator of the Docker open source initiative: “It is for this reason that we are donating our container format and runtime to the standard.”

CoreOS is also a key contributor with its App Container, and a close Docker partner.

“We created App Container to kick start a movement toward a shared industry standard,” said Alex Polvi, CEO of CoreOS. He describes Docker as the ‘de fact image for containers’ meaning it would be a great place to start working on a standard for the industry.                       

Customers board Open Container train

The group believes that everything they are currently working on will be of great benefit to users. “Users can fully commit to container technologies today without worrying that their current choice of any particular infrastructure, cloud provider, devops tool, etc. will lock them into any technology vendor for the long run. Instead, their choices can be guided by choosing the best tools to build the best applications they can,” the group said. Of course the benefit will then also have a trickle effect on the industry as there will be more scope for innovation and competition.

The group even offered the perfect analogy for the situation saying: “Why argue about the width of train tracks, when you can worry about laying track and building the best possible engines?”

Their ultimate goal is to hold on tight to the original promise of containerization, that is, to have a system where applications “built from multiple containers run using a diverse set of tools across a diverse set of infrastructures.”

The Amazon factor

Many worry about being locked into Amazon Web Services (AWS), but Amazon is part of the project. Interestingly, Amazon was not one of the many supporters quoted in the press release and has no mention of this support on the AWS web site – at least at the time of going to press.

However, it does already strongly support containers through its Amazon EC2 Container Service which is based on open-source Docker technology. When announced, a couple years back, Amazon called its service “a highly scalable, high performance container management service that supports Docker containers and allows you to easily run distributed applications on a managed cluster of Amazon EC2 instances.”

The Amazon EC2 Container Service lets you launch and stop container-enabled applications with simple API calls, allowing you to query the state of your cluster from a centralized service, according to Amazon. This gives a user access to many familiar Amazon EC2 features such as security groups, EBS volumes and IAM roles.

The container story

Containers are nothing new. They were actually first used by Sun Microsystems over two decades ago to virtualize high-end hardware. A container is a lot like a hypervisor and was built long before VMware was even a twinkle in its founders’ eyes. Even though it is technically older, the advantage of the container is that it does not itself require a hypervisor. Instead the container works at the operating system level, and separates the OS into distinct pieces – application management and managing system resources.

Containers are already a bit vendor independent since you don’t rely on VMware, Microsoft or Citrix for a hypervisor.

VMware is supporting the new project, which offers a way for its customers to more easily migrate to other cloud and even hypervisor platforms. VMware argues that customers need an open, interoperable future for software containers and they are happy that a number of industry players are collaborating on a common standard. VMware said it is their goal to help “customers innovate more rapidly and benefit from containers as they adopt the technology in their environments”.