https://github.com/degory/ghul
compiler for the ghūl programming language
https://github.com/degory/ghul
compiler dotnet dotnet-core ghul programming-language
Last synced: 11 days ago
JSON representation
compiler for the ghūl programming language
- Host: GitHub
- URL: https://github.com/degory/ghul
- Owner: degory
- License: agpl-3.0
- Created: 2017-06-21T15:39:36.000Z (over 8 years ago)
- Default Branch: main
- Last Pushed: 2025-09-25T20:40:00.000Z (4 months ago)
- Last Synced: 2025-10-29T06:54:24.139Z (3 months ago)
- Topics: compiler, dotnet, dotnet-core, ghul, programming-language
- Language: Shell
- Homepage: https://ghul.dev
- Size: 12.6 MB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 121
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# ghūl compiler
[](https://github.com/degory/ghul/actions?query=workflow%3ACI)
[](https://www.nuget.org/packages/ghul.compiler/)
[](https://github.com/degory/ghul/releases)
[](https://github.com/degory/ghul/releases)
[](https://github.com/degory/ghul/issues)
[](https://github.com/degory/ghul/blob/main/LICENSE)
[](https://ghul.dev)
This is the compiler for the [ghūl programming language](https://ghul.dev). It is a [self-hosting compiler](https://en.wikipedia.org/wiki/Self-hosting_(compilers)): the compiler itself is written entirely in ghūl.

## Prerequisites
The compiler requires the [.NET 8.0 SDK](https://dotnet.microsoft.com/en-us/download/dotnet/8.0)
## Target
The compiler produces standard .NET assemblies and packages targeting .NET 8.0
## Getting the compiler
There are a few different ways to get the compiler
### Use a ghūl .NET project template
If you initialize your project using one of the [ghūl .NET project templates](https://www.nuget.org/packages/ghul.templates/), the template will add the compiler to your project folder as a local .NET tool - just run `dotnet tool restore` to restore it.
### Clone the ghūl GitHub repository template
If you create a new GitHub repo from the [ghūl repository template](https://github.com/degory/ghul-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.
### Use the ghūl development container image
The compiler is pre-installed globally in the [ghūl development container](https://github.com/users/degory/packages/container/package/ghul%2Fdevcontainer)
### Install the compiler as a local or global .NET tool
You can manually install the compiler from the [ghūl compiler .NET tool package](https://www.nuget.org/packages/ghul.compiler/)
## Using the compiler
### Project file
The compiler expects to be driven by MSBuild using a `.ghulproj` project file.
See the [ghūl test](https://github.com/degory/ghul-test) project for
a real-world example, or use one of the project templates to get started.
### Source files
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.
### Building and running
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:
```sh
dotnet build
```
```sh
dotnet pack
```
```sh
dotnet run
```
### Runtime dependencies for ghūl applications
Applications written in ghūl require the [.NET 8.0](https://dotnet.microsoft.com/download/dotnet/8.0) runtime
## Development environment
[Visual Studio Code](https://code.visualstudio.com) will give you rich language support via the [ghūl VSCode language extension](https://marketplace.visualstudio.com/items?itemName=degory.ghul).
## Basic ghūl language tutorial
For a short ghūl programming language tutorial and reference, see [GHUL.md](./GHUL.md) in this repository. For more ghūl language details, see the [the ghūl programming language website](https://ghul.dev)
## Gotchas
The ghūl language is sufficiently expressive and the compiler is stable enough for the compiler itself to be written in ghūl. However, this is an _incomplete compiler_ for an _experimental programming language_: there will be [compiler bugs](https://github.com/degory/ghul/issues?q=is%3Aissue+is%3Aopen+label%3Abug)!