0

I am running Rascal from the REPL and it seems like it takes a pretty long time to import some modules. For example import lang::java::\syntax::Java15; takes seconds to run.

I've also noticed cases where modules that depend on other modules don't appear to be reloaded if they are changed. For example:

program 1:

module A::A
....

program 2:

module B::B
import A::A;
...

REPL:

import A::A;
import B::B;

Now I've made some changes to A and B and I import B again. I would imagine the changes to A would get propagated to the new version of B (since it is importing A) but this doesn't seem to happen.

  1. Why is importing this slow and is there a way to speed this up?
  2. How does importing packages with dependencies in the REPL work?

Thanks!

josh
  • 1,544
  • 2
  • 16
  • 27

1 Answers1

1

We recently changed quite a bit about this part of the implementation. So could you tell us which version you are using?

Importing is slow right now because we have a bottleneck in the parsing infrastructure, as far as I can remember. Speeding it up; you can do by not using a console in Debug mode (i.e. use Run As...), using more memory for Eclipse also helps (I use 1.8Gb heap and an 80mb stack).

The REPL works in Eclipse by monitoring which modules have changed since running the previous command on the REPL. When a new command is entered, such as an import command, first all modules which have changed and the modules they depend on are purged, this produces an initial worklist for reloading, which is then executed in a fixpoint fashion to load the new modules (each module only once), then finally the command is executed.

Jurgen Vinju
  • 6,393
  • 1
  • 15
  • 26
  • I'm not actually running the REPL through Eclipse but from the command line via the `rascal-0.7.0.jar` file. I remember, as a result of one of our previous threads, I tried switching to a newer version but this broke a number of things. As for the second point I don't see the modified modules being reloaded. – josh Aug 14 '15 at 18:33
  • 1
    hi Josh. The REPL on the commandline does not have an automatic reload feature yet. Every module you edit you'd have to import manually again. It's a big missing feature. About the new version breaking a number of things, please drop an email or a github issue and we can try helping you out. Sounds interesting. – Jurgen Vinju Aug 16 '15 at 07:55
  • Right, that makes sense with what I've been seeing. I can't exactly remember which of my posts led to that but if I get some time I'll try to break things again :-P. If memory serves me it was a post about generating java AST's. – josh Aug 16 '15 at 13:52