JSAbrahams / mamba

🐍 The Mamba programming language, because we care about safety
MIT License
88 stars 4 forks source link

Whitelisting the standard library #200

Closed JSAbrahams closed 1 year ago

JSAbrahams commented 4 years ago

Issue, or potential issue

We are currently working towards building a proper import/class loader system where we can check that classes are indeed imported. As we can't ensure the safety of Python imports, we should add an unsafe operator (likely !) to mark code as unsafe. However, as Python has a rather large sdtlib, this can become very tiresome as even very simple applications will have a lot of syntax noise.

Potential solutions

We can whitelist the stdlib of Python. A even better solution would be to list all possible exceptions which might be thrown by any module in the stlib.