3 ms·
You know, I wonder if Python allows you to check code shape and if valid, eval them (yes this could be dangerous) I wonder if Clojure can do it... I think the
by inawarminister 3y ago
You know, I wonder if Python allows you to check code shape and if valid, eval them (yes this could be dangerous)
I wonder if Clojure can do it... I think the spec can check if function-calls and data given have valid types and reasonable unit/quantity each... Hmm.
- narush 3y agoI guess you could build an AST from the Python code and eval if it's successful. No gaurentee the code will run, of course (you could always get an error). In general, it feels it's halting problem hard to determine if any general purpose programming language program is executable or safe... but maybe if we reduce the size of the spec under consideration?