[IronPython] Compiling with Pyc for Silverlight

2009-04-20 Thread Michael Foord
Hello guys, I'd like to modify Pyc to work with Silverlight. I tried it with simple modules and it works straightforwardly - but I have a report that it doesn't work with packages. I'll try it - but if anyone has any idea of how to modify the bytecode generation to target the CoreCLR it

Re: [IronPython] Compiling with Pyc for Silverlight

2009-04-20 Thread Dino Viehland
In theory there's just 1 IL re-write that's required for this to work. And that should be replacing the references to mscorlib/IronPython to point at the Silverlight versions. There's no way to directly have the written binaries target Silverlight because Reflection Emit has no

Re: [IronPython] Compiling with Pyc for Silverlight

2009-04-20 Thread Michael Foord
Dino Viehland wrote: In theory there's just 1 IL re-write that's required for this to work. And that should be replacing the references to mscorlib/IronPython to point at the Silverlight versions. There's no way to directly have the written binaries target Silverlight because Reflection

Re: [IronPython] Compiling with Pyc for Silverlight

2009-04-20 Thread Michael Foord
Dino Viehland wrote: In theory there's just 1 IL re-write that's required for this to work. And that should be replacing the references to mscorlib/IronPython to point at the Silverlight versions. There's no way to directly have the written binaries target Silverlight because Reflection

Re: [IronPython] Compiling with Pyc for Silverlight

2009-04-20 Thread Dino Viehland
An easy starting point would be to use ildasm + a Python script + ilasm. There's also CCI (just released on CodePlex last week) or Cecil which could also probably both be used for the task. I can only assume this exception is coming from having the assembly identities being different - but

Re: [IronPython] Compiling with Pyc for Silverlight

2009-04-20 Thread Michael Foord
Dino Viehland wrote: An easy starting point would be to use ildasm + a Python script + ilasm. There's also CCI (just released on CodePlex last week) or Cecil which could also probably both be used for the task. I'll start with ildasm. I looked at Cecil but it was a bit low level. I've

Re: [IronPython] Compiling with Pyc for Silverlight

2009-04-20 Thread Dino Viehland
How do you serialize the Assembly object? If it's easy enough we could presumably add this to support Silverlight natively - I'd love to have pre-compiled support there. -Original Message- From: users-boun...@lists.ironpython.com [mailto:users- boun...@lists.ironpython.com] On Behalf

Re: [IronPython] Compiling with Pyc for Silverlight

2009-04-20 Thread Michael Foord
Dino Viehland wrote: How do you serialize the Assembly object? If it's easy enough we could presumably add this to support Silverlight natively - I'd love to have pre-compiled support there. Well the Assembly type is marked with the SerializableAttribute so I was presuming to try

Re: [IronPython] Compiling with Pyc for Silverlight

2009-04-20 Thread Jb Evain
Hey Michael, On 4/20/09, Michael Foord fuzzy...@voidspace.org.uk wrote: I guess a full IL writer would be needed - which means back to Cecil and the like and seeing if parts of them could be run on Silverlight. *sigh* You just want to change the references to an assembly from the desktop

Re: [IronPython] Compiling with Pyc for Silverlight

2009-04-20 Thread Michael Foord
Jb Evain wrote: Hey Michael, On 4/20/09, Michael Foord fuzzy...@voidspace.org.uk wrote: I guess a full IL writer would be needed - which means back to Cecil and the like and seeing if parts of them could be run on Silverlight. *sigh* You just want to change the references to an

Re: [IronPython] Compiling with Pyc for Silverlight

2009-04-20 Thread Michael Foord
Michael Foord wrote: Jb Evain wrote: Hey Michael, On 4/20/09, Michael Foord fuzzy...@voidspace.org.uk wrote: I guess a full IL writer would be needed - which means back to Cecil and the like and seeing if parts of them could be run on Silverlight. *sigh* You just want to change the

Re: [IronPython] assembly versioning in scripts

2009-04-20 Thread Michael Foord
Marty Nelson wrote: One of our developers asked me this question today, I don’t have an answer, so any help would be appreciated: We came across an issue while testing the NuGenesis extension related to assembly versioning in scripts. The extension has a custom assembly, which is called by

Re: [IronPython] assembly versioning in scripts

2009-04-20 Thread Curt Hagenlocher
If a is an Assembly object, you should just be able to dot into it to get Types. So instead of clr.AddReference(a) from A.B.C.D import E you'd say E = a.A.B.C.D.E The Python import mechanism is global and not really consistent with having multiple things with the same name. On Mon, Apr 20,

Re: [IronPython] Compiling with Pyc for Silverlight

2009-04-20 Thread Dino Viehland
You're compiling to a DLL and then trying to import (vs compiling to an EXE)? -Original Message- From: users-boun...@lists.ironpython.com [mailto:users- boun...@lists.ironpython.com] On Behalf Of Michael Foord Sent: Monday, April 20, 2009 3:07 PM To: Discussion of IronPython