Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve handling of java files in repl #960

Open
3 tasks
jneira opened this issue Apr 16, 2019 · 1 comment
Open
3 tasks

Improve handling of java files in repl #960

jneira opened this issue Apr 16, 2019 · 1 comment

Comments

@jneira
Copy link
Collaborator

jneira commented Apr 16, 2019

Follow up of #805 (fixed with #905)

Although the repl is able to load java object files the handling could be improved:

  • Allow reload of .java, .class and .jar files
    • Actually .java and .class are compiled in a auto generated __extra.jar
    • The jar files are being locked by eta (it should be unlocked after create and use it) and cant be changed
    • But likely the eta-serv classloader will not see the updated jars
    • The solution could be load directly the classes contained in those jars to use class reloading of eta-serv
      • Although it could be expensive for big jars
  • Load the classes of java files informed in params (i.e. the files listed in cabal java-sources) when initialize the dynamic linker: https://github.com/typelead/eta/blob/master/compiler/Eta/REPL/Linker.hs#L150-L172
    • It already loads the package jars
    • Avoid loading them in the first load but dont remove the feature of :load path/to/my.jar on the fly
  • In general, as rahulmut suggested in Error runing etlas repl in a project with java source files #805, try to not load java files that have not changed since last load.
@jneira
Copy link
Collaborator Author

jneira commented Apr 17, 2019

The solution could be load directly the classes contained in those jars to use class reloading of eta-serv

i guess we should read the classes from jar and use from Eta.REPL

loadClasses :: HscEnv -> [(String, String, ByteString)] -> IO ()

It needs the class name, the class info and the actual contents.

@rahulmutt i see that Eta.Utils.JARhas methods to read entries, but is there some existing way to read classes from? Getting [(String, String, ByteString)]or ClassFile

@jneira jneira pinned this issue Apr 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant