Rust-like Syntax
Familiar syntax with pattern matching, algebraic data types, and powerful type inference. If you know Rust, you'll feel right at home.
A Rust-inspired language for building type-safe JavaScript.
Pattern matching, algebraic data types, and strong static typing — compiling to clean, readable JS that runs everywhere.
cargo install husk-lang fn divide(a: i32, b: i32) -> Result<i32, String> {
if b == 0 {
Err("Division by zero")
} else {
Ok(a / b)
}
}
fn main() {
// Compiler ensures all cases are handled!
match divide(10, 2) {
Ok(value) => println("Result: {}", value),
Err(err) => println("Error: {}", err),
}
} The power of Rust's type system, the reach of JavaScript's ecosystem. Write once, run anywhere — with confidence.
Familiar syntax with pattern matching, algebraic data types, and powerful type inference. If you know Rust, you'll feel right at home.
Catch errors at compile time with a robust type system. Strong static typing with inference means safety without verbosity.
Fast compile times, clear error messages, and excellent tooling. LSP support, code formatting, and editor integrations included.
Seamlessly call npm packages and JavaScript libraries. Compiles to clean ES modules that integrate with any JS project.
Clean, expressive syntax that compiles to readable JavaScript. No runtime overhead, no magic — just better code.
Exhaustive pattern matching with algebraic data types
fn divide(a: i32, b: i32) -> Result<i32, String> {
if b == 0 {
Err("Division by zero")
} else {
Ok(a / b)
}
}
fn main() {
match divide(10, 2) {
Ok(value) => println("Result: {}", value),
Err(err) => println("Error: {}", err),
}
// Compiler ensures all cases are handled!
} Husk is open source and community-driven. Get involved, learn, and help shape the future of the language.
Comprehensive guides, API reference, and tutorials to get you started.
View the source code, report issues, and contribute to Husk.
Join the community, ask questions, and connect with other Husk developers.
Want to contribute? Check out the contributing guidelines to get started.
Star on GitHub