Cone is a powerful, easy-to-use systems programming language, used to build realistic, interactive, 3D web worlds. It is designed for real-time performance and responsiveness, compile-time safety, and programmer flexibility and convenience.
To serve that goal, Cone is:
- a modelling language, as it enables specification of complex systems that can be simulated via real-time high-quality rendering, timely interactions between people and parts, and rule-driven changes of state.
- an event-driven language, so worlds stay calm and responsive while juggling a blur of competing workload demands.
- an object-oriented language, as snapping together flexibly typed, modular parts, each with its own content and behavior, is ideally suited to the object-oriented paradigm.
- a static language, to accelerate performance and ensure compile-time memory, concurrence and type safety.
Cone offers a rich set of features (see the Showcase for code examples):
- Readable, modular marriage of 3D content and behavior:
- 'this' blocks and operators for specifying static or runtime content
- @ operator for snap-together inclusion of Internet-hosted content
- Content iterators and 'each' control block
- Url-based packaging and resource handling:
- Dynamic, asynchronous-capable resource loading
- Extensible url schemes and content type de-serialization
- Programs are treated as dynamically loadable resources
- Automatic resource unzip and de-compression
- Relative url addressing
- Memory, type, and concurrency safe
- Gradual memory management:
- Supports use of multiple GCs in one program
- Static allocators: stack and Rust-like lexical GC
- Runtime GCs: reference counting and tracing GC
- Object pools and arenas
- Lifetime-checked borrowed references
- Robust type system:
- Sum types, structs, arrays, slices, ranges, aliases
- Type inference
- Structural and nominative typing
- Modules, Interfaces, Generics and Classes
- Multiple inheritance
- Method override and super
- Operator overloading
- Computable properties (get/set functions and closures)
- Lightweight concurrency
- Co-routines, threads and actors
- Lockless and locked permissions for safe data sharing
- Functions, Methods and Closures
- Variadic parameters and multiple return values
- Implicit return and tail-call optimization
- Extensible pattern matching:
- Type-defined '~~' match operator
- 'match' blocks using custom match methods
- Content extraction during matching
- 'do' block for context management
- Concise, readable code:
- 'this'-implied prefix operators for method cascading, etc.
- Control clauses for 'if', 'while', 'each'
- Parallel assignment
- Off-side rule support
- Unicode-aware (UTF8) text strings and variable names
- Fast compilation and convenient packaging
This Cone Language Reference is written for people comfortable and familiar with programming concepts and code. It contains the following sections:
- Showcase. A few selected examples that demonstrate Cone's visual style and idioms.
- Language Reference. Progressive and comprehensive descriptions (with examples) of Cone's features.
- Syntax. Formal grammar using railroad diagrams and EBNF notation.