Follow one path, but make it comfortable
A minimalistic yet powerful language with innovative error handling and contracts, designed for developers who value performance and expressiveness in systems programming.
Xarxo is built with a clear vision of what a modern systems programming language should be.
We believe systems programming should be both powerful and accessible. Xarxo combines:
Our approach: "One paradigm - multiple possibilities". We don't force OOP where it's not needed, but provide tools for functional and procedural programming.
Xarxo is designed for engineers who value correctness and reliability above all else:
We embrace the UNIX philosophy of doing one thing well, extended with modern engineering practices.
Xarxo offers unique solutions for modern systems programming challenges.
Innovative error handling with declarative execution paths. Visualize error flows for better understanding.
Learn moreDefine preconditions, postconditions and invariants at function signature level. Automatic runtime checking.
Learn moreGuaranteed state rollback on error. Choose between partial or complete rollback.
Learn morePowerful static typing with algebraic data types, generics, and type inference.
Learn moreExplore the innovations that make Xarxo unique for systems programming.
Error Flows revolutionize error handling by replacing traditional try/catch blocks with declarative execution path descriptions.
Instead of catching exceptions arbitrarily, developers describe all possible execution paths, including error handling, in a dedicated flows
block.
This enables:
public func process_file(path: str) -> Result<Data> // Declarative execution paths flows { open_file -> read_content -> process_data open_file => FileNotFound: handle_missing_file read_content => IOError: handle_io_error process_data => ValidationError: log_error } { // Main execution path file = open_file(path)! content = read_content(file) result = process_data(content) back result // Error handlers flow handle_missing_file(error: FileNotFound) { log("File not found: {path}") back default_data() } flow handle_io_error(error: IOError) { log("IO error: {error.message}") escalate(error) // Propagate error } }
All execution paths, including error handling, are described in one place, improving readability.
Compiler ensures all possible errors have handlers, eliminating unexpected failures.
Resources are automatically released on any execution outcome, including errors.
Function contracts are a powerful mechanism for defining and verifying function execution conditions directly in their signature.
They explicitly specify:
Contracts are checked both at compile time (static conditions) and runtime (dynamic conditions).
// Contracts defined before function #contract( atomic=true, requires=[amount > 0, from.balance >= amount], ensures=[from.balance == old(from.balance) - amount, to.balance == old(to.balance) + amount] ) public func transfer_funds( from: Account, to: Account, amount: float ) -> Result<Transaction> { // Core logic banking.withdraw(from, amount)! banking.deposit(to, amount)! back Transaction(from, to, amount) }
Execution conditions are explicitly stated in function signature.
Automatic condition checking eliminates entire classes of errors.
Violated contracts immediately identify the failed condition.
Atomicity in Xarxo guarantees that a function either completes fully or has no effect on system state. This is critical for operations affecting multiple entities.
Key aspects:
Atomic functions are ideal for financial operations, database work, and any scenario requiring data integrity guarantees.
// Marked as atomic function #contract(atomic=true) public func update_user_profile(user: User, profile: Profile) { // Preserve change history temporal user_history = user.history // Update data user.name = profile.name user.email = profile.email user.phone = profile.phone // Validation validate_user(user)! // Commit new state on success user.history.commit() }
Guarantees system remains in consistent state even with errors.
Enables complex multi-step operations without intermediate states.
Temporal variables preserve change history for debugging and auditing.
Xarxo's type system combines safety with flexibility for systems programming.
Compile-time type checking eliminates entire classes of runtime errors. Explicit type declarations ensure code clarity.
Sum types and product types enable expressive data modeling. Pattern matching for exhaustive case handling.
Type-safe generic programming with trait constraints. Zero-cost abstractions with monomorphization.
Reduces boilerplate while maintaining safety. Local type inference with explicit signatures at API boundaries.
Special types for hardware resources with ownership semantics. Automatic cleanup guarantees.
Limited dependent types for compile-time validation of array bounds, matrix dimensions, and other invariants.
// Define a sum type type NetworkEvent = | Connect(ip: IPAddress) | Disconnect(reason: str) | Data(payload: [u8]) // Pattern matching public func handle_event(event: NetworkEvent) { match event { Connect(ip) => log("Connected to {ip}") Disconnect(reason) => log("Disconnected: {reason}") Data(payload) => process_data(payload) } } // Generic function with constraints public func sort<T: Ord>(items: [T]) -> [T] { // Implementation }
Xarxo balances familiarity with innovation for a productive developer experience.
Syntax that feels familiar to C-family developers, while introducing carefully designed innovations where they provide significant benefits.
Prefer explicit declarations at module boundaries while allowing inference within implementation code for better readability and safety.
First-class support for resource management with clear ownership semantics and lifetime tracking.
Maximize compile-time checks to minimize runtime errors, especially for systems programming concerns.
No mandatory runtime or garbage collector, enabling use in constrained environments from embedded to kernel development.
Simple core language with advanced features available but not required for basic usage.
// File resource with ownership public func read_config() -> Result<Config> { // 'file' owns the resource file = open("config.toml")? // Automatically closed at end of scope content = file.read_all() parse_config(content) } // Explicit ownership transfer public func process_data(data: owned Data) { // Takes ownership of data }
Our strategy for language and ecosystem development over the next 18 months.
We plan to actively involve the community in language development through:
Development plan for ecosystem tools:
Planned activities for community building:
Focused events with themes like "Systems Tooling", "Embedded Development", and "Concurrency Models".
Monthly live Q&A sessions with language designers and core contributors.
Community-led learning groups exploring advanced language features and systems concepts.
Become part of developing a language that changes systems programming.