| ▲ | ranger_danger a day ago | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
I think they're using a slightly different definition of "safe" than you are | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | EGreg a day ago | parent [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
It’s not the job of a language to solve everything. Sometimes the solution belongs in sandboxing and virtual machines. You should be isolating untrusted code anyway. SafeScript was just inspired by Google’s CaJa project from 10 years ago. My Qbix Webserver started rewriting PHP before loading it, and I wondered what if I could start over and just reduce the language the way JSON reduced it to just data, and was wildly successful. I chose JS as the base because it’s everywhere. I then made it also execute inside PHP. I made it auto-await every promise so it could work in non-evented environments like vanilla PHP. This could be the next Lua, for instance, but for the modern era and far safer. Having said that… there may be some static analysis you could do, to conservatively overestimate how much memory any given program could waste, and reject those that COULD waste it. The nice thing about static analysis is you only have to run it once per particular script. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||