Compiler commands
These instructions apply to the repository's experimental compiler and require the .NET 8 SDK. Commands below run from the repository root. The language tour explains the source; this page explains how to process it.
Check and inspect source
dotnet run --project compiler/DirectSharp.Compiler -- check compiler/fixtures/samples/CustomerPricing/Program.ds
dotnet run --project compiler/DirectSharp.Compiler -- transpile compiler/fixtures/samples/CustomerPricing/Program.ds -o /tmp/CustomerPricing.cs
check reports source diagnostics. transpile writes readable C# when compilation succeeds. Source locations refer to the original .ds files. Unsupported constructs receive diagnostics; language design examples are not a promise of current compiler support.
Build or run
dotnet run --project compiler/DirectSharp.Compiler -- build compiler/fixtures/samples/CustomerPricing/Program.ds -o /tmp/CustomerPricing.dll
dotnet run --project compiler/DirectSharp.Compiler -- run compiler/fixtures/samples/CustomerPricing/Program.ds --entry CustomerPricing.Program.Run
The pricing entry prints 100.00/90.00. --entry selects an ordinary public static action; Run has no special language meaning. Build emits a CLR library assembly. Run uses the compiler's isolated execution host. Failures produce a nonzero exit code rather than a successful build message.
For multiple-source programs, references, SDK contexts, formatting, console scaffolding and their limits, use the complete command guide. The sample catalogue gives exact source lists and expected output. SDK project builds and package references are covered under projects.