I'm building a clarity-first language (compiles to C++)

(github.com)

1 points | by hedayet 10 hours ago ago

2 comments

  • dusanstanojevic 9 hours ago ago

    Very interesting, I've read your readme and your core principles really resonate with me. How is memory managed?

    • hedayet 7 hours ago ago

      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.