[fpc-devel] New FPC target: JVM

Jonas Maebe jonas.maebe at elis.ugent.be
Sat Aug 20 10:49:24 CEST 2011


Hi,

There is a new branch in svn (branches/jvmbackend) that contains support for compiling Pascal code into Java virtual machine bytecode. While it does not support all language constructs and while there are some differences in some features that are supported, in general the result is fairly close to "normal Pascal" you'd write.

Note however that this is a pure compiler port at this time. That means that while most of the language support is fairly complete, pretty much no standard Pascal units are available. For all practical intents and purposes there is only the system unit, and even that one misses many routines (including helpers required for basic functions such as read(ln)/write(ln), val, str, delete, pos, ...).

On the other hand, a unit that contains the entire public interface of the JDK 1.5 is available. Over time, it should be possible to provide most of the standard functionality of the system unit (and other units) implemented on top of that unit, or rewritten in Pascal code that does not depend on untyped pointer accesses.

Download information, usage information etc is available at http://wiki.freepascal.org/FPC_JVM

Regarding Android: the compiler and the system unit both use a bunch of standard functionality from the JDK to implement various features. So Android support would probably require quite a bit of extra work. I have not looked into that.

Enjoy!


Jonas

PS: no, this does not mean that FPC development from now on will only, or even primarily, focus on managed language support. And the infrastructure added for JVM support will make an LLVM port a lot more feasible in the future, because there is now a code generator layer that uses high level type information.


More information about the fpc-devel mailing list