This is the compiler for the ghūl programming language. It is a self-hosting compiler: the compiler itself is written entirely in ghūl.
The compiler requires the .NET 10 SDK. It provides both the .NET 10 runtime the compiler tool itself runs on and the reference assemblies your projects build against.
The compiler produces standard .NET assemblies and packages targeting .NET 10.
There are a few different ways to get the compiler
If you initialize your project using one of the ghūl .NET project templates, the template will add the compiler to your project folder as a local .NET tool - just run dotnet tool restore to restore it.
If you create a new GitHub repo from the ghūl repository template, then the compiler will be pre-configured as a local .NET tool in your project folder - run dotnet tool restore to restore it.
You can manually install the compiler from the ghūl compiler .NET tool package
The compiler expects to be driven by MSBuild using a .ghulproj project file.
See the ghūl test project for
a real-world example, or use one of the project templates to get started.
You'll need some ghūl source files. By convention ghūl source files have the extension .ghul, and the standard MSBuild targets will include **/*.ghul when building.
Once you have a project file and some ghūl source files, you can use the normal .NET SDK commands to build, pack, and run your project:
dotnet builddotnet packdotnet runApplications written in ghūl require the .NET 10 runtime.
Visual Studio Code will give you rich language support via the ghūl VSCode language extension.
Any dev container image with the .NET 10 SDK will do — for example mcr.microsoft.com/devcontainers/dotnet:10.0. Pin ghul.compiler in your project's local .NET tool manifest and the compiler will be restored automatically when the container starts. A minimal worked example is in this gist.
For a short ghūl programming language tutorial and reference, see GHUL.md in this repository. For more ghūl language details, see the the ghūl programming language website
The ghūl language is sufficiently expressive and the compiler is stable enough for the compiler itself to be written in ghūl. Like any compiler it has bugs — issue reports are welcome.