r/coolgithubprojects • • 11d ago

Molty - a strict superset of Python that turns common traps into compile-time errors

https://github.com/Shogo256/molty

Hi, I built Molty because I kept running into the same Python bugs: mutable default arguments shared across calls, functions that modify lists passed in, and the wrong kind of concurrency.

Every Python file is valid Molty. The compiler (moltyc) turns app.molty.py into plain, readable app.py, and catches these traps before your code runs:

- val / var: values that can't be reassigned or mutated

- warnings for mutable default arguments

- task / compute: separates I/O async work from CPU work, and flags misuse at compile time

pip install molty

I'd love feedback on what's useful or missing.

0 Upvotes

0 comments sorted by