In today’s DrJava/Habanero meeting, Vincent, Jarred and I presented a demo of DrJava/HJ to Jack Dennis of MIT. Generally, we were quite pleased how we could just re-build Habanero Java and DrJava, and get a working version with the newest features from both packages.
We also noticed a few problems, of course. Perhaps most critically, when using the HJ compiler from within DrJava, the compiler uses the wrong directories when it generates class files for classes not in the default package.
I fixed part of that bug. The compiler adapter was ignoring the destination directory passed to the HJ compiler adapter. Now, if you create a project and set a build directory, the class files will end up in the right place. I have committed this fix into the DrJava trunk and also into the drjava-hj branch.
I didn’t fix the problem (a) if there is no build directory set, or (b) if we are not in project mode. This is something that I think should be fixed in the HJ compiler, because it doesn’t behave the same way javac behaves: If you invoke javac and don’t give it a destination directory, it will generate the class files in the same directory where the source files are. The HJ compiler generates the class files in the current directory.
javac src/HelloWorld.java generates the class file src/HelloWorld.class.
hjc src/HelloWorld.hj generates the class files HelloWorld.class, HelloWorld$0.class, and HelloWorld$Main.class. in the current directory, not in src.
I hope the HJ team will agree this is a change that should be made in the HJ compiler.
Furthermore, we noticed again that compiler error messages aren’t displayed in DrJava’s Compiler Output pane. We also noted that we cannot call methods directly from the Interactions pane: We have to use the
run commands, otherwise the class loader isn’t properly set up. We should at least come up with a better error message than throwing an exception:
> new FibFuture().fib(10)
Interestingly, we can call Mint methods from the Interactions pane, we just cannot use the new syntax elements in Mint, brackets and escape.
> import edu.rice.cs.mint.runtime.*
> Code<Integer> c = DrJavaInteractions.makeCodeInt(5)
<| ((5)) |>
> Code<Integer> cTo10 = DrJavaInteractions.spower(c, 10)
<| (((5)) * (((5)) * (((5)) * (((5)) * (((5)) * (((5)) * (((5)) * (((5)) * (((5)) * (((5)) * (1))))))))))) |>