The Compiler
churn
The reference compiler for INTERCAL-64. It parses INTERCAL, emits C#, and invokes csc — producing real .NET assemblies. It descends from Eric Raymond's ick via cringe (2003).
What it does
churn transpiles INTERCAL source to C#, then compiles that to a .NET assembly with csc. It does not interpret — it produces a standalone .exe (or .dll) that runs on the .NET runtime.
Building churn from source requires the .NET 10 SDK:
dotnet build intercal64.sln
This builds churn.exe, the runtime, the DAP debug adapter, and compiles syslib64.dll from INTERCAL source automatically.
Compiling a program
A single file compiles to a single executable:
churn hello.i # -> hello.exe
./hello.exe
Use the - prefix for flags, never / — Windows reinterprets / as a drive path.
Compiling multi-file projects
Source files are consumed in order and compiled into a single executable. List every file, and churn stitches them into one program:
churn main.i knight_attacks.i clear_mask.i center_dist.i # -> main.exe
This is how the real programs are built. The Knight's Tour solver is roughly 570 lines across six source files; the Hilbert-curve geographic index spreads its lookup tables, coordinate data, and sort routines across eight. Each is a single churn invocation listing the files in order.
Labels are global across the combined source, so a routine defined in one file can be reached with DO (label) NEXT from another. This is also why 64-bit labels matter: with every file sharing one namespace, low-numbered labels clash. Prefer labels above INT_MAX for anything reusable.
Compiler flags
| Flag | Effect |
|---|---|
-t:library | Compile to a .dll instead of an executable |
-r:name.dll | Link against a library assembly |
-debug+dap | Enable the DAP debugger |
-noplease | Disable the politeness check |
-b | Brief output — suppress the banner |
Linking libraries
Build a library from INTERCAL source with -t:library (all labels are exposed publicly by default; every code path must terminate in RESUME or GIVE UP). Then reference it when compiling a program:
churn -t:library syslib64.ic64 # build the library
churn -r:syslib64.dll stable_marriage.i # link and compile
See the Libraries page for the routines syslib64 provides.
Cross-language interop
INTERCAL libraries can be consumed from C#, and C# libraries from INTERCAL. A C# extension DLL exposes an entry point that INTERCAL reaches with DO…NEXT:
using INTERCAL.Runtime;
[assembly: EntryPoint("(3000)", "CSIntercalLib", "foobar")]
public class CSIntercalLib
{
public bool foobar(ExecutionContext ctx)
{
ctx[".3"] = ctx[".2"] + ctx[".1"];
return false;
}
}
Because a language that can add is a language that has given up.
Across component boundaries
churn compiles to .NET assemblies, and NEXT / RESUME / FORGET work across them via a thread-pool execution model — so INTERCAL's stack semantics, where FORGET can drop entries from the middle of the call stack, hold even across assembly boundaries. Three constructs stay local, however:
COME FROM— may only target a label in the current component.ABSTAIN/REINSTATE— act only on the local component, gerunds included.IGNORE/REMEMBER— cannot target labels in other components.
churn implements the INTERCAL-64 language, compiles the standard library, and is driven by the VS Code IDE. It supersedes cringe (2003), which is preserved as a historical artifact.
