Programming languages

Dee Dee's Laboratory

Deelab is not a new scripting language. It ties together existing libraries to make a playground for D programmers. Mostly, it's a binding of arsd.terminal for arsd.script which gives the latter an interactive console, along with other convenience functions. Note that I'm a beginner with both halves, and neither is documented very well, so things may not be done in the best way.

As of December 2019, Deelab is a work in progress with no specific goals in mind. Additions to come as inspiration strikes; suggestions are welcome.

Download and license

Deelab is open source under the Boost License and currently available as a pre-built binary for 64-bit Linux (875K). Source code and build instructions are included in the archive, along with contact and support information.

Special thanks to Adam D. Ruppe, the creator of arsd, for giving me some clues.

How to use

Run Deelab with no command-line options to get an interactive prompt. The -h option shows other ways to use it. For the language itself, read the official manual; briefly put, it's similar enough to JS that the following just works:


	function gcd(a, b) {
		while (a != b) {
			if (a > b) a -= b;
			if (b > a) b -= a;
		}
		return a;
	}

One big difference is that variables must be declared, but can't be initialized in the same statement; var a; a = 1; works fine.

Built-in functions

As arsd.script has no built-in functions by design (but see below), Deelab has to provide its own for everything.

Most Deelab builtins are bindings to the terminal control library:

	puts("3 + 2 = #{3+2}\n")

The available colors are: black, red, green, yellow, blue, magenta, cyan and white (constants are predefined). You can also use bright foreground colors like this: bright | white, and reset to defaults with default in either slot.

In contrast, only two functions give access to the interpreter itself:

Last but not least, a few convenience functions are included:

More advanced mathematical functions are left out on purpose. The only other inclusion is exit(), to leave the interpreter cleanly; pressing Control-C has the same effect.

P.S. `args` gives access to the command-line arguments.