Getting Started

NOTE: This assumes that TAME has been installed correctly. If you have not installed TAME, please consult the installation guide.

Compiling a Module

A TAME module is written in a language called TAMEScript, contained in text files. Those files are read by the TAME compiler and converted into serialized, encoded files to be read by other TAME interpreters, or standalone JavaScript. This is accomplished using the tamec command.

Compiling a TAMEScript file is done at your OS's command prompt:

tamec [filename]

...where [filename] is the name of a TAMEScript file. A file named main.tscript in the current directory would be compiled using this command:

tamec main.tscript

...and that would produce a message similar to the following:

Wrote module.tame successfully.

This means that compilation was successful, and resulted in a file called module.tame to be written as a result. But module.tame is a default name. If you want it changed, you would either have to rename the file, or specify the name of the output file when running tamec with a special switch:

tamec main.tscript --outfile main.tame

...which should produce:

Wrote main.tame successfully.

Running a Module

Compiling a module is easy. Running one is also pretty easy. The main interpreter, tame, is used to play compiled modules, and is usually executed at the command line like so:

tame [filename]

...where [filename] is the name of a compiled module.

For example, after you compiled main.tscript and produced an output file called main.tame, you run it with this command:

tame main.tame

However, a module does not need to be compiled in order to run - you can execute the script itself by using the --script switch, in almost the same way to would compile a module, like so:

tame --script main.tscript

Hello, World!

A bit cliché, but all first programs start with "Hello, world!" In fact, that's what every module is - the definition of the world itself.

Put the following in a sample file called helloworld.tscript:

		textln("Hello, world!");

Now, compile it.

tamec helloworld.tscript --outfile helloworld.tame

...and then run it:

tame helloworld.tame should get:

Hello, world!

...and get dumped back to the prompt. You can also run just the script:

tame --script helloworld.tscript

...and get the same thing:

Hello, world!

If you remove the quit statement, you won't be dropped to the command prompt, but rather the regular prompt to send TAME commands. To quit the shell, you can type !quit or send a null control character.