Design and Implementation of a Scripting Language for Mobile Devices – Københavns Universitet

Design and Implementation of a Scripting Language for Mobile Devices

Specialeforsvar ved Rasmus Jensen


This thesis creates two new languages: Yolan and LightScript, which run on top of Java Micro Edition and enable scripting on very low-end mobile devices.

The code footprint is the major limitation on low-end mobile devices, and both languages have a significantly smaller code footprint than existing scripting languages.  The languages are comparable in speed to larger scripting language implementations, and an order of magnitude faster than most of the benchmarked scripting languages for mobile devices.

Both Yolan and LightScript have first-class functions, dynamic typing, built-in support for hashtables, stacks, etc., and they support interactive programming. They are also able to load and execute scripts presented in source form at run-time.  The Java Micro Edition does not support dynamic loading of code, so both languages are interpreted.

Yolan is highly optimised for reducing the size of the implementation code footprint. It has dynamic scope, a Lisp-inspired syntax, and is interpreted by evaluating each node of the syntax tree.

LightScript is a subset of JavaScript; it has static scoping, and also includes support for closures, objects and exceptions. It is compiled to, and executed on, a stack-based virtual machine. One of things that makes the compact implementation possible is that the LightScript parser is an imperative optimised version of the top-down operator precedence parser.

Yolan has a code footprint less than half the size of LightScript, and they are similar in speed, even though they have very different evaluation strategies.  Yolan served as a proof of concept and as a stepping-stone toward LightScript.  LightScript is now a practical language for mobile development and will continue to be developed after this thesis.

Vejleder: Julia Lawall, DIKU
Censor: Erik Ernst, DAIMI

Specialeforsvaret vil blive afviklet på engelsk/The defense will be in English.