I'm looking for a scripting language that would be:
- a scripting language that is embeddable in Java
- actually I mean something that will not be executed as a native code, but interpreted
- secure (users would upload their scripts which would then execute on the server)
- no access to anything outside some 'sandbox', no access to threads, I/O, etc.
- Just flow control + algorithms/data structures (maybe some predefined "classes", like collections) + interaction with explicitly provided API
- it would be possible to limit execution time per script (n seconds or n instructions)
- it is possible if the language is interpreted. For example: replace each instruction with "check if I should execute the next instruction and execute it or quit"
- have simple and readable syntax
The ultimate goal is to be able to run untrusted code which should only be able to use provided API, without breaking anything (like entering infinite loops / consuming too much resources / accessing anything except provided API)
Is there some existing language that I could use?