-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Eman Castillo edited this page Dec 20, 2022
·
18 revisions
Welcome to the North-Hollywood Python, a strongly-typed, memory-safe, compiled Python dialect that transpiles to human-readable C.
The benefits and features of NHP are the following:
- Guarantees memory safety 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 - guarantees no memory leaks.
- Guarantees type safety 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 its lexical scope
- No globals. Functions only can mutate arguments, and captured classes in addition to its locally defined variables.
- Code organized via a powerful module system
- No C++-esque
using namespace
(prevents pollution of the global namespace)
- No C++-esque
- Runtime Saftey
- Array access' are all bounds checked.
- Easy C interop
- Effortless FFI interop with C, via the
cdef
keyword. - Include C headers with the
cinclude
keyword
- Effortless FFI interop with C, via the
- Information-Rich Error-Reporting
- Clean, precise error messages during compile time
- Runtime errors, such as assertion failures 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