A statically-typed, actor-oriented programming language for concurrent and distributed systems.
Website | Documentation | Playground | Tutorial
curl -fsSL https://hew.sh/install.sh | bashPre-built binaries for Linux (x86_64) and macOS (x86_64, ARM) are available on the Releases page. Also available via Homebrew, Docker, and system packages.
# Hello world
echo 'fn main() { println("Hello from Hew!"); }' > hello.hew
hew run hello.hew
# Start a new project
adze init my_project
cd my_project
hew run src/main.hew
# Interactive REPL
hew evalSee the Getting Started Guide for more.
The compiler has three layers: Rust frontend → MLIR middle layer → LLVM backend.
source.hew → [hew: Rust frontend]
├─ Lexer (hew-lexer)
├─ Parser (hew-parser)
├─ Type Checker (hew-types)
├─ MessagePack Serialize (hew-serialize)
└─ [hew-codegen: C++ MLIR middle layer]
├─ MessagePack AST → Hew dialect MLIR
├─ Hew dialect lowering → func/arith/scf/llvm
└─ LLVM backend → .o (x86_64, wasm32, etc.)
└─ [hew: linker invocation]
└─ cc .o + libhew_runtime.a → executable
- hew-cli/ — Compiler driver (
hewbinary) - hew-lexer/ — Tokenizer
- hew-parser/ — Recursive-descent + Pratt precedence parser
- hew-types/ — Bidirectional type checker with Hindley-Milner inference
- hew-serialize/ — MessagePack AST serialization
- hew-codegen/ — MLIR middle layer + LLVM backend (Hew dialect ops, lowering, code generation)
- hew-astgen/ — Generates C++ msgpack deserialization from AST definitions
- hew-runtime/ — Pure Rust actor runtime (
libhew_runtime.a); also compiles for WASM targets - hew-cabi/ — C ABI bridge for stdlib FFI bindings
- adze-cli/ — Package manager (
adzebinary) — init, install, publish, search - hew-lsp/ — Language server (tower-lsp)
- hew-observe/ — Runtime observability TUI (
hew-observe) - hew-wasm/ — Frontend compiled to WASM for in-browser diagnostics
- std/ — Standard library modules (
.hewsource files + Rust FFI crates) - hew-export-macro/ — Proc macro for stdlib export declarations
- hew-export-types/ — Shared types for the export system
- hew-stdlib-gen/ — Generates stdlib module descriptors for the type checker
- editors/ — Editor support (Emacs, Nano, Sublime)
- completions/ — Shell completions (bash, zsh, fish)
- installers/ — Package installers (Homebrew, Debian, RPM, Arch, Alpine, Nix, Docker)
- examples/ — Example programs and benchmarks
- scripts/ — Development scripts
- docs/ — Language specification and API references
Full documentation at hew.sh/docs
Website source: github.com/hew-lang/hew.sh
| Dependency | Version | Purpose |
|---|---|---|
| Rust | stable (latest) | Frontend compiler, runtime, package manager |
| LLVM | 21.1 | MLIR code generation and LLVM backend |
| MLIR | (bundled with LLVM 21) | Hew dialect and lowering passes |
| CMake | >= 3.20 | Builds hew-codegen (C++ MLIR backend) |
| Ninja | any | CMake build generator |
| clang/clang++ | any (LLVM 21 preferred) | C/C++ compilation of hew-codegen |
Install on Ubuntu/Debian:
# Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# LLVM 21 + MLIR
sudo mkdir -p /etc/apt/keyrings
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key \
| sudo tee /etc/apt/keyrings/llvm.asc >/dev/null
echo "deb [signed-by=/etc/apt/keyrings/llvm.asc] http://apt.llvm.org/noble/ llvm-toolchain-noble-21 main" \
| sudo tee /etc/apt/sources.list.d/llvm.list >/dev/null
sudo apt-get update
sudo apt-get install -y cmake ninja-build \
llvm-21-dev libmlir-21-dev mlir-21-tools clang-21Install on macOS:
# Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# LLVM 21 + MLIR
brew install llvm@21 ninja cmakemake # Build everything (debug)
make release # Build everything (optimized)
make test # Run Rust + native codegen tests
make lint # cargo clippySee make help or the Makefile header for all targets.
These are only needed for specific workflows:
| Dependency | Install | Purpose |
|---|---|---|
| wasmtime | curl https://wasmtime.dev/install.sh -sSf | bash |
Run WASM tests (make test-wasm) |
| wasm32-wasip1 target | rustup target add wasm32-wasip1 |
Build WASM runtime (make wasm-runtime) |
| Python 3 | system package manager | Visualization and fuzzing scripts (scripts/) |
| Java 21 + ANTLR4 | system package manager | Grammar validation (make grammar) |
| cargo-fuzz | cargo install cargo-fuzz |
Parser fuzzing (hew-parser/fuzz/) |
Hew is distributed under the terms of both the MIT license and the Apache License (Version 2.0).
See LICENSE-MIT and LICENSE-APACHE for details.