Hi,

I'm trying to get the JVM version of Rakudo running on top of Google App
Engine [1]. Because of security reasons Google restricts in several ways
the Java code which can be run on GAE. This impacts Rakudo in two ways:

- They don't allow threads to be spawn. Rakudo starts a thread indirectly
in GlobalContext when instantiating a Timer. I hacked around this by
commenting out the instantiation of the timer for now, but perhaps in the
future we could optionally pass in a ScheduledExecutorService [2] to
GlobalContext instead having it instantiate its own (and on GAE we could
pass in null or an implementation of the interface which throws an error
when called - or perhaps it uses some other feature of GAE to simulate the
timer like the task queues)

- The second (and bigger) problem which I didn't manage to work around is
the module loading: the current module loader walks the class path and
expects to find the different jars in one of the directories in the
classpath. This is problematic when running under GAE for two reasons:

  - it restricts access to the filesystem (ie. checking if
".\CORE.Settings.jar" exists throws an exception). You also can't create a
temporary directory during runtime and unpack the files there. And even if
you could, you are not allowed to change the system properties (thus you
couldn't add the temporary directory to the classpath)
  - there isn't really a way upload "static" files to GAE and making them
available to the runtime

I can think of a couple of ways to solve this and would like to seek your
advice on which is easier / more feasible / more likely to be accepted (if
submitted as a patch / PR):

  - "pre-register" the modules somehow from the outside (for example I can
create a jar with all the module files and upload it with my application -
I can even manipulate, get access to its contents via something like
getResourceAsStream [3], it's just that the current module loader expects a
file not a stream)
  - modify the loader so that it can also look inside of jar (zip) files on
the classpath. Java already has classes to deal with zip/jar files easily,
perhaps that can be reused?

Regards,
Attila

PS. Java 8 also warns that "_" might not be a valid method name in the
future, but it works fine for now.

[1] http://en.wikipedia.org/wiki/Google_App_Engine
[2]
https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ScheduledExecutorService.html
[3]
https://docs.oracle.com/javase/7/docs/api/java/lang/Class.html#getResourceAsStream%28java.lang.String%29

Reply via email to