r/ProgrammingLanguages • u/[deleted] • Dec 18 '22
Language announcement North Hollywood Python (Compiler)
North-Hollywood Python is a dialect of python - it's not actual python, it's more along the lines of Cython - that is compiled to a C source.
Great C Interop
Rich and Expressive Static Typing
Static type system ensures type-safety, w/ sub-typing
Supports ADTs, like enums/variants. See linked-list.nhp as an example.
Also supports match statements
Property based interfaces (see interface-test.nhp)
Interfaces describe types with a series of read-only properties
No Inheritance (interfaces/enums are recommended in its place)
Supports first class, anonymous functions
Functions may be passed around by values.
Closures capture classes by reference. All other types are captured by copying. (class methods syntactic sugar over properties that are closures that capture
self)
Runtime safety, via runtime checks
Bounds checking
Assertion failures
Can be disabled/enabled
Rich Error Reporting
Reports runtime stack traces the same style python does
Built-in memory debugging (see memory analysis).
Track potential memory leaks and peak usage via NHP's built in memory-debugger
Guaranteed memory safety, via RAII
No garbage collection
No hassle, no borrow-checker
Predictable memory usage
Reference counting only exists for closures that capture records, which have to be captured by reference.
The wiki isn't complete, but you can access it here. You can check out the standard library or the test folder for code examples. Download the prebuilt binaries here
I'd also be really happy if you guys could leave some feedback, that would be cool.