Overview

This getting started tutorial describes the steps you need to be up and running with the ADAPT Docker development kit.

For a tutorial about creating and deploying a full ADAPT network, refer to ADAPT Application Tutorial.

Set up your Environment

I. Get the ADAPT Development Kit

Ensure that Docker and Docker Compose are installed on your system.

docker -v
docker-compose version

If these commands fail, install using the official Docker installation instructions.

Retrieve the ADAPT development kit.

docker pull adaptframework/mufl:release-0.2

For other available versions (tags), check the ADAPT’s Docker repository.

II. Install a Text Editor

Docker is likely to not have a text editor installed. Install the editor of your choosing. For convenience, this command installs Vim.

apt update && apt install vim

III. Install the SDK

Generate a Docker container and operate it in interactive mode to examine its internal structure.

docker run -it adaptframework/mufl:release-0.2 /bin/bash

To view the structure in this documentation, refer to ADAPT Docker Development Kit.

Test MUFL with Hello World

Run the native MUFL read-eval-print loop (REPL) shell.

/mufl/bin/mufl

Use the MUFL console that appears in your terminal to greet the world with our first MUFL command.

_print "Hello, World!\n".

View the results. They, of course, should be:

Hello, World!

Test MUFL from a File

Next, create your first MUFL script. In your text editor, create test.mufl with the following content:

script
{
    _print "Hello, World!\n".
}

Just as you did with the same code in the previous section, evaluate the code with REPL.

./bin/mufl test.mufl

The same result should appear.

You can also invoke the MUFL compiler directly.

./bin/mufl-compile test.mufl

The compiler generates a compiled MUFL code object. The filename is a 32-byte hash of the MUFL code with a .muflo extension. For example:

dev/mufl %build/mufl-compile test.mufl
// ENABLING META STAGE
SAVED TO FILE: <84489F736AE948BADDA8FA661990F8D2ED6F412D3C53F54C44F0CFAEA7C37884.muflo>

The same version of the compiler compiling the same code always yields the same hash-code filename.

Evaluate the compiled file by explicitly executing the compiled binary file. Remember to use the hash code that you got in the previous step. For example:

./bin/mufl -r 84489F736AE948BADDA8FA661990F8D2ED6F412D3C53F54C44F0CFAEA7C37884.muflo

Again, the same result should appear.

Feel free to experiment with the MUFL language by trying different language constructs in your code and/or click Contact Us in the top navigation bar of this page and ask questions!

For more information about MUFL, refer to The MUFL Programming Language.

Next Steps

The MUFL language is designed to produce code that runs in ADAPT packets within an ADAPT network.