Was this page helpful?

Command Line Tools

Download the Command Line Tools

The command-line compiler lfc can be installed in any directory, but it will be most convenient if add its directory to your PATH environment variable. To download the current development version of the command-line tools instead of the latest release, replace the following tar and zip files with those from the nightly build.

Linux and macOS

Download lfc 0.2.0 for Linux/Mac and run:

    tar xvf lfc_0.2.0.tar.gz
    ./lfc_0.2.0/bin/lfc --help

Windows

Download lfc 0.2.0 for Windows and run:

    unzip lfc_0.2.0.zip
    .\lfc_0.2.0\bin\lfc.ps1 --version

Developer

Clone the repository using one of

    git clone git@github.com:lf-lang/lingua-franca.git

or

    git clone https://github.com/lf-lang/lingua-franca.git

Then build using gradle or maven:

    ./gradlew assemble

or

    mvn compile

Note: The gradle build also performs tests, which takes a long time.

The comnand-line tools will then be in a directory lingua-franca/bin.

Using the Command Line Tools

Set up a Lingua Franca project by putting your program in a file with the .lf extension, such as Example.lf and putting that file with a directory called src. Then compile the program:

    lfc src/Example.lf

This will create two directories in parallel with the src directory, src-gen and bin. If your target language is a compiled one (like C and C++), then the bin directory should contain an executable that you can run:

    bin/Example

To see the options that can be given to lfc, get help:

    lfc --help

If you have installed the developer setup by cloning the GitHub repostory, then there are a number of other command-line tools available in the lingua-franca/bin directory.

Lingua Franca is an open source project. Help us improve these pages by sending a Pull Request

Contributors to this page:
Eeal  (3)

Last updated: May 27, 2022