[Mono-dev] ilasm as a library

2010-05-16 Thread Miguel Garcia
Hi, I wanted to see how gmcs generates assemblies, given that I want to do the same for the Scala.Net compiler [1] (which as of now generates .il files). I started exploring codegen.cs and found a reference to Mono.CompilerServices.SymbolWriter . That may save an intermediate step, but how

Re: [Mono-dev] ilasm as a library

2010-05-16 Thread Robert Jordan
On 16.05.2010 15:22, Miguel Garcia wrote: > > Hi, > > I wanted to see how gmcs generates assemblies, given that I want to > do the same for the Scala.Net compiler [1] (which as of now generates > .il files). It is using System.Reflection.Emit, which means that there is no intermediate IL source co

Re: [Mono-dev] ilasm as a library

2010-05-16 Thread Miguel Garcia
Robert, Actually I did not mention IKVM.Reflection.Emit, nor Mono Cecil (old and new), and so on because for now I'm after a temporary solution, in the form of in-memory IL compilation (none of the CIL-emit libraries address this use case). Given that Microsoft's ilasm can only be invoked as

Re: [Mono-dev] ilasm as a library

2010-05-16 Thread Rodrigo Kumpera
I tried that in the past, to programatically call ilasm. The issue was that the library has some static context so it can't be called multiple times. I tried to hack around using appdomains with no luck at all. Changing it to work as a library should be easy (just peek at Driver::Main for how to d

Re: [Mono-dev] ilasm as a library

2010-05-16 Thread Rodrigo Kumpera
Forgot to mention, my problem with using appdomain was the very lacking performance. On Sun, May 16, 2010 at 12:35 PM, Rodrigo Kumpera wrote: > I tried that in the past, to programatically call ilasm. The issue was that > the library has some static context > so it can't be called multiple times

Re: [Mono-dev] ilasm as a library

2010-05-16 Thread Robert Jordan
Miguel, On 16.05.2010 17:12, Miguel Garcia wrote: > Given that Microsoft's ilasm can only be invoked as a command-line tool, it > would be great if Mono ilasm would sport a homepage showing off this > capability (I for one would find a code example or two very useful). It doesn't support in-memor

Re: [Mono-dev] ilasm as a library

2010-05-16 Thread Robert Jordan
On 16.05.2010 17:48, Robert Jordan wrote: >> About JayC, I made some more browsing and found this >> http://code.google.com/p/jayc/ , which I guess is the version gmcs uses, >> right? (otherwise, the correct URL would be welcome). > > http://anonsvn.mono-project.com/viewvc/trunk/mcs/jay/ What I f

Re: [Mono-dev] ilasm as a library

2010-05-16 Thread Andreas Nahr
> Actually I did not mention IKVM.Reflection.Emit, nor Mono Cecil (old > and > new), and so on because for now I'm after a temporary solution, in the > form > of in-memory IL compilation (none of the CIL-emit libraries address > this use > case). I'm not sure what you are trying to achieve. CLI is

Re: [Mono-dev] ilasm as a library

2010-05-17 Thread Miguel Garcia
"Andreas Nahr" wrote in message news:002b01caf54b$a49d3940$edd7ab...@com... > Which use case do you see for a "temporary solution" using .il files? The compiler backend in question currently generates .il but no .dll or .exe files. That's why I was thinking about calling Mono ilasm as a librar

Re: [Mono-dev] ilasm as a library

2010-05-17 Thread Andreas Nahr
> Now that you mention System.Reflection, I'm not sure how you get to that statement. But I NEVER mentioned System.Reflection. I've been talking about System.Reflection.Emit which is an (entirely) different thing. > https://blogs.msdn.com/jmstall/archive/2008/03/15/things-in-metadata- > that-are-