Hasty Briefsbeta

Bilingual

TurboPython – A Python-to-C++ Compiler

7 hours ago
  • TurboPython is a compiled language that extends Python with a static ownership model, requiring type annotations on parameters, returns, and fields.
  • It lacks a garbage collector; every value has a single owner (function frame, field, or container) that controls its lifetime.
  • CPython packages like numpy or requests cannot be imported; dependencies must be written in TurboPython or ported to it.
  • Ownership rules: returning an object from a function moves ownership; fields must own their values via Own[] annotation; appending to a list copies unless the object is moved.
  • Dynamic Python features (eval, monkey-patching, __dict__ mutation) are disallowed; types and structure are fixed at compile time.
  • Primitives, tuples, and views copy by default; reference types (classes, lists, dicts, sets) are passed and returned by reference.