Lumen is a functional programming language designed for clarity, safety, and expressiveness. It brings modern language features into a simple and concise syntax, making it easy to build robust and maintainable software.
Important
Lumen is a personal project, created primarily for my own professional fulfillment and learning.
The goal is not to create the fastest, safest, or most feature-rich language, but rather to explore language design and interpreter implementation. Please consider it an experimental language.
Lumen is built on a foundation of powerful concepts inspired by languages like Rust, Elm, and F#.
- Static Typing: A strong type system catches errors at compile time, not runtime.
- Immutability by Default: Encourages a functional style and makes code more predictable. Variables are immutable unless explicitly marked with mut.
- Rich Type System: Includes expressive algebraic data types like Records(structs) andSum Types(tagged unions) for precise data modeling.
- Powerful Pattern Matching: Exhaustively match against Sum Types, arrays, and other structures for safe and readable control flow.
- Traits for Abstraction: Define shared behavior across different types using traits, similar to interfaces.
- First-Class Functions: Use higher-order functions, create closures, and pass functions as arguments.
- Pipe Operator (|>): Chain functions together in a clean, readable, left-to-right flow.
- Result-Based Error Handling: Functions that can fail return a Result<Ok, Err>type, ensuring that errors are handled explicitly.
To run a Lumen program, use the Lumen executable and provide the path to your entry file.
# Execute a file
./bin/lumen examples/1-basics/01-variables-and-types.lu// main.lu
let main = () => {
  writeln("Hello, Lumen!");
};
main();Lumen comes with a useful standard library to handle common tasks, including:
- fs: File system operations.
- net.http: Building HTTP servers.
- json: Parsing and serializing JSON data.
- math: Common mathematical functions.
- string: String manipulation utilities.
- io: Console and system interaction (input/output).
- sqlite: Interaction with SQLite databases.
- datetime: Date and time functions.
- enum: Higher-order functions for processing collections (mainly arrays).
This project is licensed under the MIT License. See the LICENSE file for details.
