FPC and JAVA

classic Classic list List threaded Threaded
30 messages Options
12
Reply | Threaded
Open this post in threaded view
|

FPC and JAVA

pianoman-3
Hello, I would like to ask whether is it possible to write program as usual then compile it but result wouldn't be a standard binary but a .jar file usable on mobile devices which can run java programs.
Because for me as a FPC/delphi coder it would be great if I could code program and output could be .jar file which I could run on my mobile.
Thanx in advance for Any advice
Pianoman

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: FPC and JAVA

Florian Klämpfl
Pianoman schrieb:
> Hello, I would like to ask whether is it possible to write program as
> usual then compile it but result wouldn't be a standard binary but a
> .jar file usable on mobile devices which can run java programs.

No.

> Because for me as a FPC/delphi coder it would be great if I could code

Java byte code is too limited to use it in an object pascal
implementation as you know it from FPC/Delphi.

> program and output could be .jar file which I could run on my mobile.

Get a linux or windows ce based one :)

> Thanx in advance for Any advice
> Pianoman
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> fpc-pascal maillist  -  [hidden email]
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: FPC and JAVA

Marco van de Voort
> > usual then compile it but result wouldn't be a standard binary but a
> > .jar file usable on mobile devices which can run java programs.
>
> No.

You can find some more reasoning in the .NET/JVM faq item :

http://www.freepascal.org/faq.html#dotnet
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: FPC and JAVA

Krishna-33
In reply to this post by pianoman-3
Hello!,

On 10/23/07, Pianoman <[hidden email]> wrote:
>
>
> Hello, I would like to ask whether is it possible to write program as usual
> then compile it but result wouldn't be a standard binary but a .jar file
> usable on mobile devices which can run java programs.
> Because for me as a FPC/delphi coder it would be great if I could code
> program and output could be .jar file which I could run on my mobile.

Native code is what you need on these (usually) memory constrained
devices to get the full bang for the buck. If you check the wiki, you
can find that the symbian os port is a work-in-progress.

If java bytecodes are an absolute necessity then maybe you can check
Midlet Pascal (mentioned in the lazarus forum).

btw, is it true j2me is being scrapped in favour of the "full" j2se?

Cheers,
-Krishna
--
One reason that life is complex is that it has a real part and an imaginary part
  -Andrew Koenig
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: FPC and JAVA

Leonardo M. Ramé
BTW, can anybody point us to emulators of these devices (I know Embedded Visual C++ has an ARM
WinCE emulator)?

Leonardo.

--- Krishna <[hidden email]> wrote:

> Hello!,
>
> On 10/23/07, Pianoman <[hidden email]> wrote:
> >
> >
> > Hello, I would like to ask whether is it possible to write program as usual
> > then compile it but result wouldn't be a standard binary but a .jar file
> > usable on mobile devices which can run java programs.
> > Because for me as a FPC/delphi coder it would be great if I could code
> > program and output could be .jar file which I could run on my mobile.
>
> Native code is what you need on these (usually) memory constrained
> devices to get the full bang for the buck. If you check the wiki, you
> can find that the symbian os port is a work-in-progress.
>
> If java bytecodes are an absolute necessity then maybe you can check
> Midlet Pascal (mentioned in the lazarus forum).
>
> btw, is it true j2me is being scrapped in favour of the "full" j2se?
>
> Cheers,
> -Krishna
> --
> One reason that life is complex is that it has a real part and an imaginary part
>   -Andrew Koenig
> _______________________________________________
> fpc-pascal maillist  -  [hidden email]
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: FPC and JAVA

Krishna-33
On 10/24/07, Leonardo M. Ramé <[hidden email]> wrote:
> BTW, can anybody point us to emulators of these devices (I know Embedded Visual C++ has an ARM
> WinCE emulator)?
>

Recently I installed Nokia Carbide.c++ and the Symbian SDK for my N72
phone. One of these packages comes with a virtual phone (donno which
one though). But these are huge downloads wonder what is inside.

<rant> the C++ "Hello,World!" code that the wizard spit made me think
Symbian OS is a pig. I sincerely hope that there is a better way to
program these devices.  </rant>

Cheers,
-Krishna
--
One reason that life is complex is that it has a real part and an imaginary part
  -Andrew Koenig

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: FPC and JAVA

Felipe Monteiro de Carvalho
On 10/24/07, Krishna <[hidden email]> wrote:
> <rant> the C++ "Hello,World!" code that the wizard spit made me think
> Symbian OS is a pig. I sincerely hope that there is a better way to
> program these devices.  </rant>

I am working on the Free Pascal port, but because of the horrible way
the symbian SDK was created, their extremely slow support and the fact
that their API is fully C++, its going slowly.

--
Felipe Monteiro de Carvalho
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: FPC and JAVA

Krishna-33
On 10/26/07, Felipe Monteiro de Carvalho
<[hidden email]> wrote:
> On 10/24/07, Krishna <[hidden email]> wrote:
> > <rant> the C++ "Hello,World!" code that the wizard spit made me think
> > Symbian OS is a pig. I sincerely hope that there is a better way to
> > program these devices.  </rant>
>
> I am working on the Free Pascal port, but because of the horrible way
> the symbian SDK was created, their extremely slow support and the fact
> that their API is fully C++, its going slowly.
>

Yeah, I saw the wiki page. Does it work on S60 2nd/3rd edition phones too?

How do you map the C++ API? by hand? Is it possible to tailor the
"Direct class wrapper"
(http://milan.marusinec.sk/articles-icu4pas/icu4pas-dcw.html) approach
to ARM?

Cheers,
-Krishna
--
One reason that life is complex is that it has a real part and an imaginary part
  -Andrew Koenig
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: FPC and JAVA

Felipe Monteiro de Carvalho
On 10/26/07, Krishna <[hidden email]> wrote:
> Yeah, I saw the wiki page. Does it work on S60 2nd/3rd edition phones too?

No. But they are similar, so if uiq works, the s60 support can be
build reusing a lot of what was developed for uiq. The base operating
system is the same, so I guess the RTL would need few or no changes,
but this is just a guess.

The GUI toolkit is completely different so that would need new bindings.

The mksymbian build tool will need to be adapted to the specifics of the s60 sdk

> How do you map the C++ API? by hand? Is it possible to tailor the
> "Direct class wrapper"
> (http://milan.marusinec.sk/articles-icu4pas/icu4pas-dcw.html) approach
> to ARM?

They seam to rely on assembler there, so I guess no.

And yes, I am currently mapping it by hand.

--
Felipe Monteiro de Carvalho
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: FPC and JAVA

Felipe Monteiro de Carvalho
On 10/26/07, Felipe Monteiro de Carvalho
<[hidden email]> wrote:
> On 10/26/07, Krishna <[hidden email]> wrote:
> > How do you map the C++ API? by hand? Is it possible to tailor the
> > "Direct class wrapper"
> > (http://milan.marusinec.sk/articles-icu4pas/icu4pas-dcw.html) approach
> > to ARM?

Actually they seam to also be relying on the calling convention and on
specific compiler information, which wouldnt work for symbian because
they use several different compilers and also they dont guarantee
binary compatibility between different sdk and os versions.

--
Felipe Monteiro de Carvalho
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: FPC and JAVA

Krishna-33
On 10/26/07, Felipe Monteiro de Carvalho
<[hidden email]> wrote:

> On 10/26/07, Felipe Monteiro de Carvalho
> <[hidden email]> wrote:
> > On 10/26/07, Krishna <[hidden email]> wrote:
> > > How do you map the C++ API? by hand? Is it possible to tailor the
> > > "Direct class wrapper"
> > > (http://milan.marusinec.sk/articles-icu4pas/icu4pas-dcw.html) approach
> > > to ARM?
>
> Actually they seam to also be relying on the calling convention and on
> specific compiler information, which wouldnt work for symbian because
> they use several different compilers and also they dont guarantee
> binary compatibility between different sdk and os versions.

In the SDK that I installed with Carbide I remember seeing binutils
and friends. So I suppose that a GCC cross compiler is being used for
building the code which means g++ is a supported compiler. Now,
assuming that the symbian os itself is built using another compiler
and the fact that g++ is binary compatible with the abi means that a
bridge to g++ should be compatible with the binaries of other
compilers. No?

Don't compilers conform to the standard c++ abi for the ARM?
(http://www.arm.com/pdfs/cppabi.pdf)

Another thing, the code produced for the winemulator target is x86
code or arm code?

Cheers,
-Krishna
p.s: I'm completely new to this so pardon my ignorance.
--
One reason that life is complex is that it has a real part and an imaginary part
  -Andrew Koenig
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: FPC and JAVA

Matt Emson
Krishna wrote:
> Another thing, the code produced for the winemulator target is x86
> code or arm code?
Depends. The Visual Studio 2003 emulator is x86. Based on the VirtualPC
core product. The Visual Studio 2005.. um.. I don't remember. I know
Microsoft provide an ARM emulator that runs dog slow. I had the emulator
and WM6 images about 5 months ago in my last job. Testing against the
x86 emulator is only good for quick tests. Nothing beats debugging on a
real device. If you pony up the cash, you can do that with VS2003 or VS2005.

Let me just point out.. and this isn't a troll, it's my own experience:
The end user does not care what your application is written in. Just so
long as it works. As such, I would recommend Compact Framework and
managed code for any Windows Mobile device. The memory footprint is
minimal - all WM5 devices I have used (and we used quite a few brands)
have the Compact Framework in ROM. Speed wise, it's fast. It doesn't
crawl at all. Given the significant bugs Microsoft had in their native
code  SQL Server CE 2.0 - as an example of native code on mobile
devices,  C# and  CF.NET  make life far, far, far simpler. I found it
cut development time down by between 50% and 70%. I can't even look at
old code written using  C anymore. Shudder.

As for the FPC compiler targeting CLR.. It could be done. But why would
you need to? Use Chrome instead. Why reinvent the wheel. I see no
advantage in porting Legacy Pascal code to a new disparate platform.
Especially when said platform does things a lot more pleasurably.

M
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: FPC and JAVA

Krishna-33
On 10/26/07, Matt Emson <[hidden email]> wrote:

> Krishna wrote:
> > Another thing, the code produced for the winemulator target is x86
> > code or arm code?
> Depends. The Visual Studio 2003 emulator is x86. Based on the VirtualPC
> core product. The Visual Studio 2005.. um.. I don't remember. I know
> Microsoft provide an ARM emulator that runs dog slow. I had the emulator
> and WM6 images about 5 months ago in my last job. Testing against the
> x86 emulator is only good for quick tests. Nothing beats debugging on a
> real device. If you pony up the cash, you can do that with VS2003 or VS2005.
>
> Let me just point out.. and this isn't a troll, it's my own experience:
> The end user does not care what your application is written in. Just so
> long as it works. As such, I would recommend Compact Framework and
> managed code for any Windows Mobile device. The memory footprint is
> minimal - all WM5 devices I have used (and we used quite a few brands)
> have the Compact Framework in ROM. Speed wise, it's fast. It doesn't
> crawl at all. Given the significant bugs Microsoft had in their native
> code  SQL Server CE 2.0 - as an example of native code on mobile
> devices,  C# and  CF.NET  make life far, far, far simpler. I found it
> cut development time down by between 50% and 70%. I can't even look at
> old code written using  C anymore. Shudder.
>

We are talking about Symbian OS here. For linux and windows mobile
devices, I understand you can use FPC directly, right?

> As for the FPC compiler targeting CLR.. It could be done. But why would
> you need to? Use Chrome instead. Why reinvent the wheel. I see no
> advantage in porting Legacy Pascal code to a new disparate platform.
> Especially when said platform does things a lot more pleasurably.

Legacy Pascal? Din't generics get added in the last release? Anyways,
I'm not asking for a CLR/JVM port. FPC already generates code for the
target (here, ARM) it is only the OS interface that we are talking
about.

Cheers,
-Krishna
--
One reason that life is complex is that it has a real part and an imaginary part
  -Andrew Koenig
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: FPC and JAVA

Matt Emson
Krishna wrote:
> On 10/26/07, Matt Emson <[hidden email]> wrote:
>  
> We are talking about Symbian OS here. For linux and windows mobile
> devices, I understand you can use FPC directly, right?
>
>  
Sorry, you said Winemulator. I read "windows emulator" not "emulator for
windows". My bad.

>> As for the FPC compiler targeting CLR.. It could be done. But why would
>> you need to? Use Chrome instead. Why reinvent the wheel. I see no
>> advantage in porting Legacy Pascal code to a new disparate platform.
>> Especially when said platform does things a lot more pleasurably.
>>    
>
> Legacy Pascal? Din't generics get added in the last release? Anyways,
> I'm not asking for a CLR/JVM port. FPC already generates code for the
> target (here, ARM) it is only the OS interface that we are talking
> about.
All native Object Pascal is legacy code for me. I haven't used Pascal in
a new project for .. um.. 3 + years. Last job I maintained a Delphi app,
but all new dev was in DotNet. I don't see going back to Delphi as an
option, ever. I keep on this list because I have ~15 years of Object
Pascal legacy code under my belt and I still really like Pascal. I want
to use it, but it's just not possible at the moment. Things might change
soon, I'm entering the world of MacOS X soon. Though MONO is on the
MacOS X platform, so I might not even then.

Does FPC support the flavour of Linux on the N800? That might also be
something I'd like to look at.

M
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: FPC and JAVA

Felipe Monteiro de Carvalho
In reply to this post by Krishna-33
On 10/26/07, Krishna <[hidden email]> wrote:
> In the SDK that I installed with Carbide I remember seeing binutils
> and friends. So I suppose that a GCC cross compiler is being used for
> building the code which means g++ is a supported compiler. Now,
> assuming that the symbian os itself is built using another compiler
> and the fact that g++ is binary compatible with the abi means that a
> bridge to g++ should be compatible with the binaries of other
> compilers. No?

Yes, but the emulator has different versions for many compilers, so
using this would mean giving up using the emulator.

> Another thing, the code produced for the winemulator target is x86
> code or arm code?

x86

Its actually a simulator

--
Felipe Monteiro de Carvalho
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: FPC and JAVA

Luca Olivetti-2
In reply to this post by Matt Emson
En/na Matt Emson ha escrit:

> Does FPC support the flavour of Linux on the N800? That might also be
> something I'd like to look at.

No :-(
All packages for the n800 are armel, i.e. they use EABI, while fpc
generates OABI calls.
I don't really know all the details of OABI vs EABI, I only know that a
simple "hello world" compiled with FPC, since it's a static application,
worked on the n800. Anything more complex doesn't.
For the record, I also tried to compile a C application natively on
another arm processor, with standard debian (i.e. OABI), the n800 didn't
even recognize the binary. Once I statically linked it, it ran with no
apparent problems. Again, it was a simple console application, nothing
fancy.

Bye
--
Luca

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: FPC and JAVA

Marco van de Voort
In reply to this post by Matt Emson
> > Legacy Pascal? Din't generics get added in the last release? Anyways,
> > I'm not asking for a CLR/JVM port. FPC already generates code for the
> > target (here, ARM) it is only the OS interface that we are talking
> > about.

> All native Object Pascal is legacy code for me. I haven't used Pascal in
> a new project for .. um.. 3 + years. Last job I maintained a Delphi app,
> but all new dev was in DotNet.

(My last job switched to C#, and has recently switched back to native
delphi for normal apps, so back to delphi except for ASP.NET)

> soon, I'm entering the world of MacOS X soon. Though MONO is on the
> MacOS X platform, so I might not even then.

Lazarus looks mighty fine natively on Mac. What does Mono have to counter
that?
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: FPC and JAVA

Jonas Maebe-2

On 27 Oct 2007, at 13:57, Marco van de Voort wrote:

> Lazarus looks mighty fine natively on Mac.

It may one day, but currently it is still very far from that. For  
example, pretty much every setting wubdiw has a wrong button layout.  
On the Mac, if you have a single "ok" button, it should be on the  
bottom right (in Lazarus they are in the middle). If you have an "ok"  
and "cancel" button, the "ok" should be on the right of the "cancel"  
button (in Lazarus, they are ordered the other way around). Also, all  
those icons in the menus look pretty weird (very few Mac apps have  
that, and none that I currently use does), and the icons in the  
toolbar look out of place compared to icons other Mac apps (mainly  
because of the limited colour palette and lack of anti-aliasing in  
the drawings, I guess).

In general, for now it still looks and feels very much like a pure  
Windows or Linux application with an Aqua skin. That may be fine for  
Windows/Linux users coming to the Mac, but it would make me click on  
the wrong buttons all the time.

I have great respect for Tombo and the others who have done a great  
job porting the LCL to Carbon, but it takes a whole lot more work  
than that to look and feel "mighty fine natively on Mac". The same  
will probably go for any Lazarus/Delphi app ported to the Mac, for  
that matter (unless Lazarus can do automatic button layouting, and if  
the current layout mismatch is simply due to some wrong default  
setting for the Carbon target).


Jonas
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: FPC and JAVA

Micha Nelissen
Jonas Maebe wrote:
> go for any Lazarus/Delphi app ported to the Mac, for that matter (unless
> Lazarus can do automatic button layouting, and if the current layout
> mismatch is simply due to some wrong default setting for the Carbon
> target).

Actually, we have a TButtonPanel exactly for this purpose. It's just
that (A) not all dialogs use it yet (B) it doesn't get the right default
setting from Carbon yet.

Perhaps not very easy fix, but the infrastructure exists.

Micha
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: FPC and JAVAy

Marco van de Voort
In reply to this post by Jonas Maebe-2
> On 27 Oct 2007, at 13:57, Marco van de Voort wrote:
>
> > Lazarus looks mighty fine natively on Mac.
>
> It may one day, but currently it is still very far from that. For  
> example, pretty much every setting wubdiw has a wrong button layout.  
> On the Mac, if you have a single "ok" button, it should be on the  
> bottom right (in Lazarus they are in the middle). If you have an "ok"  
> and "cancel" button, the "ok" should be on the right of the "cancel"  
> button (in Lazarus, they are ordered the other way around). Also, all  

See Micha's comment. Maybe I also should have added "for a first version"
btw.

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
12