I wanted to build a 3D web: worlds anyone can step into from a browser, made and shared the way web pages are. 3D engines are hungry. They want every byte of memory to count and every core the machine has, and they want it again for every frame.
I spent six or seven years on a dynamic language, Acorn, before I switched to a static one. Dynamic languages hit two limits. They can't put many cores to work well, and without types a compiler has too little to optimize with. The object-oriented languages that do have types manage memory with a garbage collector, and the way those collectors pause is wrong for an engine that has to finish a frame every sixteen milliseconds.
So I went looking for the people attacking those problems: the stop-the-world pause, many cores, and memory safety. Cyclone asked what C would be if it were safe. Midori built an operating system in a safe language. Pony made actors safe by giving every reference a capability. Rust showed that safety need not cost performance. Studying them led me to regions, permissions and borrowed references, which I wrote up as gradual memory management.
Every language is opinionated, and theirs differed enough from mine that the itch wouldn't go away. It turned into a sink pit of time that lasted over ten years. But here we are.
What I wanted: fast programs and fast programmers
Fast programs do their work with as little time and memory as the work allows. Fast programmers spend little time getting a program right and keeping it right. Over the life of a large system the second matters more, because most of the time goes into changing code that already works. I call that agility, and it has parts you can tick off as you read:
- Safety: the compiler catches what a change breaks while the change is still in front of you.
- Modularity: when requirements change, the change stays small.
- Expressive features: code says what you mean, with little to hold in your head.
- Tooling: error handling today; logging, profiling and fast compiles are coming.
The table stakes
Performance. A language for 3D engines has to keep up with the best, or nobody will build an engine in it. Cone compiles through LLVM, the same optimizing back end Clang and Rust use. Its features let the obvious code be the fast code: values laid out in place, borrowing, memory managed per data structure, and SIMD vectors. And its packages are built for heavy workloads across many cores. How Cone measures up.
Safety. Rust raised the bar by showing that safety need not cost performance. Catching a null dereference, a buffer overflow or a data race when you compile, instead of finding it in production, is agility too. Cone means to match the best here, or do better. The checks Cone makes.
What makes Cone distinctive
- Memory, managed per data structure. Each data structure chooses how its memory is managed: a single owner, a count, an arena, a pool or a collector. One function works on data however it is owned.
- Concurrency without data races. Actors on the outside, parallel loops inside them, one scheduler for both, and races refused when you compile.
- Modularity that absorbs change. A type you don't own gains a capability; an implementation or a memory strategy is swapped with its callers untouched.
- Data in and data out. Most of a program's work is reshaping data, from the form it arrives in to the form it is worked in to the form it leaves in. Cone makes parsing and building first-class work.
The journey isn't over. Try Cone in the playground, read the pages behind each link, and follow along.