Re: [fpc-devel] New FPC target: JVM

2011-08-20 Thread Felipe Monteiro de Carvalho
Hello, Does this port generate Java Bytecode directly or does it generate first Java Assembler and then feeds that into an internal assembler? I ask because Android does not use Java Bytecode, it has it's own, completely different bytecode. -- Felipe Monteiro de Carvalho ___

Re: [fpc-devel] New FPC target: JVM

2011-08-20 Thread Jonas Maebe
On 20 Aug 2011, at 13:30, Felipe Monteiro de Carvalho wrote: > Does this port generate Java Bytecode directly or does it generate > first Java Assembler and then feeds that into an internal assembler? It generates Java assembler and then feeds it into an external assembler (Jasmin). > I ask be

Re: [fpc-devel] New FPC target: JVM

2011-08-20 Thread Alex Shishkin
I thought it was possible to convert Java class files into Dalvik class files? Jonas___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel AFAIK android SDK works just so. It converts lava`s

Re: [fpc-devel] New FPC target: JVM

2011-08-20 Thread Graeme Geldenhuys
On 20 August 2011 13:30, Felipe Monteiro de Carvalho wrote: > > I ask because Android does not use Java Bytecode, it has it's own, > completely different bytecode. Why did Google do that? Why not stay with the standardized Java and get the benefits of all existing Java and Mobile Java apps? Somet

Re: [fpc-devel] New FPC target: JVM

2011-08-20 Thread Mattias Gaertner
On Sat, 20 Aug 2011 17:02:17 +0200 Graeme Geldenhuys wrote: > On 20 August 2011 13:30, Felipe Monteiro de Carvalho wrote: > > > > I ask because Android does not use Java Bytecode, it has it's own, > > completely different bytecode. > > Why did Google do that? Why don't you google yourself? htt

Re: [fpc-devel] New FPC target: JVM

2011-08-20 Thread Max Vlasov
On Sat, Aug 20, 2011 at 12:49 PM, Jonas Maebe wrote: > > 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 featu

Re: [fpc-devel] New FPC target: JVM

2011-08-20 Thread Jonas Maebe
On 20 Aug 2011, at 21:40, Max Vlasov wrote: > Great new indeed! Just curious, is there an example program in pascal for > jvm that can be compiled and seen in action? I checked out tests, but > looking at random ones, they looks like console mode ones testing different > rtl aspects. I'm talking

Re: [fpc-devel] New FPC target: JVM

2011-08-20 Thread Nikolai Zhubr
20.08.2011 19:02, Graeme Geldenhuys: On 20 August 2011 13:30, Felipe Monteiro de Carvalho wrote: I ask because Android does not use Java Bytecode, it has it's own, completely different bytecode. Why did Google do that? Why not stay with the standardized Java and get the benefits of all existi

Re: [fpc-devel] New FPC target: JVM

2011-08-20 Thread Nikolai Zhubr
Hi, 20.08.2011 12:49, Jonas Maebe: Hi, There is a new branch in svn (branches/jvmbackend) that contains support for compiling Pascal code into Java virtual machine bytecode. This is really amazing, even if functionality is somewhat limited at the moment. Thanks for the great work! Nikola

Re: [fpc-devel] New FPC target: JVM

2011-08-20 Thread Hans-Peter Diettrich
Mattias Gaertner schrieb: A jvm backend for fpc is great. I hope it is not too much work to maintain. A .NET or Dalvik backend is feasable as easy as a JVM backend. Question is the use of such an code generator, without an RTL, FCL, debugger etc. DoDi __

Re: [fpc-devel] New FPC target: JVM

2011-08-20 Thread Jonas Maebe
On 20 Aug 2011, at 22:07, Jonas Maebe wrote: > No, I have not created any gui test programs. There's also the problem mentioned at http://wiki.freepascal.org/FPC_JVM/Language#Using_JDK_functionality : "The javapp utility cannot handle circular references involving nested classes, because they

Re: [fpc-devel] New FPC target: JVM

2011-08-20 Thread Joost van der Sluis
On Sun, 2011-08-21 at 00:11 +0200, Hans-Peter Diettrich wrote: > A .NET or Dalvik backend is feasable as easy as a JVM backend. Question > is the use of such an code generator, without an RTL, FCL, debugger etc. As 'easy'? Do you have any idea how much work Jonas, one of the most experienced deve

Re: [fpc-devel] New FPC target: JVM

2011-08-20 Thread Jonas Maebe
On 21 Aug 2011, at 00:02, Joost van der Sluis wrote: > On Sun, 2011-08-21 at 00:11 +0200, Hans-Peter Diettrich wrote: >> A .NET or Dalvik backend is feasable as easy as a JVM backend. Question >> is the use of such an code generator, without an RTL, FCL, debugger etc. Debuggers exist (any debug

Re: [fpc-devel] New FPC target: JVM

2011-08-20 Thread dmitry boyarintsev
On Sat, Aug 20, 2011 at 6:28 PM, Jonas Maebe wrote: > And Florian/Peter for the code generator design, that made it possible to > gradually add a high level code generator on top of it rather than having to > completely rewrite it. So there're actually 2 code generators right now. One is used f

Re: [fpc-devel] New FPC target: JVM

2011-08-20 Thread Hans-Peter Diettrich
Joost van der Sluis schrieb: On Sun, 2011-08-21 at 00:11 +0200, Hans-Peter Diettrich wrote: A .NET or Dalvik backend is feasable as easy as a JVM backend. Question is the use of such an code generator, without an RTL, FCL, debugger etc. As 'easy'? 'As' easy! DoDi __

Re: [fpc-devel] New FPC target: JVM

2011-08-20 Thread Paul Ishenin
21.08.2011 6:28, Jonas Maebe wrote: To make sure that credit is given where credit is due: I want to especially thank Paul Ishenin for his work on implementing Delphi-style "advanced records" and extending the class support with nested classes, class constants, final classes etc, because withou

Re: [fpc-devel] New FPC target: JVM

2011-08-20 Thread Alex Shishkin
21.08.2011 7:03, Paul Ishenin пишет: 21.08.2011 6:28, Jonas Maebe wrote: To make sure that credit is given where credit is due: I want to especially thank Paul Ishenin for his work on implementing Delphi-style "advanced records" and extending the class support with nested classes, class consta

Re: [fpc-devel] New FPC target: JVM

2011-08-21 Thread Jonas Maebe
On 21 Aug 2011, at 02:37, dmitry boyarintsev wrote: > So there're actually 2 code generators right now. One is used for JVM > and another is used for native machine code? The JVM target only uses the high level code generator. The other targets use a combination of both. Jonas

Re: [fpc-devel] New FPC target: JVM

2011-08-21 Thread Jonas Maebe
On 21 Aug 2011, at 05:03, Paul Ishenin wrote: > Sad that "units with dots" feature was blocked previosly - it would allow you > to write java classes as is with namespace prefix instead of use abbrevations. I don't think that would be usable, unless we'd also allow something like Java's "impor

Re: [fpc-devel] New FPC target: JVM

2011-08-21 Thread Graeme Geldenhuys
On 20 August 2011 17:54, Mattias Gaertner wrote: >> >> Why did Google do that? > > Why don't you google yourself? Lets see if I understand this correctly. Dalvik was designed to be suitable for systems that are constrained in terms of memory and processor speed. (Quoted from Wikipedia) Yet today's

Re: [fpc-devel] New FPC target: JVM

2011-08-21 Thread Jonas Maebe
On 21 Aug 2011, at 11:52, Graeme Geldenhuys wrote: > Lets see if I understand this correctly. Dalvik was designed to be > suitable for systems that are constrained in terms of memory and > processor speed. (Quoted from Wikipedia) Yet today's smart phones and > tablets are more powerful than the d

Re: [fpc-devel] New FPC target: JVM

2011-08-21 Thread Felipe Monteiro de Carvalho
One thing which I am curious: What is the main use case which led to this work? I can imagine it would be useful for example to have a work focused on j2me in order to target phones which run only Java and nothing else (although in reality j2me is each time more obsolete with the spread of smartph

Re: [fpc-devel] New FPC target: JVM

2011-08-21 Thread Graeme Geldenhuys
On Sunday, 21 August 2011, Jonas Maebe > Google is doing several things: > * they kept the Java programming language > * they replaced the JVM with Dalvik, to make it faster/more power efficient (by doing a bunch of analyses and transformations that are normally done at run time at compile time).

RE : [fpc-devel] New FPC target: JVM

2011-08-21 Thread Ludo Brands
> > No, Java is also known as a platform (like Java Virtual Machine). > > There are three separate things: > * Java the programming language > * the JVM platform/specification > * the JDK > > There are indeed commonly called together "the Java > platform", but they are not indivisible. That's wh

Re: [fpc-devel] New FPC target: JVM

2011-08-21 Thread Felipe Monteiro de Carvalho
On Sat, Aug 20, 2011 at 5:02 PM, Graeme Geldenhuys wrote: > Why did Google do that? Why not stay with the standardized Java and > get the benefits of all existing Java and Mobile Java apps? Java mobile (j2me) is almost completely different from usual Java APIs, even more then the Android API is d

Re: [fpc-devel] New FPC target: JVM

2011-08-21 Thread Jonas Maebe
On 21 Aug 2011, at 13:45, Felipe Monteiro de Carvalho wrote: > One thing which I am curious: What is the main use case which led to this > work? Application servers (usually web server backends). And the fact that it prepares the compiler for an LLVM backend: Java byte code is less strict abou

Re: [fpc-devel] New FPC target: JVM

2011-08-21 Thread Paul Ishenin
20.08.2011 16:49, Jonas Maebe wrote: 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 wou

Re: [fpc-devel] New FPC target: JVM

2011-08-21 Thread Jonas Maebe
On 21 Aug 2011, at 15:29, Paul Ishenin wrote: > 20.08.2011 16:49, Jonas Maebe wrote: >> 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

Re: [fpc-devel] New FPC target: JVM

2011-08-21 Thread dmitry boyarintsev
On Sun, Aug 21, 2011 at 3:45 AM, Jonas Maebe wrote: > > On 21 Aug 2011, at 02:37, dmitry boyarintsev wrote: > >> So there're actually 2 code generators right now. One is used for JVM >> and another is used for native machine code? > > The JVM target only uses the high level code generator. The oth

Re: [fpc-devel] New FPC target: JVM

2011-08-21 Thread dmitry boyarintsev
On Sun, Aug 21, 2011 at 5:33 PM, Jonas Maebe wrote: > > The problems are > a) he is adding the '.class' extension when trying to run the program. You > have to specify the name of the class to run, not the name of the class file > (so leave out the '.class') > b) he should specify the base path

Re: [fpc-devel] New FPC target: JVM

2011-08-21 Thread Zaher Dirkey
On Sat, Aug 20, 2011 at 11:49 AM, Jonas Maebe wrote: > 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

Re: [fpc-devel] New FPC target: JVM

2011-08-21 Thread Jonas Maebe
On 21 Aug 2011, at 19:05, dmitry boyarintsev wrote: > On Sun, Aug 21, 2011 at 3:45 AM, Jonas Maebe > wrote: >> >> On 21 Aug 2011, at 02:37, dmitry boyarintsev wrote: >> >>> So there're actually 2 code generators right now. One is used for JVM >>> and another is used for native machine code? >

Re: [fpc-devel] New FPC target: JVM

2011-08-21 Thread Jonas Maebe
On 21 Aug 2011, at 20:39, dmitry boyarintsev wrote: > I followed the instruction and again it failed to run the application. > However, it's unsaid that location of the ".class" file should also be > listed in "-cp" option. At least it worked fine for me. I tried it in > Windows, so I'm not sure

Re: [fpc-devel] New FPC target: JVM

2011-08-21 Thread Hans-Peter Diettrich
Graeme Geldenhuys schrieb: Lets see if I understand this correctly. Dalvik was designed to be suitable for systems that are constrained in terms of memory and processor speed. IMO more important is avoiding the US patents on Java. For the curious: the Java patents typically claim "Method And

Re: [fpc-devel] New FPC target: JVM

2011-08-22 Thread Michael Schnell
On 08/20/2011 01:30 PM, Felipe Monteiro de Carvalho wrote: I ask because Android does not use Java Bytecode, it has it's own, completely different bytecode. Ooops. Dalvik in fact completely off-standard on that behalf ! Wikipedia sais: Standard Java bytecode

Re: [fpc-devel] New FPC target: JVM

2011-08-22 Thread Michael Schnell
On 08/20/2011 01:42 PM, Jonas Maebe wrote: It generates Java assembler and then feeds it into an external assembler (Jasmin). Is writing Java assembler code in the pascal source possible (or planned) ? -Michael ___ fpc-devel maillist - fpc-devel@l

Re: [fpc-devel] New FPC target: JVM

2011-08-22 Thread Michael Schnell
On 08/20/2011 10:49 AM, Jonas Maebe wrote: ... GREAT !!! 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

Re: [fpc-devel] New FPC target: JVM

2011-08-22 Thread Michael Schnell
On 08/21/2011 11:52 AM, Graeme Geldenhuys wrote: So Google creating a incompatible Java for this supposed limitation of processor speed and low memory. Modern ARM processors (used for by far most Android devices) provide Jazelle DBX (Direct Byte code eXecution). Supposedly this does not help an

Re: [fpc-devel] New FPC target: JVM

2011-08-22 Thread Jonas Maebe
On 22 Aug 2011, at 11:48, Michael Schnell wrote: Is writing Java assembler code in the pascal source possible Anything is possible. (or planned) ? Not at this time. Jonas ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.f

Re: [fpc-devel] New FPC target: JVM

2011-08-22 Thread Michael Schnell
On 08/21/2011 01:55 PM, Felipe Monteiro de Carvalho wrote: my main problem with Android is that they do not allow users to run purely native executables. AFAIK, this has been overcome with the latest versions of Android.. -Michael ___ fpc-devel mailli

Re: [fpc-devel] New FPC target: JVM

2011-08-22 Thread Felipe Monteiro de Carvalho
On Mon, Aug 22, 2011 at 12:13 PM, Michael Schnell wrote: >> my main problem with Android >> is that they do not allow users to run purely native executables. > > AFAIK, this has been overcome with the latest versions of Android.. Not true. What 2.3 added is not really useful for Lazarus. It still

Re: [fpc-devel] New FPC target: JVM

2011-08-25 Thread Sven Barth
On 20.08.2011 10:49, Jonas Maebe wrote: 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! I've ta

Re: [fpc-devel] New FPC target: JVM

2011-08-25 Thread Jonas Maebe
On 25 Aug 2011, at 22:38, Sven Barth wrote: > But for now I have the problem to convert the class files provided by the SDK > into Pascal units using javapp. I have unpacked the android.jar to > $somedir/android and also copied javapp.jar there (just to be sure that there > are no path problem

Re: [fpc-devel] New FPC target: JVM

2011-08-26 Thread Jonas Maebe
On 25 Aug 2011, at 23:06, Jonas Maebe wrote: So: java -jar javapp.jar -classpath android.jar -protected javapp.jar android.app. Without the extra javapp.jar, obviously: java -jar javapp.jar -classpath android.jar -protected android.app. Jonas ___

Re: [fpc-devel] New FPC target: JVM

2011-08-26 Thread Sven Barth
Am 26.08.2011 13:01, schrieb Jonas Maebe: On 25 Aug 2011, at 23:06, Jonas Maebe wrote: So: java -jar javapp.jar -classpath android.jar -protected javapp.jar android.app. Without the extra javapp.jar, obviously: java -jar javapp.jar -classpath android.jar -protected android.app. Ok, I neede