bfj didn't use any of Windows specific functionality, I tested it on both Windows and Linux system. It just does in memory translation to JVM bytecode and execute it directly.
It seems that you have encountered some classpath issues. You got NoClassDefFoundError while loading bf.util.BrainfuckParser. 1. Check if all java file are properly compiled and class files are properly placed in package structure. 2. I suggest you to use -cp to specify your classpath. I use following command to execute: java -cp ../lib/asm-3.1.jar:. bf.runner.ParseCompileRunner ../bf/mandelbrot.b in Linux java -cp ../lib/asm-3.1.jar;. bf.runner.ParseCompileRunner ../bf/mandelbrot.b in Windows About the bloated LOC... The ParseCompileRunner implementation is mixed with the interpreter code. I did implement some translation only BF2BytecodeRunner which is about 200 LOC, but they are not yet apply some basic optimizations. I'll update them so that you can have a fare compare of the LOC in different languages. :) 2009/1/11 Jon Harrop <[email protected]> > > On Sunday 11 January 2009 11:07:25 Liwei wrote: > > I'm willing to know the result. :) > > I cannot even get it to run: > > $ export > > CLASSPATH="/home/jdh30/src/bfj-read-only/bfj/lib/asm-3.1.jar:/home/jdh30/src/bfj-read-only/bfj/src/" > $ java bf.runner.ParseCompileRunner > Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0 > at bf.runner.ParseCompileRunner.main(ParseCompileRunner.java:16) > > Sounds like it is failing because it assumed argvs would contain a BF > program > to run, i.e. the compiler is actually running. But: > > $ java bf.runner.ParseCompileRunner ../bf/mandelbrot.b > compile and run: ../bf/mandelbrot.b > Exception in thread "main" java.lang.NoClassDefFoundError: > bf/util/BrainfuckParser > at bf.runner.ParseCompileRunner.main(ParseCompileRunner.java:20) > Caused by: java.lang.ClassNotFoundException: bf.util.BrainfuckParser > at java.net.URLClassLoader$1.run(URLClassLoader.java:200) > at java.security.AccessController.doPrivileged(Native Method) > at java.net.URLClassLoader.findClass(URLClassLoader.java:188) > at java.lang.ClassLoader.loadClass(ClassLoader.java:306) > at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276) > at java.lang.ClassLoader.loadClass(ClassLoader.java:251) > at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) > ... 1 more > > Sounds like the generated code doesn't run. Does it use Windows specific > invocations internally? > > I figured out why there is so much Java code in there: the bfj distro > contains > some precompiled BF programs as Java source. Removing those, it is only > 1,588 > LOC. Still 11x longer than the OCaml/LLVM though... > > -- > Dr Jon Harrop, Flying Frog Consultancy Ltd. > http://www.ffconsultancy.com/?e > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "JVM Languages" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/jvm-languages?hl=en -~----------~----~----~----~------~----~------~--~---
