MCPcopy Index your code
hub / github.com/Slynx-Language/slynx

github.com/Slynx-Language/slynx @v0.0.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.0.1 ↗ · + Follow
714 symbols 2,032 edges 99 files 398 documented · 56% updated 3d agov0.0.1 · 2026-05-04★ 527 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

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 .slynx sources live under slynx/
  • the IR design is still evolving, and the design reference in middleend/README.md is broader than what main emits today

Workspace Layout

The repository is currently split into these crates:

  • common/: shared AST types and common language data structures
  • frontend/: lexer, parser, HIR generation, and type checking
  • middleend/: SlynxIR and IR/lowering work
  • src/: root library glue (SlynxContext, compile helpers, error presentation)

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 currently exposes helper functions for lowering a .slynx file into IR:

use std::path::PathBuf;

fn main() -> color_eyre::eyre::Result<()> {
    let ir = slynx::compile_to_ir(PathBuf::from("slynx/component.slynx"))?;
    println!("{ir:#?}");
    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("slynx/booleans.slynx")))?;
    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(...) and SlynxContext::start_compilation(...) write the default sibling .sir file
  • 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 slynx/, 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 repository currently has a public tag, v0.0.1, created on 2026-03-21.

At the time of writing, there is still no published GitHub Release page for that tag:

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.

Extension points exported contracts — how you extend this code

HirIdTrait (Interface)
Shared trait for all HIR IDs Ensures all IDs have consistent behavior
crates/hir/src/id.rs

Core symbols most depended-on inside this repo

expect
called by 116
crates/parser/src/lib.rs
with_length
called by 58
crates/slynx_ir/src/ir/model/ptr.rs
get_type
called by 56
crates/slynx_ir/src/ir/temp.rs
get
called by 54
crates/slynx_ir/src/types/tuple.rs
eat
called by 47
crates/parser/src/lib.rs
len
called by 47
crates/hir/src/modules/scopes.rs
len
called by 41
crates/slynx_ir/src/ir/model/ptr.rs
peek
called by 40
crates/parser/src/lib.rs

Shape

Method 557
Function 65
Class 59
Enum 32
Interface 1

Languages

Rust100%

Modules by API surface

crates/lexer/src/tokens.rs42 symbols
src/compilation_context/mod.rs38 symbols
crates/slynx_ir/src/ir/model/instruction.rs33 symbols
crates/slynx_ir/src/types/mod.rs27 symbols
crates/checker/src/lib.rs27 symbols
crates/slynx_ir/src/ir/visualize/formatter.rs25 symbols
crates/hir/src/modules/types.rs25 symbols
crates/slynx_ir/src/ir/model/ptr.rs20 symbols
crates/slynx_ir/src/ir/instructions.rs19 symbols
crates/slynx_ir/src/ir/temp.rs18 symbols
crates/hir/src/model/types.rs18 symbols
crates/hir/src/helpers/types.rs17 symbols

For agents

$ claude mcp add slynx \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page