r/ProgrammingLanguages • u/thecoommeenntt • Mar 08 '26
I’m building a programming language (Cx) would anyone be willing to check it out and give feedback?
Building a systems language called Cx looking for design feedback
Site: https://cx-lang.com · Repo: https://github.com/COMMENTERTHE9/Cx_lang
Cx is a systems language aimed at game engines and real-time simulation. Early stage tree-walk interpreter right now, compiler backend coming.
Core goals
- No GC, no runtime pauses
- Deterministic memory via arenas + handles
- Control without a borrow checker
What's working today
- Functions with typed params, implicit/explicit returns
- Numeric types
t8..t128,f64, strings with{name}interpolation - Arena allocator + free checker (double-free prevention)
Handle<T>registry with generation counters and stale detection- Parameter copy modes:
.copy,.copy.free,copy_into whenblocks with ranges, enums, and three-state bool (true/false/unknown)- Basic enums
Not done yet
- Loops, structs, arrays
- Modules, generics, stdlib
- Compiler backend
cx
fnc greet(name: str) {
print("hello {name}")
}
greet("Zara")
4
Upvotes
View all comments
Show parent comment
1
u/thecoommeenntt Mar 08 '26
here's where Cx stands on each:
Use-after-free prevented by generation-counted handles. When a slot is freed the generation bumps. Any old handle pointing at that slot gets None on access, never a crash or corrupt read.
Methods that return objects yes, functions return values. Strings copy into the caller's arena on return. Long-lived objects come back as Handle<T>.
References and shared ownership three levels. Handle<T> for long-lived single-owner objects. rc<T> for single-threaded shared ownership with reference counting. shared<T> for multi-threaded shared ownership with atomic reference counting
Dangling references handles solve this. A raw reference to an arena value cannot outlive the arena by design the boundary checker enforces this at compile time. View types like strref are arena-local and cannot escape their scope. That's the boundary rule. Storing objects in containers yes. Container type exists. Cross-scope container movement requires
Handle<Container> raw containers cannot cross scope boundaries in v0. That restriction is explicit and intentional until handle-backed containers are fully designed.
The memory model is arenas plus handles plus rc plus shared plus NullPoint plus explicit unsafe. Not just arenas. The docs need to communicate that better that's on me