Slang is an experimental stack-based scripting language I created for use in my Flash projects. You can read about the initial release, a very simple parser, here; and 2.0, a more powerful language with rudimentary data structures, here. I used these early versions Slang to write gameplay code for Hypothermia and Humphrey’s Tiny Adventure: Remastered.

Slang 3.0 is a complete rewrite of the scripting engine in Haxe, an awesome language that compiles to Flash, Javascript, and a bunch of other platforms including mobile devices and native code for desktop applications. It adds support for script functions and arrays, as well as being much faster.

Here’s some sample code:

func greet (name) {
    print string:format "Hello, {0}!" [name]

greet "World"
set var b true

if b {
    print "do true things here"

ifelse b {
    print "is it true or..."
} {
    print " it false?"

You can get the source on the Github repository, or download the Haxe library on haxelib.


Comments are closed.