Veyra is designed with performance as a primary concern, not an afterthought.
Key Decisions:
- Ahead-of-Time (AOT) compilation for maximum runtime performance
- Zero-cost abstractions where possible
- Direct memory access when needed
- LLVM backend for state-of-the-art optimizations
Memory safety should not come at the cost of performance or predictability.
Approach:
- Ownership system similar to Rust but simplified
- Borrow checker prevents data races and memory leaks
- Optional regions/arenas for bulk allocation patterns
- Escape hatch for unsafe operations when needed
Modern applications are concurrent by nature. Veyra makes this easy and safe.
Features:
- Green threads (lightweight, user-space threads)
- Actor model for message-passing concurrency
- Async/await for asynchronous programming
- Channels for safe data sharing
- No shared mutable state by default
Code should be easy to read, write, and understand.
Design Choices:
- Minimal syntax with strong conventions
- One obvious way to do common tasks
- Strong type inference reduces boilerplate
- Consistent naming and patterns throughout
Great languages come with great tools built-in.
Included Tools:
- Package manager (
vey get) - Code formatter (
vey fmt) - Linter (
vey lint) - REPL (
vey repl) - Debugger (
vey dbg) - Documentation generator
- Ownership and borrowing for memory safety
- Pattern matching
- Trait system (adapted as interfaces)
- Cargo-like package management
- Simplicity and clarity
- Fast compilation
- Built-in concurrency primitives
- Single binary distribution
- Clean, readable syntax
- Optional types for null safety
- Protocol-oriented programming
- Actor model for fault tolerance
- "Let it crash" philosophy
- Supervisors for process management
# Clear and obvious
fn calculate_total(items: [Item]) -> Money
total = Money.zero()
for item in items
total += item.price
return total
# Type inference reduces noise
items = [Item("apple", 1.50), Item("banana", 0.75)]
total = calculate_total(items)
print("Total: {total}")
# Error handling
result = dangerous_operation()?
match result
Ok(value) -> print("Success: {value}")
Err(error) -> print("Error: {error}")
Decision: Prioritize runtime performance Rationale: Developers compile less frequently than users run programs
Decision: Safe by default, unsafe when explicitly requested Rationale: Most code benefits from safety; systems code needs control
Decision: Favor simplicity, add expressiveness carefully Rationale: Maintenance is more important than initial development speed
Decision: Break compatibility for meaningful improvements (pre-1.0) Rationale: Better to get the design right than maintain bad decisions
- A replacement for every language - Focused on specific use cases
- Beginner-friendly - Assumes programming experience
- Dynamic - Static typing provides better tooling and performance
- Object-oriented - Composition over inheritance
- Minimalist - Includes batteries, not just core language
Veyra will be successful if:
- Performance: Matches C/C++ in benchmarks
- Safety: Memory-safe programs by default
- Productivity: Developers can build reliable software quickly
- Concurrency: Natural to write concurrent programs
- Adoption: Real projects choose Veyra for its benefits
This document will evolve as the language develops and we learn from implementation experience.