#1333 precompiling fcode to runtime bytecode

ashishwave Sat 27 Nov 2010

is it possible to first hand precompile fcode (the fantom bytecode)(that is, the .pod) to JVM/.NET bytecode(that is, .exe,.jar etc

and then later run that .exe and .jar directly on JVM/.NET(not the .pod)

DanielFath Sat 27 Nov 2010

I think you need to use JStub in %FAN_HOME%/bin to do this. Here is usage example:

java -classpath lib/java/sys.jar fanx.tools.Jstub -d outDir podName

Also JarDist will turn your projects into a jar file but it's considerably lower than jstub (because it zips files as well).

brian Sun 28 Nov 2010

JarDist is probably the closest thing we have.

Remember that Fantom includes a lot of extra features that cannot be access from just simple bytecode:

  • Fantom reflection requires fcode (since the type system includes nullable types, etc)
  • Pod reflection
  • indexed props
  • units, timezones, mime types, etc require their associated "database" files

Login or Signup to reply.