[JVM-B] Re: Thanks for your classwriter modules, and small bug? in getfield/putfield
Status: Beta
Brought to you by:
ashley-y
From: Ashley Y. <as...@se...> - 2002-10-12 03:59:01
|
At 2002-10-11 08:13, Arthur Baars wrote: >Hi Ashley, > >I found your JVM-bridge software after reading the "Java representation in >Haskell" thread on the haskell mailing list. I used your java class file >writer(JCF*.hs) as a back-end for a simple "Featherweight Java" compiler. >It really like the library, it was easy to use to assemble class files. > >Unfortunately the class file writer modules did not work using Hugs. The >main reason is that most of them import "BasicLayer", which in itself >imports other non-hugs compatible modules. Fortunately none of the JCF >modules really needs the BasicLayer(some of them require Bytes.hs, but >that's all). After changing the imports I only had a problem with the Word64 >type which is not fully implemented in Hugs. Removing all the code that >referred to the Word64 type, and adapting the "JFCWritable" instance for >"Int64" was sufficient to get all your class writer code running in Hugs. I haven't even tried to use it with Hugs... >I added some code as well to the instruction module, because I needed the >new, checkcast and dup instructions. OK, I've put these in (in CVS). >Are you planning to add all jvm instructions to JCFCodeInstruction in the >future? Originally I added just enough to write callback classes. I can't add branch instructions without rewriting the stack depth calculation code, etc. >Maybe it is a good idea to distribute the class file writer as a >separate library as well. This is an excellent idea. I'd like to do a new release shortly, and after that I want to organise the modules hierarchically. All the stuff that doesn't use FFI (the 'Basic', 'Java' and 'JCF' layers) except maybe JCFCallback* should be in a separate project that can be made to work with Hugs. >I think I discovered a small bug in your code in the getfield and putfield >instructions. Thanks, I've put this fix in. -- Ashley Yakeley, Seattle WA |