Concise by design.
Infer a type with :=, use indentation for blocks, and let a newline finish a statement. Keep your attention on the idea.
name := "Ada"
for 3
print "Hello, ${name}. Round ${$ + 1}."
See the language guide
THINK COSMIC. BUILD NATIVE.
Magister Catalyst, subsequently referred to simply as Catalyst, is a general-purpose programming system. Its Cosmic language combines C++23 interoperability with scripting-style expressiveness, backed by a complete native compiler.
Standard C++ and Cosmic, in the same source file. Seamlessly intermix standard C++ with Cosmic’s expressive syntax, sharing types, functions, and libraries. Adopt Cosmic features incrementally, or use Catalyst entirely as a general-purpose C++23 framework.
macOS · Apple SiliconLinux coming soon
Cosmic’s concise, expressive syntax keeps complex programs readable and makes everyday coding more direct. Point a modern coding agent to the extensive language guide and SDK reference to give it the context it needs.
In our experiments, agents have quickly learned the language from this documentation and produced complex, highly readable Cosmic code.
01 / THE COSMIC LANGUAGE
Keep C++’s type system, templates, standard headers, and object lifetimes. Add language features that make everyday programming more direct.
Infer a type with :=, use indentation for blocks, and let a newline finish a statement. Keep your attention on the idea.
name := "Ada"
for 3
print "Hello, ${name}. Round ${$ + 1}."
See the language guide
Interpolate variables and expressions directly into strings. Messages, paths, and output read the way you mean them.
project := "Orion"
progress := 75
print "${project}: ${progress}% complete"
See the language guide
Traverse elements with a pipe and use $ for the current value. Maps also expose $k and $v for keys and values.
[int] scores = {10 20 30}
scores|
$ *= 2
scores|print $
See the language guide
Write a trailing callback beside the operation that uses it. Numbered placeholders become its parameters—even with standard C++ algorithms.
[int] values = {3 1 2}
std::sort(values.begin(), values.end()){
return $0 < $1;
};
See the language guide
Use a compact property expression to call an existing getter or setter. The class still defines the behavior.
// Counter provides value() and setValue().
Counter counter
counter`value = 7
print counter`value
See the language guide
A dispatch ends each completed case automatically. Express the decision without repeating a break after every branch.
dispatch 2
case 1
print "First"
case 2
print "Second"
See the language guide
Classes, overloads, generics, standard-library algorithms, and native resource management. Cosmic builds on the ecosystem you already know.
A SMALL PROGRAM. A BIGGER VOCABULARY.
Type inference, interpolation, and collection traversal fit into a few lines of Cosmic. Compile the result into an executable with the compiler included in the SDK.
#include core
int main()
name := "Ada"
[int] scores = {10 20 30}
print "Hello, ${name}."
scores|
print "${$} doubled is ${$ * 2}"
CMap<cstr, int> team = {
{"Ada", 42}, {"Grace", 64}
}
team|
print "${$k} scored ${$v}"
%0
#include <iostream>
#include <mc/cvar.h>
using namespace mc;
int main(){
cvec samples{20.0, 21.0, 22.0};
samples << 23.0;
// Calibrate every reading.
samples += 0.5;
cvar report = cmap{
{"sensor", "studio"},
{"samples", samples},
{"calibrated", true}
};
report["count"] = samples.size();
// Serialize the report as CSON.
std::cout << report << '\n';
}
import cms
summarize(samples)
total := 0
samples|
total += $
%{
count: samples`size
mean: total / samples`size
}
sensors := {
studio: [20.0 21.0 22.0]
garden: [16.0 18.0 20.0]
}
sensors|
stats := summarize($v)
print {sensor: $k stats: stats}
02 / CSON · STRUCTURE WITH EXPRESSION
CSON is Catalyst’s notation for structured data: maps, vectors, strings, numbers, booleans, and more. It combines familiar JSON-style values with conveniences such as comments and unquoted keys.
In Cosmic, embed CSON directly in your source. Mix nested data with variables and expressions to construct a cvar tree. There’s no string to parse at runtime.
Data can use your code.project is a variable. width / 2 is an expression. Both become values in the structure.
cstr project = "Orion"
int width = 640
cvar scene = {
name: project
size: [width, width / 2]
layers: ["sky", "terrain", "light"]
render: {
samples: 64
transparent: true
}
}
scene:status = "ready"
cvar quality = scene:quality|"high"
Use CSON files for configuration and structured input. Alongside JSON-style data, CSON supports symbols and expression values.
Read about CSONRead scene:name, check scene?quality, or supply a fallback with scene:quality|"high".
Configuration, messages, database descriptions, and drawing specifications share Catalyst’s structured values.
42 · 3.14"hello"[10, 20, 30]CObjectname → valuef(x, y)03 / CVAR · THE CONNECTIVE TISSUE
cvar is central to Catalyst. Numbers, text, collections, objects, symbols, and expressions can live in the same value model—and move through the same APIs.
04 / THE COMPLETE COMPILER IS INCLUDED
The distribution includes mc-cosmic, a complete native compiler built on LLVM. Your Cosmic source becomes native code for the machine you’re working on.
# Compile the Cosmic example above
$ mc-cosmic -O2 -o hello hello.cc
$ ./hello
Hello, Ada.
10 doubled is 20
20 doubled is 40
30 doubled is 60
Ada scored 42
Grace scored 64Compile executables or native object files. CMake integration lets Cosmic and C++ sources work together in one project.
Source locations and debug information lead back to Cosmic. Use LLDB to step through your original program.
The SDK includes headers, libraries, Mac frameworks, configuration, resources, documentation, and worked examples.
Download for macOS on Apple Silicon. Use Xcode or Apple’s Command Line Tools; see the SDK guide for requirements. Linux is coming soon.
05 / THE CATALYST TOOLKIT
Give your program somewhere to store its data, a way to reach the outside world, and a canvas for its results. The framework brings those pieces together.
CDatabase is a high-performance, scalable database system designed for use within Cosmic, with integrated features for querying and modifying state. Define schemas in CSON, work with typed rows, and query indexed, persistent tables. Built on top of CDatabase, CSQL provides an extensive SQL interface for querying and managing data. Catalyst also includes CDB for PostgreSQL connectivity.
| id | name | score |
|---|---|---|
| 01 | Ada | |
| 02 | Grace | |
| 03 | Alan |
Embed GPU functions and kernels directly in your Cosmic source files, alongside your CPU code. A streamlined launch interface makes it straightforward to bind data, define the execution grid, and run your kernels.
An extensive GPU library mirrors familiar Cosmic interfaces for containers, strings, algorithms, and utilities, bringing a consistent programming model to CPU and GPU development.
Explore Cosmic on the GPUAlso included: drawing with CDraw, rendering with CRender, and plotting with CPlot.
CMessenger provides asynchronous native messaging through queued sends and callbacks for incoming values. This supports rapid development of client/server applications and distributed and parallel systems. Catalyst also includes HTTP clients, web servers, and WebSocket clients.
Explore CMessengerCatalyst’s extensive container library extends standard C++23 interfaces with practical convenience methods, retaining familiar APIs and interoperability with the underlying containers. Standard operations and Catalyst additions work side by side.
Specialized containers broaden the collection beyond the standard library, with bounded vectors, component-wise arithmetic vectors, and sorted sets with vector-style indexing.
Also included: thread pools, queues, files, commands, dates, compression, and error handling.
Explore containers & compatibilityA dynamically typed, streamlined language for rapid experimentation. Interpret it or compile it, using the familiar syntax and idioms it shares with Cosmic.
Meet MicrocosmCommand-line orchestration for working with machines, processes, and configuration, including launching and managing jobs on local clusters.
Explore Nexus06 / WHAT YOU CAN BUILD
Catalyst is designed as a general-purpose programming system. Its languages and native framework support everyday applications alongside demanding work in computation, data, graphics, and networking.
Explore new languages, interpreters, and domain-specific tools with parsers, an extensible interpreter, symbolic values, and CSON.
Run work across CPU cores with thread pools and queues, and coordinate computation across machines through CMessenger’s asynchronous messaging.
Serve files and build HTTP endpoints with CHTTPServer, using configurable request handlers to connect requests to your application.
Build connected native applications with CMessenger’s asynchronous messaging and CServer, exchanging cvar values through queued sends and callbacks.
Retrieve data from websites and APIs with CHTTP. Work with text, JSON, and binary responses as part of your application’s data flows.
Create 2D drawings, 3D scenes, and data plots with CDraw, CRender, and CPlot. Render shapes, text, models, and data into images.
Embed GPU functions and kernels directly in Cosmic, with familiar library interfaces and streamlined launches for Metal on macOS.
Build high-performance local databases designed for very large datasets, with indexed tables, Cosmic integration, and an extensive SQL interface.
Connect to PostgreSQL through CDB, with parameterized queries, schema management, and transactions for applications that share data across a network.
Model evolving systems in Cosmic or Microcosm, explore results through plots and rendering, and capture frame sequences with CTheater.
Build data ingestion and analysis workflows from CSV, CSON, SQL, and plotting. Exchange structured results with Python through cvar.
Create command-line utilities and automate workflows with process control, streamed input and output, filesystem helpers, and concurrent work queues.
Combine the pieces to fit your application. Retrieve data from an API, store it locally, process it on the GPU, and visualize the result—all within the same framework.
Explore the toolkitAdditional Catalyst components will be made available over time, extending the system to support further specialized use cases.
07 / SWIFT & PYTHON INTERFACES
Call into Catalyst directly from Swift and Python. Dedicated language interfaces bring native values, asynchronous messaging, and server APIs into the languages you already use.
Use Catalyst in Swift applications, with throwing methods and conversion between Catalyst values and native Swift types.
import Catalyst
let scene = try CVar([
"name": "Orion",
"samples": 64
] as [String: Any])
try scene.set("samples", to: 128)
print(try scene.toCSON())Work with Catalyst from Python scripts and tools, using familiar dictionaries, lists, and exceptions.
from catalyst import CVar
scene = CVar({
"name": "Orion",
"samples": 64
})
scene["samples"] = 128
print(scene.to_cson())CVar gives Swift and Python access to Catalyst’s cvar values. Convert native collections, read and write CSON, and preserve rich values such as symbols and expressions as you move between languages.
08 / BUILT FOR AI-ASSISTED DEVELOPMENT
Include the language guide, SDK reference, and headers in your agent’s project context. Together, they document Cosmic syntax, interface behavior, and worked examples across the system.
Use these same references when reviewing generated code, checking API usage, and refining the implementation. They give you and your agent a shared basis for development.
Explore the documentationinclude/mc · included in the SDKCatalyst reflects years of language and framework development. More recently, AI-assisted engineering has helped close implementation gaps, prepare the product for release, resolve defects, and produce comprehensive documentation across the system.
09 / FOLLOW YOUR CURIOSITY
Start with a short program, follow a working example, or look up an interface. There’s a route into every part of Catalyst.
Explore the syntax, the C++ foundations, and the features that connect code with data.
Read the language guide THE EXAMPLESWork through 33 examples covering language features, collections, databases, graphics, and more.
Find a worked example THE REFERENCESearch classes, functions, and methods, with their behavior and practical details.
Browse the SDKNo telemetry, registration, or background calls home. Networking happens when you use the networking components.