Overview

Code developed with the MUFL programming language is used to implement state transitions of ADAPT packets. Additionally, MUFL enables writing simple testing and configuration scripts that operate outside of the context of a packet.

Fundamentally, the MUFL language behaves much like other scripting languages, such as JavaScript or Python. The equivalent of the main entry point code in MUFL is called an application. MUFL code is organized into applications, libraries, and scripts, each residing in a separate file in the file system.

ADAPT Packets

ADAPT packets are containers of data and logic associated with an ADAPT node or nested within other packets. Packets are akin to databases, with the main differences between a traditional database and an ADAPT packet being that ADAPT packets:

  • Do not provide free-form query functionality.
  • Support only the logic provided by the application associated with the packet.

Language Basics

MUFL is a functional language that uses Curry notation to describe both function calls and container lookups. In brief, it is a no-side-effects programming language operating over immutable data.

Functions in MUFL have no side effects. However, because the primary goal of all MUFL code is to generate a state transition of a packet, the fact that packets are immutable is hidden from the programmer. The code appears to be making changes to the contents of a packet. In practice, however, all MUFL code is constructing a new state of the packet, while preserving the prior state without any changes.

In MUFL, all data is classified as one of the MUFL data domains. Integers, strings, and dictionaries are examples of MUFL data domains.

For more information, refer to ADAPT Data Model.

Applications and libraries are named collections of functions and variables that provide manipulation logic and storage specification for data inside ADAPT packets.

MUFL Library Packages

Much like Javascript packages use package.json to specify contents of a Javascript package as well as other packages it uses, MUFL packages use config.mufl, a configuration script that specifies both imports and exports of the package.