[fpc-pascal].NET opinions?

Carl Eric Codere carl.codere at optimasc.com
Sat Aug 24 13:55:05 CEST 2002

>Hi All,
>Perhaps it might be worth looking at the GPLed Java compiler called
>"Jasmin"; It provides some sort of JVM Assembly language format,
>which could probably become one of the FPC's output formats,
>pretty much like it already does using the GAS. You could just treat
>it like any other cpu.

>In my opinion targeting Java instead of .NET would mean far greater
>portability, since already there are JVMs for many systems. Besides that
>would be very fun to write Java Applets in Free Pascal ;-)
>And eventually you could support .NET when it becomes widely available.

          Ok i want to clear the java bytecode format polemic once and for
all : we thought about doing an output of java bytecode, and i even read
a thesis on implementing a pascal compiler with output of java bytecode...

The conclusion is : It is impossible to keep all the features of Pascal
with java bytecode, we would have to limit ourselves significantly :

- java bytecode does not support indirect calls, therefore all procedural
variables would be impossible -: we'd have to redesign the system unit because
of that.
- java bytecode does not support pointers, so anything related to pointers
would have to be removed, it supports references to objects only.
- var parameters would be very difficult to implement, as java bytecode
passes parameters by value, you would have to create a horrible hack to
use var parameters.

The CLI / CLR of Microsoft (.net) supports two modes of virtual machine,
one is managed mode, where untyped pointers are not allowed, and because
of that it would limit the pascal syntax, but there is also another mode
(non-secured) which permits using unmanaged pointers, this does not exist
at all in java byte code ... 

So either we support .net, our own virtual machine (that i am currently
designing and implementing), or we keep FPC as it is now.


More information about the fpc-pascal mailing list