|
BFC-Compiler
A C23 Brainfuck compiler
|
Project README · Architecture · Backend guide · API documentation
bfc accepts one Brainfuck source file and optional compiler flags.
Print the available command-line options and exit successfully.
Generate assembly and stop.
When -o is not provided, the current implementation appends .s to the complete input path:
Use -o to select a different assembly-file path:
The current implementation only writes output when -S is present. The assemble-and-link stage for producing a final executable is not implemented yet.
Set the output path.
The value must be supplied as the next argument.
Supported:
Not currently supported:
Specifying the output option more than once is an error.
Select the code-generation target.
When no target is provided, bfc selects the host architecture and operating system using compiler predefined macros.
The target value must be supplied as the next argument. The --target=<triple> form is not currently supported.
Disable bfc's semicolon-comment extension.
By default, a semicolon begins a comment that continues to the end of the current line:
With --fno-comments, the semicolon is treated like any other non-Brainfuck character and does not suppress later Brainfuck instructions on that line.
Stop parsing options.
This allows an input path beginning with -:
Everything after -- is treated as a positional argument.
The target parser currently recognizes:
| Target triple | Architecture | Operating system |
|---|---|---|
| aarch64-apple-darwin | AArch64 | macOS |
| x86_64-apple-darwin | x86-64 | macOS |
| aarch64-unknown-linux-gnu | AArch64 | Linux |
| x86_64-unknown-linux-gnu | x86-64 | Linux |
| aarch64-pc-windows-msvc | AArch64 | Windows |
| x86_64-pc-windows-msvc | x86-64 | Windows |
| i386-pc-windows-msvc | i386 | Windows |
Recognizing a triple does not guarantee that a backend is implemented.
Currently implemented backend selections:
| Target triple | Backend status |
|---|---|
| aarch64-apple-darwin | Implemented |
| x86_64-apple-darwin | Implemented |
| Linux targets | Recognized, backend not yet selected |
| Windows targets | Recognized, backend not yet selected |
Requesting a recognized target without an available backend produces an error.
Output:
bfc returns: