Skip to content

TheRealMichaelWang/NoHoPython

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The North-Hollywood Python Compiler

A strongly-typed, memory-safe, compiled dialect of Python, that transpiles to human-readable C.

  • Guarentees memory saftey by enforcing RAII, and executing limited reference counting for closure-captured classes
    • Unlike rust, NoHoPython reference counting - which is only used for capturing classes for closures - guarentees no memory leaks.
  • Guarentees type saftey via a strong yet flexible static type-checker
    • No null. Enums/Variants are used instead.
    • Enum/Variant match statements must be exhaustive.
  • Supports first-class, anonymous functions
    • Functions can be passed around as values
    • Supports closures, which are functions that can capture variables outside of it's lexical scope
    • No globals. Functions only can mutate arguments, and captured classes in addition to it's locally defined varaibles.
  • Code organized via a powerful module system
    • No C++-esque using namespace's(prevents pollution of the global namespace)
  • Runtime Saftey
    • Array access' are all bounds checked.
    • No Undefined Behavior, despite targeting C
      • Sequence of evaluation is guarenteed
  • Easy C interop
    • Effortless FFI interop with C, via the cdef keyword.
    • Include C headers with the cinclude keyword
  • Information-Rich Error-Reporting
    • Clean, precise error messages during compile time
    • Runtime errors, such as assertion faliures or index-out-of-bounds errors, are reported with their locations in the source code.
    • Reports informative, pythonic stack traces (not only for user-defined, NHP functions but also for calls to foreign C functions)
    • Built-in memory debugging that can report memory leaks