From: Damian <dam...@gm...> - 2010-06-03 23:15:35
|
Hi, I'm new to xmlvm, I discovered it 2 days ago and I'm trying to get started with it and got some questions: 1. Is this list the right place to ask for help? 2. My language of choice is Scala by far, and my point is to code IPhone apps using Scala. Is that possible? Have anyone tried to get xmlvm working with scala? Well, thanks a lot. Damian. |
From: Damian <dam...@gm...> - 2010-06-03 23:34:28
|
So I would have to crosscompile the scala standard libraries (scala-library.jar), right? Because I've tried to do so, but I get an exception while compiling: Exception in thread "main" java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.simontuffs.onejar.Boot.run(Boot.java:306) at com.simontuffs.onejar.Boot.main(Boot.java:159) Caused by: java.lang.OutOfMemoryError: Java heap space at java.util.Arrays.copyOf(Arrays.java:2882) at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:100) at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:390) ................ more On Thu, Jun 3, 2010 at 8:27 PM, <len...@gm...> wrote: > Hi yes this is the right place. U will b able to access the Java classes > for the iphone from Scala, compile to Java byte code and then via xmlvm to > objective c. > > Sent via my BlackBerry from Vodacom - let your email find you! > > -----Original Message----- > From: Damian <dam...@gm...> > Date: Thu, 3 Jun 2010 20:15:27 > To: <xml...@li...> > Subject: [xmlvm-users] Getting started > > > ------------------------------------------------------------------------------ > ThinkGeek and WIRED's GeekDad team up for the Ultimate > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the > lucky parental unit. See the prize list and enter to win: > http://p.sf.net/sfu/thinkgeek-promo > > |
From: Sascha H. <sa...@xm...> - 2010-06-04 09:30:29
|
Hi Damian, to answer your questions from your first e-mail: 1) Yes this is the right place :) 2) In theory yes. I don't know Scala at all, but as it's being compiled down to JVM instructions, it's in theory possible to use XMLVM to cross-compile it. Now on to your error: I don't know what is all contained in scala-library.jar. Trying to cross-compile the whole API library of course sounds reasonable, but you might run into a lot of problems with unsupported functionality. E.g., one of the reasons we don't just cross-compile the whole Java Runtime libraries is because eventually you hit e.g. native methods that do something low level, and we don't support that yet. Now I don't know how the scala-library.jar looks like and what's in there, so I cannot say whether it's reasonable to try to cross-compile it. Your error seems like a bug in XMLVM to be, as there seems to be some infinite recursion going on. I will try to see whether I can reproduce this later. But again, it might not be reasonable to try and compile the whole library. What you could do, however, is the same thing we did with the Java side: You could implement compatibility classes of the the APIs you are using from Scala. This way you only need to cross-compile your actual application, and link it against the xmlvm compat lib. // Sascha On Fri, Jun 4, 2010 at 1:34 AM, Damian <dam...@gm...> wrote: > So I would have to crosscompile the scala standard libraries > (scala-library.jar), right? Because I've tried to do so, but I get an > exception while compiling: > > Exception in thread "main" java.lang.reflect.InvocationTargetException > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:597) > at com.simontuffs.onejar.Boot.run(Boot.java:306) > at com.simontuffs.onejar.Boot.main(Boot.java:159) > Caused by: java.lang.OutOfMemoryError: Java heap space at > java.util.Arrays.copyOf(Arrays.java:2882) > at > java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:100) > at > java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:390) > ................ more > > On Thu, Jun 3, 2010 at 8:27 PM, <len...@gm...> wrote: > >> Hi yes this is the right place. U will b able to access the Java classes >> for the iphone from Scala, compile to Java byte code and then via xmlvm to >> objective c. >> >> Sent via my BlackBerry from Vodacom - let your email find you! >> >> >> -----Original Message----- >> From: Damian <dam...@gm...> >> Date: Thu, 3 Jun 2010 20:15:27 >> To: <xml...@li...> >> Subject: [xmlvm-users] Getting started >> >> >> ------------------------------------------------------------------------------ >> ThinkGeek and WIRED's GeekDad team up for the Ultimate >> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the >> lucky parental unit. See the prize list and enter to win: >> http://p.sf.net/sfu/thinkgeek-promo >> >> > > > ------------------------------------------------------------------------------ > ThinkGeek and WIRED's GeekDad team up for the Ultimate > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the > lucky parental unit. See the prize list and enter to win: > http://p.sf.net/sfu/thinkgeek-promo > _______________________________________________ > xmlvm-users mailing list > xml...@li... > https://lists.sourceforge.net/lists/listinfo/xmlvm-users > > |
From: Panayotis K. <pan...@pa...> - 2010-06-04 10:17:00
|
On 04 Ιουν 2010, at 2:15 ΠΜ, Damian wrote: > > 2. My language of choice is Scala by far, and my point is to code > IPhone apps using Scala. Is that possible? Have anyone tried to get > xmlvm working with scala? It is possible. In theory you should be able to do so with no problems, since I think this library does not contain any native code (or maybe am wrong). But there are a lot of things to consider first, before jumping to Scala with xmlvm. First of all, I believe it is totally non-practical to compile the whole scala-lib. It is huge and contains a lot of things that are not directly usable, There are methods and tricks to cut down this overhead, (like a patch I am preparing and will be submitted soon), but still this is not practical - *right now*. Second there are things that should be addressed first before simply compile it with xmlvm, having to do with dependency libraries etc. Another thing: I strongly believe there is NO reason to create a compatibility library for Scala, the only thing that needs to be done is to determine the scala-lib dependencies. And this is a long talk. To summarize: I believe xmlvm is not ready for Scala yet, although I have the same idea as you: I want Scala to be able to be a language of choice - and not only Scala but every JVM based language. Right now you have to be patient though and go with the flow :) |
From: Damian <dam...@gm...> - 2010-06-05 03:51:15
|
Thanks for your reply. I don't fully understand the problem you expose. I succeeded cross-compiling the scala library (I wanted to try it anyway) by adding -Xmx1024m option when launching xmlvm. But the objective c compiler won't compile it anyway, it seems it can't find "java_lang_Cloneable.h". Isn't Cloneable interface supported by xmlvm? I was thinking that maybe I can try to strip down scala library to a minimum and then write my own library with the functionality I really need around the java library. Though that's exactly what the scala library is, the scala library is a 3.5MB jar that's maybe using too many features unsupported by xmlvm. Please tell me your thoughts. Damian. On Fri, Jun 4, 2010 at 7:16 AM, Panayotis Katsaloulis < pan...@pa...> wrote: > > On 04 Ιουν 2010, at 2:15 ΠΜ, Damian wrote: > > > > > 2. My language of choice is Scala by far, and my point is to code > > IPhone apps using Scala. Is that possible? Have anyone tried to get > > xmlvm working with scala? > > > It is possible. > In theory you should be able to do so with no problems, since I think > this library does not contain any native code (or maybe am wrong). > > But there are a lot of things to consider first, before jumping to > Scala with xmlvm. > > First of all, I believe it is totally non-practical to compile the > whole scala-lib. It is huge and contains a lot of things that are not > directly usable, There are methods and tricks to cut down this > overhead, (like a patch I am preparing and will be submitted soon), > but still this is not practical - *right now*. > > Second there are things that should be addressed first before simply > compile it with xmlvm, having to do with dependency libraries etc. > > Another thing: I strongly believe there is NO reason to create a > compatibility library for Scala, the only thing that needs to be done > is to determine the scala-lib dependencies. > And this is a long talk. > > > To summarize: I believe xmlvm is not ready for Scala yet, although I > have the same idea as you: I want Scala to be able to be a language of > choice - and not only Scala but every JVM based language. > Right now you have to be patient though and go with the flow :) > > > ------------------------------------------------------------------------------ > ThinkGeek and WIRED's GeekDad team up for the Ultimate > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the > lucky parental unit. See the prize list and enter to win: > http://p.sf.net/sfu/thinkgeek-promo > _______________________________________________ > xmlvm-users mailing list > xml...@li... > https://lists.sourceforge.net/lists/listinfo/xmlvm-users > |
From: Sascha H. <sa...@xm...> - 2010-06-05 17:45:46
|
Hi Damian, what you are seeing is that the scala library itself uses some classes from the Java Runtime, for example Cloneable. However, this class is not yet in our compatibility library. Of course one thing you could try to translating parts of the Java Runtime libraries, but i am sure that some things will fail this way. What you said sounds like the right strategy: Try to limit the cross-compilation to the classes you are actually using. This is a good starting point to see what needs to be supported by XMLVM in order to make it work in the end. // Sascha 2010/6/5 Damian <dam...@gm...> > Thanks for your reply. > I don't fully understand the problem you expose. > I succeeded cross-compiling the scala library (I wanted to try it anyway) > by adding -Xmx1024m option when launching xmlvm. > But the objective c compiler won't compile it anyway, it seems it can't > find "java_lang_Cloneable.h". Isn't Cloneable interface supported by xmlvm? > I was thinking that maybe I can try to strip down scala library to a > minimum and then write my own library with the functionality I really need > around the java library. Though that's exactly what the scala library is, > the scala library is a 3.5MB jar that's maybe using too many features > unsupported by xmlvm. > Please tell me your thoughts. > > Damian. > > On Fri, Jun 4, 2010 at 7:16 AM, Panayotis Katsaloulis < > pan...@pa...> wrote: > >> >> On 04 Ιουν 2010, at 2:15 ΠΜ, Damian wrote: >> >> > >> > 2. My language of choice is Scala by far, and my point is to code >> > IPhone apps using Scala. Is that possible? Have anyone tried to get >> > xmlvm working with scala? >> >> >> It is possible. >> In theory you should be able to do so with no problems, since I think >> this library does not contain any native code (or maybe am wrong). >> >> But there are a lot of things to consider first, before jumping to >> Scala with xmlvm. >> >> First of all, I believe it is totally non-practical to compile the >> whole scala-lib. It is huge and contains a lot of things that are not >> directly usable, There are methods and tricks to cut down this >> overhead, (like a patch I am preparing and will be submitted soon), >> but still this is not practical - *right now*. >> >> Second there are things that should be addressed first before simply >> compile it with xmlvm, having to do with dependency libraries etc. >> >> Another thing: I strongly believe there is NO reason to create a >> compatibility library for Scala, the only thing that needs to be done >> is to determine the scala-lib dependencies. >> And this is a long talk. >> >> >> To summarize: I believe xmlvm is not ready for Scala yet, although I >> have the same idea as you: I want Scala to be able to be a language of >> choice - and not only Scala but every JVM based language. >> Right now you have to be patient though and go with the flow :) >> >> >> ------------------------------------------------------------------------------ >> ThinkGeek and WIRED's GeekDad team up for the Ultimate >> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the >> lucky parental unit. See the prize list and enter to win: >> http://p.sf.net/sfu/thinkgeek-promo >> _______________________________________________ >> xmlvm-users mailing list >> xml...@li... >> https://lists.sourceforge.net/lists/listinfo/xmlvm-users >> > > > > ------------------------------------------------------------------------------ > ThinkGeek and WIRED's GeekDad team up for the Ultimate > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the > lucky parental unit. See the prize list and enter to win: > http://p.sf.net/sfu/thinkgeek-promo > _______________________________________________ > xmlvm-users mailing list > xml...@li... > https://lists.sourceforge.net/lists/listinfo/xmlvm-users > > |
From: Kühn W. <wo....@en...> - 2010-06-07 12:42:41
|
Hi Damian, here some issues I found while trying to cross-compile Scala to JavaScript: * The footprint may be larger as anticipated. For exampe, Console.scala uses DynamicVariable.scala, which uses the JRE class InheritableThreadLocal.java. * The Scala to Java-Byte-Code compiler emits code different from the JDK compiler. For example, Scala makes extensive use of method overloading by return type. In Java, the return type is not even part of the method signature. Another example is exception handling, where the current Scala compiler generates multi- entrant catch blocks. This is not possible in Java either. However, these issues can be handled, but I would stay clear of the concurrency features of Scale (actors). Also be aware of extensive method invocations and object creations by Scala programs, which modern JVMs handle well, but which may not be the case for cross-compiled code. For more details and some demos, please refer to http://days2010.scala-lang.org/node/138/142 Greetings, Wolfgang ________________________________ Von: Damian [mailto:dam...@gm...] Gesendet: Samstag, 5. Juni 2010 05:51 An: Panayotis Katsaloulis Cc: xml...@li... Betreff: Re: [xmlvm-users] Getting started Thanks for your reply. I don't fully understand the problem you expose. I succeeded cross-compiling the scala library (I wanted to try it anyway) by adding -Xmx1024m option when launching xmlvm. But the objective c compiler won't compile it anyway, it seems it can't find "java_lang_Cloneable.h". Isn't Cloneable interface supported by xmlvm? I was thinking that maybe I can try to strip down scala library to a minimum and then write my own library with the functionality I really need around the java library. Though that's exactly what the scala library is, the scala library is a 3.5MB jar that's maybe using too many features unsupported by xmlvm. Please tell me your thoughts. Damian. On Fri, Jun 4, 2010 at 7:16 AM, Panayotis Katsaloulis <pan...@pa...<mailto:pan...@pa...>> wrote: On 04 Ιουν 2010, at 2:15 ΠΜ, Damian wrote: > > 2. My language of choice is Scala by far, and my point is to code > IPhone apps using Scala. Is that possible? Have anyone tried to get > xmlvm working with scala? It is possible. In theory you should be able to do so with no problems, since I think this library does not contain any native code (or maybe am wrong). But there are a lot of things to consider first, before jumping to Scala with xmlvm. First of all, I believe it is totally non-practical to compile the whole scala-lib. It is huge and contains a lot of things that are not directly usable, There are methods and tricks to cut down this overhead, (like a patch I am preparing and will be submitted soon), but still this is not practical - *right now*. Second there are things that should be addressed first before simply compile it with xmlvm, having to do with dependency libraries etc. Another thing: I strongly believe there is NO reason to create a compatibility library for Scala, the only thing that needs to be done is to determine the scala-lib dependencies. And this is a long talk. To summarize: I believe xmlvm is not ready for Scala yet, although I have the same idea as you: I want Scala to be able to be a language of choice - and not only Scala but every JVM based language. Right now you have to be patient though and go with the flow :) ------------------------------------------------------------------------------ ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo _______________________________________________ xmlvm-users mailing list xml...@li...<mailto:xml...@li...> https://lists.sourceforge.net/lists/listinfo/xmlvm-users |
From: Damian <dam...@gm...> - 2010-06-07 13:00:15
|
Well I managed to get something working. I cross compiled the library and then stripped it down. I removed actors, xml, DynamicVariable, and a lot more. I'm having some issues with Console (or StringBuilder, don't know yet), and I will surely encounter more problems later. But well, it's working now :D I will watch your video as soon as I can. 2010/6/7 Kühn Wolfgang <wo....@en...> > Hi Damian, > > here some issues I found while trying to cross-compile Scala to JavaScript: > * The footprint may be larger as anticipated. For exampe, Console.scala > uses DynamicVariable.scala, > which uses the JRE class InheritableThreadLocal.java. > * The Scala to Java-Byte-Code compiler emits code different from the JDK > compiler. For example, Scala > makes extensive use of method overloading by return type. In Java, the > return type is not even part of the > method signature. Another example is exception handling, where the > current Scala compiler generates multi- > entrant catch blocks. This is not possible in Java either. > > However, these issues can be handled, but I would stay clear of the > concurrency features of Scale (actors). > Also be aware of extensive method invocations and object creations by Scala > programs, which modern JVMs > handle well, but which may not be the case for cross-compiled code. > > For more details and some demos, please refer to > http://days2010.scala-lang.org/node/138/142 > > Greetings, Wolfgang > > ------------------------------ > *Von:* Damian [mailto:dam...@gm...] > *Gesendet:* Samstag, 5. Juni 2010 05:51 > *An:* Panayotis Katsaloulis > *Cc:* xml...@li... > *Betreff:* Re: [xmlvm-users] Getting started > > Thanks for your reply. > I don't fully understand the problem you expose. > I succeeded cross-compiling the scala library (I wanted to try it anyway) > by adding -Xmx1024m option when launching xmlvm. > But the objective c compiler won't compile it anyway, it seems it can't > find "java_lang_Cloneable.h". Isn't Cloneable interface supported by xmlvm? > I was thinking that maybe I can try to strip down scala library to a > minimum and then write my own library with the functionality I really need > around the java library. Though that's exactly what the scala library is, > the scala library is a 3.5MB jar that's maybe using too many features > unsupported by xmlvm. > Please tell me your thoughts. > > Damian. > > On Fri, Jun 4, 2010 at 7:16 AM, Panayotis Katsaloulis < > pan...@pa...> wrote: > >> >> On 04 Ιουν 2010, at 2:15 ΠΜ, Damian wrote: >> >> > >> > 2. My language of choice is Scala by far, and my point is to code >> > IPhone apps using Scala. Is that possible? Have anyone tried to get >> > xmlvm working with scala? >> >> >> It is possible. >> In theory you should be able to do so with no problems, since I think >> this library does not contain any native code (or maybe am wrong). >> >> But there are a lot of things to consider first, before jumping to >> Scala with xmlvm. >> >> First of all, I believe it is totally non-practical to compile the >> whole scala-lib. It is huge and contains a lot of things that are not >> directly usable, There are methods and tricks to cut down this >> overhead, (like a patch I am preparing and will be submitted soon), >> but still this is not practical - *right now*. >> >> Second there are things that should be addressed first before simply >> compile it with xmlvm, having to do with dependency libraries etc. >> >> Another thing: I strongly believe there is NO reason to create a >> compatibility library for Scala, the only thing that needs to be done >> is to determine the scala-lib dependencies. >> And this is a long talk. >> >> >> To summarize: I believe xmlvm is not ready for Scala yet, although I >> have the same idea as you: I want Scala to be able to be a language of >> choice - and not only Scala but every JVM based language. >> Right now you have to be patient though and go with the flow :) >> >> >> ------------------------------------------------------------------------------ >> ThinkGeek and WIRED's GeekDad team up for the Ultimate >> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the >> lucky parental unit. See the prize list and enter to win: >> http://p.sf.net/sfu/thinkgeek-promo >> _______________________________________________ >> xmlvm-users mailing list >> xml...@li... >> https://lists.sourceforge.net/lists/listinfo/xmlvm-users >> > > |