News for hackers. Stuff that matters.
Re:I'm building a clarity-first language (compiles to C++) by dusanstanojevic on Tuesday February 10, 2026 @11:52PM (#46971003)
Very interesting, I've read your readme and your core principles really resonate with me. How is memory managed?
Re:I'm building a clarity-first language (compiles to C++) by hedayet on Wednesday February 11, 2026 @01:52AM (#46971732)
Great question - we keep memory management intentionally simple.

1. There’s no manual memory management exposed at the language level (no pointers, no allocation APIs). I intend to keep it this way as long as possible.

2. Containers (list[T], dictionary[K,V]) compile directly to C++ STL types (std::vector, std::unordered_map).

3. Values follow a strict rule: primitives pass by value, containers pass by read-only reference. This prevents accidental aliasing/mutation across scopes and keeps ownership implicit but predictable.

Anything created in a scope is destroyed when that scope ends (standard C++ RAII). So in practice, memory management in Rox is C++ lifetime semantics underneath, but with a stricter surface language to reduce accidental complexity.

Re:I'm building a clarity-first language (compiles to C++) by teraflop on Sunday February 15, 2026 @12:10AM (#47021242)
That sounds like it's basically impossible to implement your own non-trivial data structures. You can only use the ones that are already in the standard library.

For instance, how would you represent a binary tree? What would the type of a node be? How would I write an "insert node" function, which requires that the newly-created node continues to exist after the function returns?