docs / start

fx · 0.9.74

Start here

Welcome to fx: a systems language with visible memory and dual emission to readable C.

What you need

  1. The fxlang package (compiler in bin/, plus std/, scaffolds, headers).
  2. A C compiler on your PATH for linking. gcc is the default today.
  3. Windows or Linux x86_64 for the prebuilt compiler in this release.

No other language install is required to write and run fx programs.

fx doctor

Longer path (CLI + optional local site): package docs/WEEKEND.md. Compile modes: docs/DRIVERS.md.

Five-minute hello

fx version                    # expect v0.9.74
fx doctor
fx new hello
cd hello
fx run main.fx                # IR → native when QBE is in the package; expect exit 42
fx run main.fx --emit-c       # optional: readable C path (also if QBE is missing)

IR on Windows and Linux: Linux uses third_party/qbe/obj/qbe. Windows uses third_party/qbe/windows/qbe.exe when that file is in the package (native PE). The same everyday programs run on both paths. If qbe.exe is absent, pass --emit-c. Emit-C stays first-class either way.

Windows without PATH

.\bin\fx.exe doctor
.\bin\fx.exe new hello
cd hello
..\bin\fx.exe run main.fx

Linux without PATH

./bin/fx doctor
./bin/fx new hello
cd hello
../bin/fx run main.fx

What just happened?

fx new wrote a simple scaffold: a named region, effects { alloc, mut }, and import std/vec. That is the recommended starting point: Go-feel lifetimes, not a GC.

fx new tiny --scaffold minimal
fx new firmware --scaffold embedded

Linking notes

When fx run or fx build links:

If linking fails with "gcc not found," install a C compiler and run fx doctor again.

Next in the learn path: Language · Composition · Regions · docs index