[Lazarus] Can this be leveraged for Lazarus/FPC to target Java platforms? "... compile programs to MIPS binaries, and these are then translated into Java bytecode."
DrDiettrich1 at aol.com
Tue Jun 21 10:17:47 CEST 2011
Michael Joyner schrieb:
> I noticed on a freshmeat.net <http://freshmeat.net> announcement that
> there is a program called Cibyl that converters MIPS binaries into Java
A closer look at Cibyl <http://code.google.com/p/cibyl/wiki/Cibyl> is
not very encouraging, WRT FPC/Lazarus compatibility :-(
Since only C code can be converted, what IMO is a reasonable restriction
(as I made for ToPas), this would mean that only subroutines can be
converted, not classes and methods. This will apply to all such converters.
The sample code in above article suggest that a dedicated GUI interface
#include <javax/microedition/lcdui.h> has to be used, and most probably
also a Java related RTL.
This means that a convertable FPC/Lazarus application can *not* use the
classes and components in FCL or LCL, it must not use classes at all :-(
> I wonder if using the fpc cross-compiler to mips-32 would allow
> FPC/Lazarus to leverage the converter in Cibyl to accomplish the same
> thing, but for FPC instead of C/C++.
This may work, but only for non-OO code. Since the LCL is based on
classes, no Cibyl/Java widgetset can be created and used in convertable
It would be easier to add a Java target to FPC itself, and to make it
use Java libraries instead of .dll or .so libraries. The language also
would deserve modifications, because the built-in strings and other
types must be replaced by the native Java types (using UTF-8). An
application consequently would look more like Java code, with Pascal
syntax only in statements.
 Where "easier" still means that this would be such a big task, that
nobody honestly would ever implement a Java or .NET target for FPC.
More information about the Lazarus