The LITTLE Source Development Kit (SDK)

Overview

The current LITTLE SDK binary distribution is installed in one folder, which contains at least the following subdirectories:

bin Here, the SDK programs little, littlec and friends are located.
demo This is, where you can find demo sources.
doc This folder contains an offline version of the LITTLE homepage, and might hold additional language and tools doc.
include As usually, the C/C++ API headers for the LITTLE VM and runtime are located here.
lib This directory contains all the runtime environment of LITTLE: class files and DSOs are placed here.

This structure may be subject of future change and, at least, is to be enhanced while development goes on.

The LITTLE distribution comes with a set of tools which support the development process.

The little-Command

The SDK's core tool is little, the bytecode interpreter. It is located in the installation directorie's bin-folder.

The little-tool actually just is a wrapper script, which invokes the VM with a set-up environment and eventually some additional options.

Synopsis and Usage

Synopsis:

   little [[-O][[-D <key>=<value>]*][-F <fsize>][-T <tsize>][-S <ssize>][-X <xsize>][-L <classpath>][[-v <mode>]*] [-i] | <classname>] | [-h]
  

Options:

-D <key>=<value> define a system property key with value value; these properties can be read from within LITTLE code via (little.lang.System:getprop <symbol>)
-F <fsize> use fsize as 'features' cache size (default=100); a value of 0 for T or F enforces non-cached feature lookups
-T <tsize> use tsize as 'types' cache size (default=100); a value of 0 for T or F enforces non-cached feature lookups
-S <ssize> use threadenv execution stack(s) of size ssize (default=65535)
-X <ssize> use threadenv frame stack(s) of size xsize (default=65535)
-L <classpath> look for classes in classpath, given by list of colon-separated paths
-O uses the fast evaluator, which performs on-the-fly optimizations on the input stream
-v <mode> set verbosity level to mode; valid modes are class, nativelibs, errors, threads, all
-V prints version information about the current interpreter and runtime system (this is equivalent to the command little little.util.Version)
-i starts the read-eval-print-loop, a facility, which allows interactive operation of the interpreter (this is equivalent to little little.rep.Loop)
-h print this help text

Classes

Executable classes are passed to the interpreter using their full internal names: <package-symbol>.<class-symbol>; example:

    little little.util.SysInfo
   

little can execute classes, which define the entry point class method main (). If they don't an exception will be raised.

The Read-Eval-Print-Loop (REP)

If invoked with the -i-option, little will enter the so-called read-eval-print loop, which allows to interactively work with the interpreter. In the REP-loop, there are some additional forms available, which allow to gain information on classes and execute them.

The form

(help)

will print the list of REP supportive built-ins.

The current REP doesn't represent the final state - it will provide immediate execution of expressions. For now, you can enter toplevel declarative statements only.

The LITTLE compiler: littlec

This utility is located in the installation folder's bin subdirectory as well. It is used to compile source files written in the LITTLE language to a set of class files containing structure definitions and VM bytecode.

Synopsis

   littlec [[-d <dpath>][-c <cpath>] {<file>}*] | [-h]

  

Options

littlec knows the following option switches to influence it's behaviour:

-c <classpath> adds classpath, a colon-separated list of folder names, to the classfile search path
-d <path>|<lib>.lib; uses the folder given by path as destination directory, or the library lib.lib to write its' output to (the latter is newly created - already existing libraries of the same name are overwritten)
-h prints it's usage information

Environment Settings

The LITTLE SDK uses the following environment variables:

LITTLE_HOME points to the SDK installation folder; it is not required anymore to have this variable set - however you can set it to point to an alternate installation
LITTLE_CLASSPATH is a colon-separated list to be searched for class files in addition to $LITTLE_HOME/lib
LD_LIBRARY_PATH, DYLD_LIBRARY_PATH, SHLIB_PATH depending on the OS the SDK is installed on; it need not be set anymore in order to run LITTLE programs using the core distribution only; however, if additional packages are used, DSOs which they might require, must be included in the library search path

Compiler behaviour (and thus REP behaviour) is influenced by two optional files: $LITTLE_HOME/lib/macros.ltl and $HOME/.little/syntax.ltl. These files contain LITTLE source code to be processed at compiler startup time - macros.ltl is site-specific, and syntax.ltl may contain user-specific macros.

This is a preliminary solution, which allows to use macros, which are currently not part of any namespace, as language extender. Later, macros will be provided as class files as well, and will use the common LITTLE package mechanism.

How Classes are stored

The little-tools can handle two types of class storage: class files, which contain one entity per file (i.e. one class), and class libraries, which contain multiple class definitions.

The name of a class file must conform to the following rule:

    <classname>.cls
   

A class file must be located in a directory carrying the same name as the package the class belongs to (using the internal representation '/' instead of '.'), which must be included in the class search path (or be a subdirectory of $LITTLE_HOME/lib).

A class library must conform to

    <anyname>.lib
   

and has to be explicitly included in the class search path. The system classes are usually provided by $LITTLE_HOME/lib/rt.lib.