Porting PlayN to XMLVM

165 views
Skip to first unread message

Laszlo Fazekas

unread,
May 28, 2012, 6:59:10 AM5/28/12
to PlayN
Hi!

As I've seen, PlayN is using MonoTouch and IKVM for building iPhone
applications. It is a good solution, but maybe XMLVM could be better
for some reason:

- XMLVM is free (MonoTouch is a commercial product)
- no need to link the full mono virtual machine to every build
(MonoTouch linking the mono virtual machine to the application, XMLVM
is generating C code directly)
- an XMLVM port can be open the way for other platforms (ex.: XMLVM
generates C code, which can be a base of a Symbian port, etc.)

Take a look on it, on XMLVM.org. I'm not part of the team, not a
contributor, etc. but I'm searching for a good cross-platform solution
long time ago, and I think XMLVM + PlayN could be a killer
combination.

Kind regards,
Laszlo

Mickael Barbeaux

unread,
May 28, 2012, 3:03:02 PM5/28/12
to pl...@googlegroups.com
Hi,

I tried recently to check if it was possible to use XMLVM with PlayN.
Unfortunately, XMLVM is still under alpha development, and many methods aren't implemented yet.
Moreover, it doesn't support yet OpenGL ES 2, so everything has to be implemented inside XMLVM. It is surely possible, but it's probably a lot of work.

I'll keep going forward to see if it's possible to use XMLVM or not.
For those interested, https://github.com/mbarbeaux

Mikael

Ray Cromwell

unread,
May 28, 2012, 6:05:54 PM5/28/12
to pl...@googlegroups.com
IMHO, porting to hAXe would be better. XMLVM IIRC doesn't generate
efficient C code, compared to MonoTouch which I presume uses LLVM as a
backend?

-Ray

Paracelsus Philippus Aureolus Theophrastus Bombastus von Hohenheim

unread,
May 29, 2012, 8:00:10 PM5/29/12
to PlayN
Is Monotouch really linking the mono virtual machine to every
application? Doesn't it produce C-code that can be directly executed
on the iPhone?

Paracelsus Philippus Aureolus Theophrastus Bombastus von Hohenheim

unread,
May 29, 2012, 8:14:08 PM5/29/12
to PlayN
There seems to be a plethora of languages and compilers that target a
lot of platforms. For example: http://en.wikipedia.org/wiki/Monkey_%28programming_language%29

The question is, can PlayN learn from them and take their good parts
if license permits?

Laszlo Fazekas

unread,
May 29, 2012, 10:20:07 PM5/29/12
to pl...@googlegroups.com
MonoTouch compiles native code (you can read about it on Wikipedia,  http://en.wikipedia.org/wiki/MonoTouch#MonoTouch). It was my fault when I've written MonoTouch linking the full VM to the generated application. Mono dose it only on Android platform ( http://en.wikipedia.org/wiki/MonoDroid#Mono_for_Android). 

XMLVM looks like a little bit better, because of licensing (MonoTouch is commercial, XMLVM is free), and XMLVM's Java -> iPhone C compilation looks like "more direct" than Java -> IKVM -> MonoTouch -> iPhone C, but I haven't any data (benchmark, etc.) about the efficiency. The bigger problem is what Mickael has written, XMLVM is still alpha ... 

Mickael Barbeaux

unread,
May 30, 2012, 1:44:56 AM5/30/12
to pl...@googlegroups.com
Well, from what I tested inside XMLVM...

There is an ObjC backend (Java is compiled directly to ObjC), about every methods of the iOS API is implemented but the major counterpart is that it doesn't include  any Garbage Collection so everything has to be done in the Java code (uninitialize objects, etc).
The C backend of XMLVM contains much more things, a GC, it uses the Apache Harmony Java implementation, which is much more stable than the Java implementation they made from scratch for the ObjC backend, it also includes more Java API (reflection, etc). But the C backend contains many iOS API methods that aren't implemented yet. Implement them is not a big deal, it's often really obvious. So I'll keep investigating on it, and try to implement a complete iOS XMLVML PlayN backend.

The most difficult part would be to include  OpenGLES 2, as nothing has been done yet on XMLVM. Some guy tried in 2009 to add OpenGL1 inside XMLVM, made a little demo (a small rotating triangle using OpenGL) which still works today, but that's it. No Shaders, no OpenGL ES...

Mickael

Ray Cromwell

unread,
May 30, 2012, 3:48:51 AM5/30/12
to pl...@googlegroups.com
I haven't looked at XMLVM in a while, but isn't it really a form of
compiled interpreter? That is, it emulates a stack machine in C code
by updating an emulated Java stack. e.g. if you see an instruction
like aload_0, it will do stack[stackPtr++]=localVar_0? This strikes me
as less efficient than LLVM generation.

-Ray
Reply all
Reply to author
Forward
0 new messages