Skip to content

Latest commit

 

History

1,447 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ignis Lang

Caution

Ignis is under active development and evolving. It is currently in its early stages and is an experimental language. APIs and syntax may change between versions.

Ignis is a general-purpose programming language with strong, static typing, and immutability by default. Inspired by TypeScript and Rust, Ignis compiles to C and produces native executables via GCC.

Features (v0.4.0)

  • Strong static typing: i8-i64, u8-u64, f32, f64, boolean, char, str, atom
  • Immutability by default: let for immutable, let mut for mutable
  • Generics: Type parameters for functions, records, enums, and type aliases
  • Records and enums: User-defined types with fields, methods, and variants
  • Traits: Lang traits (Drop, Clone, Copy) and user-defined traits
  • Pattern matching: match expressions, if let, while let, let else
  • Compile-time directives: @config(...), @abi(...), and conditional item inclusion
  • Namespaces: Module-level organization with :: access
  • References and pointers: &T, &mut T, *T, *mut T
  • Control flow: if/else, while, for, for-of, break, continue
  • Extension methods: @extension(Type) for adding methods to existing types
  • Function overloading: Multiple functions with the same name, different signatures
  • Modules: import/export for multi-file projects
  • FFI: extern blocks for C interop
  • Borrow checking: Rust-style borrow analysis
  • Collections and memory foundations: HashMap, HashSet, and low-level std memory helpers
  • UTF-8 scalar chars + byte-backed strings: char is one Unicode scalar value, while str/String keep UTF-8 byte storage

See docs/LANGUAGE_REFERENCE_CURRENT.md for full language documentation.

Installation

Requirements

  • Linux (amd64 for release artifacts)
  • GCC, ar (binutils), and make

Quick Install (Linux)

# Install to /usr/local (requires sudo)
curl -fsSL https://raw.githubusercontent.com/Ignis-lang/ignis/main/scripts/install.sh | sudo bash

# Install to ~/.local (no sudo required)
curl -fsSL https://raw.githubusercontent.com/Ignis-lang/ignis/main/scripts/install.sh | bash -s -- --prefix ~/.local

Build from Source

The compiler is written in Ignis (ignis/). Building it from source needs no prebuilt compiler: the repository commits a C seed (bootstrap/seed/) that GCC turns into a first compiler, which then builds the current sources. Besides the requirements above, this needs xz, sha256sum and git, and takes several minutes.

# Build from source with the installer
curl -fsSL https://raw.githubusercontent.com/Ignis-lang/ignis/main/scripts/install.sh | bash -s -- --build

# Or build manually with the bootstrap ladder (also needs python3)
git clone https://github.com/Ignis-lang/ignis.git
cd ignis
scripts/bootstrap.sh stage1-from-seed   # C seed -> stage0 -> stage1
scripts/bootstrap.sh stage2             # stage1 -> stage2, the binary a release ships
./build/bootstrap/stage2/ignis --help

See BOOTSTRAP.md for the stages and the gates.

Arch Linux

cd scripts
makepkg -si

Nix

The Nix package builds the compiler from the C seed, which takes several minutes.

# Run from flake
nix run github:Ignis-lang/ignis

# Install in your profile
nix profile install github:Ignis-lang/ignis

# Development shell
nix develop github:Ignis-lang/ignis

Or with traditional Nix:

nix-build -A package
./result/bin/ignis --help

Uninstall

# Uninstall from /usr/local
curl -fsSL https://raw.githubusercontent.com/Ignis-lang/ignis/main/scripts/uninstall.sh | sudo bash

# Uninstall from ~/.local
curl -fsSL https://raw.githubusercontent.com/Ignis-lang/ignis/main/scripts/uninstall.sh | bash -s -- --prefix ~/.local

Verify Downloads

sha256sum -c ignis-linux-amd64.tar.gz.sha256

# Optional: verify detached signature if present
gpg --verify ignis-linux-amd64.tar.gz.asc ignis-linux-amd64.tar.gz

Quick Start

Create a file hello.ign:

import Io from "std::io";

function main(): void {
    Io::println("Hello, Ignis!");
    return;
}

Build and run:

ignis build hello.ign -o hello
./hello

Usage

# Compile a single file
ignis build main.ign

# Compile a project (uses ignis.toml)
ignis build

# Build the standard library
ignis build-std

# Type-check without code generation or linking
ignis check main.ign

# Additional options
ignis build main.ign -o main                 # Name the output binary
ignis build main.ign -O 2                    # Set the C optimization level (0-3)
ignis build main.ign --debug                 # Build with debug information
ignis build main.ign --dump-drop-schedule    # Print the ownership drop schedules

# Run the project's @test functions
ignis test

# Format one or more files canonically
ignis fmt src/main.ign
ignis fmt std/fs/mod.ign std/io/mod.ign std/path/mod.ign

# Check formatting without rewriting
ignis fmt --check src/main.ign

# Emit diffs instead of rewriting
ignis fmt --emit diff src/main.ign

Formatter defaults: indent_width = 2, line_width = 100, use_tabs = false, sort_imports = false. Canonical layout includes inline empty high-level blocks (namespace Foo {}), multiline trailing commas, and no trailing comma on single-line signatures or record initializers.

Example

import Io from "std::io";
import String from "std::string";

record Box<T> {
    value: T;
}

function identity<T>(x: T): T {
    return x;
}

function main(): void {
    let box: Box<i32> = Box { value: 42 };
    let result: i32 = identity<i32>(box.value);
    
    Io::println(String::toString(result));
    
    return;
}

Project Structure

For multi-file projects, create an ignis.toml:

[package]
name = "myproject"
version = "0.1.0"

[build]
source_dir = "src"
out_dir = "build"

ignis build in that directory writes the executable to build/bin/myproject.

Contributions

Ignis is open for contributions. You can:

  • Report bugs or issues
  • Propose new features
  • Submit pull requests with improvements

Releases

Packages

Used by

Contributors

Languages