Skip to content

Slynx-Language/slynx

Slynx

Experimental UI language workspace focused on the frontend and middleend of the language.

License Rust

Slynx is an experimental programming language project for user interfaces. The long-term direction is to expose a reusable IR that downstream compilers can consume, but the current repository is primarily a library-first workspace for the language frontend and middleend.

Current Status

Slynx is still experimental and under active design.

What is true on the current main branch:

  • the workspace is library-first; there is no official CLI binary target in main right now
  • the root crate can lex, parse, build HIR, run type checking, resolve the current alias surface, and lower source files into SlynxIR
  • the root library can write the default .sir output and can expose .hir / .ir dumps through SlynxContext::build_stages()
  • sample .syx sources live under examples/
  • the IR design is still evolving, and the design reference in crates/slynx_ir/README.md is broader than what main emits today

Workspace Layout

The repository is a Cargo workspace. The root crate (src/) is the library entry point; the individual pipeline stages live under crates/:

What Exists Today

The current codebase already includes:

  • lexical analysis and parsing for core language constructs such as functions, objects, components, aliases, tuple literals/types, and control flow such as if and while
  • HIR generation and name resolution
  • type checking, type inference, and monomorphization for the current supported alias surface
  • library entry points for compiling to IR or inspecting HIR/IR dumps before writing output
  • lowering to the current SlynxIR
  • CI, release, governance, and contribution documentation

The current repository does not ship an official backend crate or an official CLI binary on main.

Getting Started

Prerequisites

  • Rust stable
  • Cargo

Build and Validate the Workspace

git clone https://github.com/Slynx-Language/slynx.git
cd slynx
cargo build
cargo test
cargo fmt --all -- --check
cargo clippy --all-targets --all-features -- -D warnings

Using the Library Today

The root crate exposes helper functions for lowering a .syx file into IR:

use std::path::PathBuf;

fn main() -> color_eyre::eyre::Result<()> {
    let ir = slynx::compile_to_ir(PathBuf::from("examples/component.syx"))?;
    println!("{ir:#?}");
    Ok(())
}

To write the default .sir output file alongside the source:

use std::path::PathBuf;

fn main() -> color_eyre::eyre::Result<()> {
    slynx::compile_code(PathBuf::from("examples/component.syx"))?;
    Ok(())
}

If you want to inspect intermediate dumps before writing output, the root context also exposes stage building:

use std::{path::PathBuf, sync::Arc};

fn main() -> color_eyre::eyre::Result<()> {
    let context = slynx::SlynxContext::new(Arc::new(PathBuf::from("examples/booleans.syx")))?;
    let stages = context.build_stages()?;

    println!("{}", stages.hir_text());
    stages.write_hir()?;
    stages.write_ir()?;

    let output = stages.into_output();
    output.write()?;
    Ok(())
}

Today:

  • compile_code(...) writes the default sibling .sir file
  • compile_to_ir(...) returns the compiled SlynxIR directly
  • build_stages() lets callers inspect or persist .hir and .ir dumps through the library API
  • there is still no polished CLI workflow for dump generation on main

Example Sources

Real samples that match the current repository syntax live under examples/, for example:

One small component example:

component Header {
    Div {
        Icon {
            src: "https://github.icon.this.url.does_not_exist.com"
        }
    }
}

component Footer {
    Div {
        Text {text: "Footer of page"}
    }
}

component Main {
    Div {
        Text {text: "Main Part"}
    }
}

component Website {
    Div {
        Header {}
        Main {}
        Footer {}
    }
}

func main(): Component {
    Website {}
}

Documentation Map

Core project documents:

Operational templates:

Releases and Versioning

The latest release is v0.0.1, published on 2026-05-04.

For the release process itself, see RELEASING.md.

Contributing

Contributions are welcome, especially in these areas:

  • frontend/parser/type-checker work
  • IR and middleend design
  • tests and regression coverage
  • documentation and specifications

Start with CONTRIBUTING.md before opening a PR.

Community

License

This project is licensed under the MIT License. See LICENSE for details.

About

Tryna make a ui lang for the web

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors