Okay, I’ve got to the point where I want to implement a scripting language. I want a very powerful scripting language, but it obviously has to be fast, so I thought to myself: “What’s wrong with Java?”. I mean, I can compile the scripts at runtime to bytecode, load it and run it at the same speed as normal code. It should beat any scripting language implementation when it comes to performance, plus be easier to implement.
I realize that I will need some good security for this. I need to disallow networking, reflection, file access, e.t.c, or people could create viruses in my game scripts! :o I’m also thinking of restricting class access to a white list. I’ve heard that these 2 things can be implemented with a SecurityManager and a custom ClassLoader, respectively.
Now, I have no experience what so ever with SecurityManagers and ClassLoaders and such stuff, so I don’t really know how to use them. I’ve managed to compile some test Java code with JavaCompiler, but I don’t really understand how to load the class after that. I’ve tried Google, but I couldn’t find anything like this…