Nasal: Not another scripting language!

Quick Links

Executive summary:

Nasal is a language that I wrote for use in a personal project. Ostensibly it was because I was frustrated with the dearth of small-but-complete embeddable scripting languages, but of course I really wrote it because it was fun. It is still young and incomplete in a few places, but is under active development and has been integrated as the extension language for the FlightGear simulator.

Documentation is still sparse. There is a design document available, which talks at length about the "why's" behind the design of Nasal and includes documentation for the built-in library functions. More useful to the experienced programmer is the tutorial-style sample code, which explains and demonstrates all the syntax features of the language.

Source code is available under the terms of the GNU LGPL.

Questions and comments can go to the author, Andy Ross, via email at

Getting Nasal

The most source code recent release is Nasal 1.0.1 and can be downloaded here.

The CVS development tree is also available on via anonymous pserver access. Check out using:

cvs -d co nasal
Checkins to the archive are logged to the mailing list. There is also a cvsweb interface available at: for online browsing.

Those interested in the development version should consider subscribing to the Nasal mailing list. Nasal's documentation is still very limited, and this is the best forum for getting help and making suggestions.

News and Updates

05 Jul 2006

A mailing list is now available for Nasal discussions. I have fielded enough similar questions and suggestions from different authors that a public forum seems to be a good idea. Traffic is likely to be very low, but hopefully having the archives available will be a cheap way to to improve the state of Nasal documentation.

04 Jul 2006

Oops. Nasal 1.0, which fixed a long standing bug with break/continue inside foreach/forindex and a continue issue when used with multi-level labels, introduced a nasty regression with the regular old break statement. A mark stack underflow would result and cause a runtime error when used in large or deep loops. A new 1.0.1 release is available with a fix for this problem.

03 Jul 2006

I finally bothered to put together a new release, containing the updates that have been available in SimGear for some time now. Nasal 1.0 is now available for download. Important new functionality includes bugfixes, many performance enhancements, declared function argument syntax, a ternary (?:) operator, indexable and mutable string objects, interpreter threadsafety features, and much work to the "standard" library (including stdio, bitfields, unix system calls and PCRE regular expresions).

07 Dec 2004

Nasal 0.9.2 has been released. This version adds support for multiple context objects, and uses the new feature to implement call() and eval() library routines.

25 Jun 2004

A new release, 0.9.1 is available. This fixes minor bugs, and changes the C extension API to allow the called function to tell whether it was called as an object method. Download load it from

27 Feb 2004

Manabu Nishiyama is working on a SWIG module to generate Nasal extension code. Check it out at

15 Feb 2004

Updated nasal.vim syntax highlighting file from Melchior FRANZ.

04 Dec 2003

Nasal has its first customer! The FlightGear project is now using Nasal as its embedded scripting language. Nasal itself is now available as part of the SimGear package which provides utility code for the core simulator. Development is progressing rapidly, and SimGear is likely to be the best place to find cutting edge Nasal code in the near-term future. This site will continue to provide packaged code only occasionally. Check out FlightGear, even if you aren't interested in flight simulation. The Nasal integration there is large and elaborate, and makes an excellent case study for the Nasal extension API. It includes a large FlightGear/Nasal integration document, as well.

(Conversely, check out FlightGear even if you aren't interested in Nasal! It's a great project.)

I've packaged up a 0.9 release to match the current version in FlightGear. It contains lots of bug fixes; significant new features like a math library, stack trace support for error handling, and a "ghost" mechanism for wrapping pointers to C objects in a garbage-collector-friendly way; and some fun toys like a Vim syntax highlighting file (contributed by Melchior FRANZ) to go with the Emacs mode I hacked together. See the ChangeLog file for more complete information.

29 Nov 2003

The new 2.0-13 version of Highlight, André Simons's multi-language, multi-format, multi-theme code formatter and pretty printer supports Nasal!

23 Sep 2003

Another release is available for public consumption. This fixes several bugs, including crashing issues with the garbage collector and bytecode interpreter.

Also note that the name has been officially (if unimaginatively) changed from "Nasl" to "Nasal" to avoid collision with the nice folks at Nessus. I'm still open to better names. I picked this one because it allowed me to avoid changing the pronunciation or naXXX C symbol prefix.

18 Feb 2003

It has been brought to my attention that I have stepped on someone else's name. The Nessus Project has already christened their extension language "NASL". Oops. Unfortunately, I currently lack the time or creativity to come up with something better. This will stay "Nasl" for now (different capitalization, different acronymoid), but I promise to come up with something less ambiguous before the next major release, if there is one. Suggestions are welcome.

There is a new package file, with some garbage collection performance/determinism improvements and two new sample scripts to test/benchmark garbage collection overhead and object access speed. Both are acceptable and within design goals: GC is about twice as fast as perl, object access about twice as slow.