Presentation: "JavaScript as an Assembly Language"

Time: Wednesday 14:40 - 15:30

Location: Rytmisk Sal


JavaScript was originally designed as a "scripting language or some kind of language inside the browser that could be used to automate parts of a web page or make a web page more dynamic" [].

The original designers probably did not anticipate the fact that a decade later people would want to write complete applications such as word processors, spreadsheets, mail clients, etc, inside the browser. The extreme flexibility and dynamism of JavaScript and the lack of modularity makes it hard for human developers to scale JavaScript programs beyond simple scripts. For instance, you have to be extremely careful to not make any typos in variable names; you have to manually encode namespaces and classes, there are no standard libraries. As a result, programs become fragile and the signal to noise ratio degrades significantly.

Every disadvantage has an advantage however, and while JavaScript is not such a great language for authoring large programs, JavaScript is actually a fantastic target language for compilers. Just like assembler languages, JavaScript lacks a restrictive static type system and allows for a certain amount of self-modifying code, but unlike typical assembler languages, JavaScript actually has high-level language features such as closures and exceptions. Moreover, JavaScript has the additional advantage that it comes with every Web browser. As a result, we see an increasing number of high-level languages that are compiled to JavaScript. Examples include Java, OCaml, ObjectiveC, Scheme, Haskell, and many others.

In contrast to this trend, Volta compiles a low-level assembly language, .NET MSIL, to JavaScript. In this talk we will explain the challenges and advantages of JavaScript as a target language, in particular the fact that JavaScript lacks jumps and gotos. We will also drill down into a foreign language interface between JavaScript and .NET.

Architect Erik Meijer, Microsoft

Architect Erik  Meijer

Erik Meijer is an architect in the Microsoft SQL server division where he currently works together with the Microsoft Visual C# and the Microsoft Visual Basic language design teams on data integration in programming languages.

Prior to joining Microsoft he was an associate professor at Utrecht University and adjunct professor at the Oregon Graduate Institute.

Erik is one of the designers of the standard functional programming language Haskell98 and more recently the Cw language.