Rustica Programming Language
Rustica is a novel programming language with language integrated query (LINQ) technology and a robust effect system, providing developers with a seamless, type-safe, and expressive interface for database interaction directly within the language's syntax and type system.
Data-Centric
- Reads and writes data using only native language syntax like comprehensions and iterators, no SQL or ORM needed
- Fully compatible with PostgreSQL native data types, zero copy or conversion, seamless flow from API to database
- Provides comprehensive migration toolchain, you maintain your schema and Rustica handles the rest
Safe & Efficient
- Strong static type system catches most errors at compile time, ensuring code correctness and reducing mental burden
- Functional-style immutable data structures, avoiding side effects and unsafe state changes, improving concurrency
- Generates efficient WebAssembly bytecode with AoT compilation, C/C++ level performance in a secure sandbox environment
DX First
- Declarative and natural syntax, effortlessly write readable and maintainable code, making complex logic easy to express and understand
- Orthogonal, expressive, and intuitive design: fewer core concepts and syntax rules, yet greater composability.
- Supports structured/graphical programming with a gentle learning curve for all developers
Type System
- Prefix polymorphism: achieves high-level abstraction and safe reuse of functions, effects, and data structures
- Side effects are precisely annotated in types, assisting both compiler optimizations and risk assessment for callers
- Cardinality and multiset types provide intuitive and type-safe annotations for LINQ syntax, enhancing clarity and safety
Effect System
- Side effects (I/O, state, exceptions, etc.) are no longer scattered in code but abstracted as composable effects, keeping core logic pure
- Exceptions, coroutines, async operations, and transaction control are all unified under a single abstraction, less to worry about
- Effect handlers are easily replaced without changing business logic, making it easier to migrate to new environments
Graph-Relational Model
- "Tables and foreign keys" are now "concepts and links" (DDL SQL by compiler), making schema design more programming-friendly
- Database values are unified as "multisets" for consistent behavior, addressing SQL limitations such as NULL semantics.
- Cardinality introduces predictable and computable quantity constraints to the multiset type system (optionality + multiplicity).
Examples
TBD
Formal Definition
Drafter: CAIMEO | 2025-08-29
Glossary
TBD