Skip to content

Command Line Options

Leonardo Laguna Ruiz edited this page Mar 11, 2017 · 1 revision

This document describes the command line options available in the Vult compiler

Code Generation

-jscode : Generates JavaScript code

-luacode : Generates LuaJit code

-ccode : Generates C/C++ code

For example, to generate both JavaScript and C/C++ code:

$ vultc -jscode -ccode input.vult

-o prefix : Defines the prefix for the generated files. This prefix is also used as name for the generated modules or packages depending on the output language.

For example to generate the C/C++ files mycode.cpp and mycode.h:

$ vultc -ccode -o mycode input.vult

-i directory : Specifies a directory where the compiler should look for Vult files.

By default, Vult looks for modules in the location of the input file. When files are located in other paths you should pass the directory with the -i option.

$ vultc -ccode -i /Users/leonardo/vult_files input.vult

The C/C++ generator provides a few extra options:

-real type : Specifies the real number representation for the code. By default floating-point code is generated.

To generate code with fixed-point:

$ vultc -ccode -real fixed input.vult

-template name : Generates the code with the specified template. The available templates are:

  • pd : PureData objects
  • teensy : Teensy audio library objects
  • modelica : Modelica simulation code

For example, to generate a PureData object:

$ vultc -ccode -template pd input.vult

Other options

-version : Shows the current version of the compiler.

-check : Checks if the input files are correct and prints the errors if any.

-eval : Executes the input files.

-deps : Prints the dependencies of the current file. This is useful when integrating with build systems like make or cmake.

Development

-dparse : Shows the internal representation of a Vult program after all transformation stages.

Clone this wiki locally