Skip to content
Command line

Command line

The compiler is the file bootstrap/qdx in the repository. It has two forms.

Compile

bootstrap/qdx <input.qdx>... -o <output>

Reads every input file as one program and writes an executable to output. At least one input is required, and -o with the output path comes last. If a file already exists at output, it is replaced.

The executable is a static 64-bit Linux program for x86-64. It needs no other file to run.

Compile and run

bootstrap/qdx run <input.qdx>... [-- <argument>...]

Compiles the inputs and starts the result at once, from memory, without writing a file. Everything after -- is given to the program as its arguments. The program sees the last input file’s path as its own name, arg(0).

The exit status is the program’s own.

Exit status

StatusMeaning
0The executable was written.
1An error. The message is on standard error. This covers errors in the source, a file that cannot be read or written, and a command line in neither form.

With run, a successful compile is followed by the program, so the status seen is the program’s.

The standard library

The compiler does not know where the standard library is. Name its files with the rest of the inputs, as in std/*.qdx. The order of inputs does not affect the program’s behaviour.

Building the compiler

The compiler is itself a qdx program, in compiler/. The repository’s build program rebuilds it and runs the tests.

bootstrap/qdx run std/*.qdx build.qdx

To replace bootstrap/qdx with the freshly built compiler after the tests pass:

bootstrap/qdx run std/*.qdx build.qdx -- seed