<div dir="ltr">Thanks for responding! It's good to know there weren't any particular technical barriers that would prevent a working N3 implementation.<div><br></div><div>I have some followup questions:</div><div>Did N3 support reflection and/or generics? How, if at all, did N3 support structs? What about ref and out parameters? Have you considered using Mono.Cecil for parsing out the .net assemblies, metadata, and bytecode?</div>
<div><br></div><div>Also, Mono has support for LLVM already, though the generated LLVM code links with the mono runtime. It might be possible to adapt this LLVM compiler backend to link with VMKit instead of mono, or else provide an adapter library that follows the interface of the mono VM, but forwards calls into VMKit, so the generated code isn't bound by the LGPL of the mono runtime. There are several known issues, as described here (e.g. varargs doesn't work):</div>
<div><br></div><div><a href="http://www.mono-project.com/Mono:Runtime:Documentation:LLVM">http://www.mono-project.com/Mono:Runtime:Documentation:LLVM</a><br></div><div><br></div><div>Either way, this might provide a head-start in terms of implementing the full range of CIL opcodes.</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Sep 15, 2013 at 3:33 AM, Gaël Thomas <span dir="ltr"><<a href="mailto:gael.thomas@lip6.fr" target="_blank">gael.thomas@lip6.fr</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Jeremy,<br>
<br>
2013/9/13 Jeremy Bell <<a href="mailto:bell.jeremy@gmail.com">bell.jeremy@gmail.com</a>>:<br>
<div class="im">> I looked into the archives as far back as 2009 and searched around for more<br>
> information about vmkit, but I still have some questions.<br>
><br>
> First of all, what is that status of VMKit? Is there any active development?<br>
> A roadmap? Is it in maintenance mode?<br>
<br>
</div>The development is inactive since two month because the main engineer<br>
of VMKit is now working for a big company (cool for him, but that's<br>
why I was so slow to answer your mail:)). For the moment, we are in<br>
maintenance mode, but a new engineer will probably start working on<br>
the project in two or three weeks. And we have a roadmap, we are<br>
currently implementing a new VM for the Scilab language and we are<br>
developing a clang pass to help the development of new VMs. Basically,<br>
the clang pass is able to generate the glue between the C code and the<br>
GC, as it was presented in ISMM few years ago by another team (Jon<br>
Rafkind, Adam Wick, John Regehr, Matthew Flatt: Precise garbage<br>
collection for C. ISMM 2009).<br>
<div class="im"><br>
<br>
><br>
> Secondly, can VMKit generate binaries that can be used on android/jni?<br>
<br>
</div>As android relies on Linux, it's probably easy to generate binaries<br>
compliant with android (VMKit runs on Linux and MacOS). The problem<br>
that can arise is related to the processor: we have only tested VMKit<br>
on x86_32, x86_64 and powerpc architectures, not on arm<br>
architectures... Porting VMKit on arm should not be so complicated as<br>
llvm has already a backend for this architecture. It's probably a<br>
matter of defining the size of the word for this architecture.<br>
<br>
By JNI, you mean the Java Native Interface? On one way, as VMKit<br>
generates native code with LLVM, you can link this code with a JNI<br>
library and use the generated code in any Java virtual machine.<br>
However, using VMKit through JNI requires the implementation of a<br>
small wrapper because VMKit defines its own threads and a Java virtual<br>
machine also. It probably means that you should have an intermediate<br>
JNI threads that forwards the JNI calls to the VMKit threads. On the<br>
other way, J3, the Java virtual machine built upon VMKit, is a full<br>
Java virtual machine and fully implements JNI itself.<br>
<div class="im"><br>
><br>
> Finally, I understand that the .net/CLI support is no longer being<br>
> maintained. Were there technical reasons for this, or just a lack of<br>
> interest? Is the code still within the repository or was it removed at some<br>
> point? If it was removed, what is the last tag/version of the code contains<br>
> the .net/CLI implementation?<br>
<br>
</div>We haven't maintained the CLI since three years because we didn't have<br>
the time for that (we are a small team:)). You should find the code in<br>
the repository. If you need it I can try to find the last revision.<br>
Anyway, even if you are able to find this code, you will have to use a<br>
very old version of llvm to compile it, and the vmkit version will be<br>
very old with a lot of bugs... So, you will have to port the code of<br>
N3 (the .Net virtual machine) on the latest VMKit release, which can<br>
take few weeks because everything has changed in VMKit :) (N3 was<br>
relying on the Boehm GC while we are currently using MMTk).<br>
<div class="im"><br>
><br>
> The reason I ask is that I took over a project to bring Mono to android for<br>
> open source development. You can see it here:<br>
> <a href="https://github.com/JeroMiya/androidmono" target="_blank">https://github.com/JeroMiya/androidmono</a><br>
<br>
</div>Great project!<br>
<div class="im"><br>
><br>
> But development hit a wall due to licensing, because Xamarin, the company<br>
> that develops mono, sells commercial licenses for Mono to use in place of<br>
> the LGPL on embedded platforms like Android/iOS, and claims that the LGPL is<br>
> not compatible with the Play store. While I disagree (as does the FSF as I<br>
> recall), I'm not a lawyer and can't justify hiring one for a hobbyist<br>
> project. In either case, it's clear Xamarin has become hostile to open<br>
> source development with their product, so it's not something I want to test.<br>
> This means apps built using my project could only be distributed directly<br>
> (via sideloading) or via F-Droid or other open source friendly third party<br>
> app stores, even if they're open source apps.<br>
><br>
> So, I've been shopping around for alternatives to the LGPL portions of the<br>
> Mono runtime which can more easily be licensed for open or closed source<br>
> development on mobile or restricted app store deployments. The only credible<br>
> alternatives I've found so far are the .Net MicroFramework, which is<br>
> licensed under Apache but is meant for low level hardware, and VMKit, which<br>
> sounds promising but the .Net implementation has been deprecated.<br>
><br>
> If someone is more familiar with the VMKit codebase, could you comment on<br>
> what kind of work would be needed to update the existing CLI implementation<br>
> of VMKit to the latest source?<br>
<br>
</div>As I said, it should not be so difficult. For someone familiar with<br>
VMKit, it will take one month. And understanding the code of VMKit<br>
takes around one month more.<br>
<div class="im"><br>
> Also, what features still need to be<br>
> implemented, and what barriers have been identified?<br>
<br>
</div>We haven't identified barriers. The N3 runtime was minimal and we were<br>
able to execute several scientific benchmarks. Having a full .Net<br>
virtual machine with all the bytecodes is probably only a matter of<br>
time.<br>
<div class="im"><br>
> I'm not expecting<br>
> anything production ready by any means, and I'm willing to do the work as<br>
> long as there's at least a chance at success.<br>
<br>
</div>If you start this work, we can try to help you to understand the code<br>
(we can not help for implementation itself as, for the moment, we<br>
don't have a lot of manpower). Having an android version of VMKit<br>
could be fun, and having the .Net virtual machine resurrected could be<br>
pretty cool :)<br>
<br>
Gaël<br>
<br>
PS: if you start playing with VMKit, we have a bug that we are unable<br>
to solve yet with the last version of openjdk. We are only able to<br>
compile VMKit with the version 7u23 of openjdk.<br>
<div class="im HOEnZb"><br>
><br>
> Thanks for your time!<br>
> Regards,<br>
> Jeremy Bell<br>
><br>
</div><div class="HOEnZb"><div class="h5">> _______________________________________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
><br>
<br>
<br>
<br>
</div></div><span class="HOEnZb"><font color="#888888">--<br>
-------------------------------------------------------------------<br>
Gaël Thomas, Associate Professor, UPMC<br>
<a href="http://pagesperso-systeme.lip6.fr/Gael.Thomas/" target="_blank">http://pagesperso-systeme.lip6.fr/Gael.Thomas/</a><br>
-------------------------------------------------------------------<br>
</font></span></blockquote></div><br></div>