Why Recoil?
Recoil turns Rebol-shaped source into native artifacts, with ownership checks before the C compiler ever runs.
It is a systems language for people who want code to stay close to data: words, blocks, paths, and declarations that can be parsed, transformed, checked, and lowered. The result is a compact language that speaks C fluently without giving up Rebol's expressive shape.
Built for
Native components
Build command-line tools, shared libraries, and static libraries from one source language, with generated headers when C callers need them.
FFI-heavy code
Wrap C APIs behind typed Recoil functions. Keep the unsafe boundary narrow and let ordinary Recoil code use clearer values.
Parser-shaped problems
Use parse rules for protocols, file formats, command languages, and other places where grammar belongs in source.
Stateful protocols
Model legal states and events with FSM and FST types instead of spreading protocol state across ad hoc conditionals.
Embeddable tools
Compile small native pieces that can live inside larger C, Rebol, plugin, or embedded workflows.
Language experiments
Explore ownership, typed dialects, lowering, and generated C without starting from a large compiler platform.
Design pillars
Data-shaped source
Recoil keeps the surface language small: words bind and call, blocks group code and data, paths navigate values, and refinements keep APIs readable.
point!: make struct! [x: i32! y: i32!]
p: make point! [x: 10 y: 20]
print p/x
Ownership in the syntax
Get-words carry borrowing into ordinary calls. A borrowed argument is visible at the function boundary and at the call site.
msg: make string! "hello"
show: func [:text [string!]] [
print text
]
show :msg
print msg
C as the native bridge
Recoil emits C as a useful artifact. You can inspect it, compile it with familiar toolchains, and link it into native projects.
gain: func [
#export sample [f32!]
amount [f32!]
return: [f32!]
] [
sample * amount
]
Dialects that compile
Grammar rules and automata are language forms. They participate in checking and C lowering instead of living only as runtime conventions.
PARSE covers grammar-style matching. FSM and FST cover explicit state and streaming transitions.
One source, several roles
Recoil's sweet spot is code that wants to cross boundaries: between Rebol-style expression and C, between parser-like source and compiled logic, between small tools and native libraries.
| Role | Why Recoil fits | Where to read next |
|---|---|---|
| Native CLI | Small compiled output and direct access to files, ports, and C APIs | Getting Started |
| C library | Export Recoil functions and generate headers for C callers | Packages |
| Parser or recognizer | Write grammar rules as source and compile them with the program | PARSE |
| Protocol engine | Declare states, events, transitions, and streaming behavior explicitly | State Machines |
| Foreign wrapper | Keep C calls at a typed boundary and present safer Recoil functions above it | FFI & Systems |
If you are coming from
| Background | What will feel familiar | What Recoil adds |
|---|---|---|
| Rebol | Words, blocks, paths, PARSE-inspired design | Static types, ownership checks, and native C output |
| C | Native artifacts and direct ABI access | A compiler that tracks moves, borrows, and typed constructs |
| Rust | Ownership as a central safety mechanism | A smaller, Rebol-shaped model that targets C |
| Zig | Low-level control and C friendliness | Block syntax and compiler-owned grammar/state-machine constructs |
| Go | Straightforward native programs and approachable syntax | No tracing garbage collector; ownership and refcounted shared series instead |
Recoil is most interesting when the combination matters: Rebol's language ergonomics, native compilation through C, and ownership-based safety in one small compiler.
What to expect
The workflow is intentionally native: install Rebol 3, use a C compiler, run recoil.r3, and inspect the generated C when that helps. Expect a young ecosystem, a fast-moving compiler, and a language whose best ideas are already visible in working code.
Next steps
Getting Started →
Install Rebol 3 and a C compiler, then build a first program.
Language Guide →
Read the syntax, type, ownership, and control-flow basics.
FFI & Systems →
See how Recoil binds C libraries and maps ABI-facing types.
PARSE →
Explore the compiled grammar dialect.
State Machines →
Learn the FSM and FST language constructs.
Internals →
Inspect the compiler pipeline from source to generated C.