Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2013-08

Compiling to Java

8 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Michael Schnell

Right now, the reach of fpc (and Lazarus) "Write once compile everywhere" ) is being extended to Android (e.g. by having fpc compile to Dalvik).

AFAIK, compiling to Android Dalvik already woks rather well. IIRC, here, first fpc compiles to Java byte code and then this is converted to Dalvik Word code.

So it should be possible to create "normal" Java applications, as well.

Can this be used to do (arch independent) Desktop applications ?

Can this be used to do (arch independent) "server site Java" Web applications ?

Can the Lazarus GUI designer be used to do the GUI of such (Desktop) applications ?

Of course the Lazarus GUI designer can't easily be used to do the GUI of Web applications (Java or native). But there is or has been stuff like "EXTPascal" and "Comet" that might (or might not) be viable to take a look at to allow for extending the reach of "Write once compile everywhere" to web applications.

Thanks,
-Michael (sorry if I still don't understand enough of the Java world to and might be asking silly questions..)

Sven Barth
to Michael Schnell
Michael Schnell wrote 7 lines
Right now, the reach of fpc (and Lazarus) "Write once compile everywhere" ) is being extended to Android (e.g. by having fpc compile to Dalvik). AFAIK, compiling to Android Dalvik already woks rather well. IIRC, here, first fpc compiles to Java byte code and then this is converted to Dalvik Word code.

Yes, as this is the approach that normal Android development follows as well (first compile as Java Bytecode and then convert to Dalvik Bytecode)

Show quoted text 6 lines
So it should be possible to create "normal" Java applications, as well. Can this be used to do (arch independent) Desktop applications ? Can this be used to do (arch independent) "server site Java" Web applications ?

Both are yes as long as you convert any necessary class files to Pascal headers, so that they can be imported correctly.

Can the Lazarus GUI designer be used to do the GUI of such (Desktop) applications ?

No.

For more information please take a look here:
http://wiki.freepascal.org/FPC_JVM

Regards,
Sven

Michael Schnell
to Sven Barth
Sven Barth wrote
> Can the Lazarus GUI designer be used to do the GUI of such (Desktop) > applications ? No.

In a perfect world, "Write once compile everywhere" would suggest this (and "Web Applications") as a viable goal. But it might be difficult or completely impossible to reach.

Of course this should be discussed in the "Lazarus dev" list (if at all) .

Thanks for your answers !

-Michael

Michael Schnell
to Sven Barth: Yes, as this is the approach that normal Android development follows as well (first…
Sven Barth wrote
For more information please take a look here: http://wiki.freepascal.org/FPC_JVM

here I see:
"It is undoubtedly possible to set up Eclipse so that it will debug FPC-generated Java class files. Anyone who figures out the details, feel free to describe them here."

Thus using Lazarus as a debugger for such applications is not viable / planned ?

-Michael

Sven Barth
to Michael Schnell
Michael Schnell wrote 11 lines
On 08/12/2013 10:15 AM, Sven Barth wrote: > For more information please take a look here: > http://wiki.freepascal.org/FPC_JVM here I see: "It is undoubtedly possible to set up Eclipse so that it will debug FPC-generated Java class files. Anyone who figures out the details, feel free to describe them here." Thus using Lazarus as a debugger for such applications is not viable / planned ?

I don't know whether GDB is capable of debugging Java applications. If not then there'd need to be a standalone debugger (JDB?) for which an interface needs to be written. So it *might* be viable, but I'd not say that it is planned for now.

Regards,
Sven

Sven Barth
to Michael Schnell: In a perfect world, "Write once compile everywhere" would suggest this (and "Web…
Michael Schnell wrote 8 lines
On 08/12/2013 10:15 AM, Sven Barth wrote: >> Can the Lazarus GUI designer be used to do the GUI of such (Desktop) >> applications ? > No. In a perfect world, "Write once compile everywhere" would suggest this (and "Web Applications") as a viable goal. But it might be difficult or completely impossible to reach.

I might be possible using a non-LCL designer which then creates fitting code, but - as everything - someone needs to implement this.

Of course this should be discussed in the "Lazarus dev" list (if at all) .

Yes.

Regards,
Sven

Sven Barth
to Michael Schnell
Michael Schnell wrote
On 08/12/2013 11:46 AM, Sven Barth wrote: > I don't know whether GDB is capable of debugging Java applications. see http://gcc.gnu.org/java/gdb.html

Hmm... it seems that GDB still requires fitting debug information and can not simply debug Java applications like JDB can... so maybe writing a new interface for JDB would be better.

> So it *might* be viable, but I'd not say that it is planned for now. Again to be discussed the other list.

Agreed.

Regards,
Sven