Reading files at compile time
Problem
Sometimes we need to read some info from files at compile time
Solution
To add file reading possibility where we get plain text and can handle it with something like json parser. It would be useful for something like localisation or something similar like config which I can update though the internet and then load it compiletime.
And I have a couple of questions as well, I doubt that we can use HTTP request at run time, but what about reading files? I heard that its possible, we saw that save / load systems but it was said that local files don't work anymore
The general problem of this is exposing unsafe things to wurst code files. It shouldn't really be possible to read any files and send them across the net imho.
But it could definitely be a useful addition in many cases, as you said, e.g. translation.
And I have a couple of questions as well, I doubt that we can use HTTP request at run time, but what about reading files? I heard that its possible, we saw that save / load systems but it was said that local files don't work anymore
Yes it was semi broken by patches, the new PR will address this though and it should work again.
Maybe we can do 2 things:
- Add some kind of foreign function interface, which allows to call any Java function.
- Add a permission file, where every call to Java must be explicitly allowed.
I agree with Frotty that we want to keep the code sandboxed by default.