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 >> > > |