Re: [IronPython] Compilation error

2007-10-17 Thread Dino Viehland
Looks like the internal bug got closed as By Design as well, I've reactivated it. Maybe it's not clear to them that their making a distinction based upon what assembly the struct is defined in. I added the below repro snippet to the internal bug: using System; using System.Reflection; class f

Re: [IronPython] [python] Re: Announcement: ProjecttogetsomeCPython C extensions running under IronPython

2007-10-17 Thread Joe Mason
On 10/17/07, Keith J. Farmer <[EMAIL PROTECTED]> wrote: > I know what pointers are – I just don't like them. > > In C++/CLI you'd use a caret to get a safe handle to said object. But... but that's not source compatible? Joe ___ Users mailing list Users@

Re: [IronPython] Compilation error

2007-10-17 Thread Sanghyeon Seo
2007/10/6, Dino Viehland <[EMAIL PROTECTED]>: > BTW my simple repro is bogus - it contains no members and section 5.3 of the > C# spec defines value types as being definitely assigned when all their > members are assigned. The real issue seems to be when the value-type is > defined in another a

[IronPython] My takes on C Extensions for IronPython

2007-10-17 Thread Seo Sanghyeon
The discussion is getting very confusing, so here are some of my takes on the issues. On the issue of P/Invoke declarations for Python/C API, Paolo Molaro wrote: "The python API requires a couple dozen structure definitions plus a few dozen dllimport declarations. This can be about 200 lines of t

Re: [IronPython] Need a Good Embedded Example

2007-10-17 Thread Joshua J. Pearce
OK, please forgive my earlier vagueness. What I want to do is as follows: pe = PythonEngine.CurrentEngine; //create a instance of my applications business logic layer class myAppService = new AppService(_token); //I want to be able to somehow make methods from the myAppService class available to

Re: [IronPython] [python] Re: Announcement: ProjecttogetsomeCPython C extensions running under IronPython

2007-10-17 Thread Keith J. Farmer
I know what pointers are - I just don't like them. In C++/CLI you'd use a caret to get a safe handle to said object. From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Curt Hagenlocher Sent: Wednesday, October 17, 2007 3:34 PM To: Discussion of IronPython Subject: Re: [IronPytho

Re: [IronPython] [python] Re: Announcement: Project togetsomeCPython C extensions running under IronPython

2007-10-17 Thread Curt Hagenlocher
On 10/17/07, Keith J. Farmer <[EMAIL PROTECTED]> wrote: > > See my earlier email. I think you **could** keep it in C, compile into > pure IL. At that point you have to deal with pointer-driven algorithms (eg, > NumPy), but you could generate safe code. > The basic data type in a CPython extensio

Re: [IronPython] [python] Re: Announcement: Project togetsomeCPython C extensions running under IronPython

2007-10-17 Thread Keith J. Farmer
See my earlier email. I think you *could* keep it in C, compile into pure IL. At that point you have to deal with pointer-driven algorithms (eg, NumPy), but you could generate safe code. Anyway, I need to go eat. I think some serious thought should be given to C++/CLI as an option to produce

Re: [IronPython] [python] Re: Announcement: Project to getsomeCPython C extensions running under IronPython

2007-10-17 Thread Keith J. Farmer
I think my point is that if you switch which dialect of C you're compiling with, such marshalling issues could (potentially) go away. Again, I'm naïve here. I've not made it my business to write native libraries for Python. Just one, and that was years ago. From: [EMAIL PROTECTED] [mail

Re: [IronPython] [python] Re: Announcement: Project to getsomeCPython C extensions running under IronPython

2007-10-17 Thread Curt Hagenlocher
On 10/17/07, Keith J. Farmer <[EMAIL PROTECTED]> wrote: > > > A larger worry I have is the possibility that some of this will end up > being unsafe code, at which point you will have difficulties in full trust > scenarios, such as web servers. This project will by definition be producing "unsafe"

Re: [IronPython] [python] Re: Announcement: Project to get someCPython C extensions running under IronPython

2007-10-17 Thread Curt Hagenlocher
On 10/17/07, Joe Mason <[EMAIL PROTECTED]> wrote: > > On 10/17/07, Keith J. Farmer <[EMAIL PROTECTED]> wrote: > > Forgive my non-C-ness (it's been a long time since I wrote a native > module > > for Python), but aren't you now buying into a major re-implementation of > all > > the native Python sta

Re: [IronPython] [python] Re: Announcement: Project to getsomeCPython C extensions running under IronPython

2007-10-17 Thread Keith J. Farmer
Best if Michael et al chime in, but my impression was that they're working under the assumption that you cannot get C++ code to compile to pure managed (False, use C++/CLI as recommended on the Mono site), and that it must *compile* under Mono (laudable, but I doubt it's necessary -- I've never

Re: [IronPython] [python] Re: Announcement: Project to get someCPython C extensions running under IronPython

2007-10-17 Thread Joe Mason
On 10/17/07, Keith J. Farmer <[EMAIL PROTECTED]> wrote: > Forgive my non-C-ness (it's been a long time since I wrote a native module > for Python), but aren't you now buying into a major re-implementation of all > the native Python standard library into C#? Couldn't the C/C# API just use IronPytho

Re: [IronPython] [python] Re: Announcement: Project to get someCPython C extensions running under IronPython

2007-10-17 Thread Keith J. Farmer
Forgive my non-C-ness (it's been a long time since I wrote a native module for Python), but aren't you now buying into a major re-implementation of all the native Python standard library into C#? Assuming for a moment that few sane people will want to re-compile them from source, it seems muc

Re: [IronPython] [python] Using IP with Idle

2007-10-17 Thread [EMAIL PROTECTED]
Komodo Edit should suit a Unix minded person - it has autocompletion, strong macros and you can run a command shell from within the interface. Cheers, Davy Mitchell On Oct 17, 8:42 pm, Michael Foord <[EMAIL PROTECTED]> wrote: > Allison Day wrote: > > I have been using python in a unix environment

Re: [IronPython] [python] Using IP with Idle

2007-10-17 Thread Davy Mitchell
Sorry if this shows up twice :-) Komodo Edit should suit a Unix minded person - it has autocompletion, strong macros and you can run a command shell interactively from within the interface. Cheers, Davy Mitchell On 10/17/07, Michael Foord <[EMAIL PROTECTED]> wrote: > Allison Day wrote: > > I hav

Re: [IronPython] [python] Re: Announcement: Project to get some CPython C extensions running under IronPython

2007-10-17 Thread Curt Hagenlocher
On 10/17/07, Michael Foord <[EMAIL PROTECTED]> wrote: > > I would be sad if we chose any approach that couldn't work on Mono. :-( I agree. Assuming this rules out MC++, I think the next best approach is (as Paolo suggests) to try to shift as much of the work to C# as possible. Here's an archite

Re: [IronPython] Need a Good Embedded Example

2007-10-17 Thread JoeSox
On 10/17/07, Joshua J. Pearce <[EMAIL PROTECTED]> wrote: > I am looking for an embedded IronPython 2.0 example beyond the simple hello > world one I quoted before. > > What I want to know is: > > 1) How to get variable output from the script back to my c# code. I have a quick section in this artic

Re: [IronPython] [python] Re: Announcement: Project to get some CPython C extensions running under IronPython

2007-10-17 Thread Michael Foord
Curt Hagenlocher wrote: > On 10/17/07, *Giles Thomas* <[EMAIL PROTECTED] > > wrote: > > Curt - how does MC++ relate to using P/Invoke? That is, is it > P/Invoke plus some clever packaging stuff to allow you to produce > a single assembly with both machine cod

Re: [IronPython] How to find class and module variables when debugging IronPython

2007-10-17 Thread Dino Viehland
Haibo's blog has some info on this: http://blogs.msdn.com/haibo_luo/archive/2007/08/03/4210344.aspx It has a debugger proxy which enables old-class members to show up in VS. For other class members you'll generally look in self.__dict__ or self.__class__.__dict__ for class members. I don't th

[IronPython] How to find class and module variables when debugging IronPython

2007-10-17 Thread David . Lawler
When debugging an IronPython script I can see local variables in mdbg or cordebug. However, I cannot find a way to get class (self) and module variables. Is there anyway to do this? It's ok if it requires several steps like going up the stack frame and finding a symbol reference and then rea

Re: [IronPython] [python] Using IP with Idle

2007-10-17 Thread Michael Foord
Allison Day wrote: > I have been using python in a unix environment for years and am a > complete noob to iron python, windows, and .net as of yesterday > (GCK! says the Linux Guy :-) so please be patient. > > I was looking to use Idle with Ironpython but am not sure how to do > this or if

[IronPython] Using IP with Idle

2007-10-17 Thread Allison Day
I have been using python in a unix environment for years and am a complete noob to iron python, windows, and .net as of yesterday (GCK! says the Linux Guy :-) so please be patient. I was looking to use Idle with Ironpython but am not sure how to do this or if it can be done. I saw a refer

Re: [IronPython] Setting builtin_module_names

2007-10-17 Thread Dino Viehland
You're right - I think the logic might have been to reflect "new" built-in modules which are added externally, but it doesn't look like CPython does this (for example _socket isn't in the list). I'll check-in a fix for this for the next release. -Original Message- From: [EMAIL PROTECTE

Re: [IronPython] Announcement: Project to get some CPython C extensions running under IronPython

2007-10-17 Thread Tony Djordjevski
Paolo Molaro wrote: > On 10/17/07 Curt Hagenlocher wrote: >> On 10/17/07, Paolo Molaro <[EMAIL PROTECTED]> wrote: >>> The python API requires a couple dozen structure definitions plus a few >>> dozen dllimport declarations. This can be about 200 lines of trivial >>> to write declarative stuff. >> I

Re: [IronPython] Announcement: Project to get some CPython C extensions running under IronPython

2007-10-17 Thread Paolo Molaro
On 10/17/07 Curt Hagenlocher wrote: > On 10/17/07, Paolo Molaro <[EMAIL PROTECTED]> wrote: > > The python API requires a couple dozen structure definitions plus a few > > dozen dllimport declarations. This can be about 200 lines of trivial > > to write declarative stuff. > > I'm having trouble und

[IronPython] Need a Good Embedded Example

2007-10-17 Thread Joshua J. Pearce
I am looking for an embedded IronPython 2.0 example beyond the simple hello world one I quoted before. What I want to know is: 1) How to get variable output from the script back to my c# code. 2) How to call scripts with multiple statements. 3) Do all variables need to be set on the script obje

Re: [IronPython] Announcement: Project to get some CPython C extensions running under IronPython

2007-10-17 Thread Curt Hagenlocher
On 10/17/07, Paolo Molaro <[EMAIL PROTECTED]> wrote: > > > The python API requires a couple dozen structure definitions plus a few > dozen dllimport declarations. This can be about 200 lines of trivial > to write declarative stuff. I'm having trouble understanding what you mean by this. Let's sa

Re: [IronPython] Announcement: Project to get some CPython C extensions running under IronPython

2007-10-17 Thread Giles Thomas
Sounds like I misunderstood you too, then :-) Paolo Molaro wrote: On 10/17/07 Giles Thomas wrote: I must admit I'd also misunderstood how a MC++ option would work, in the same way as Paolo Molaro, but this sounds really useful. Is there any I don't think I misunderstood anything:) I

Re: [IronPython] Announcement: Project to get some CPython C extensions running under IronPython

2007-10-17 Thread Paolo Molaro
On 10/17/07 Giles Thomas wrote: > I must admit I'd also misunderstood how a MC++ option would work, in the > same way as Paolo Molaro, but this sounds really useful. Is there any I don't think I misunderstood anything:) I said that there are two modules, the C one and the one that bridges the C

Re: [IronPython] Announcement: Project to get some CPython C extensions running under IronPython

2007-10-17 Thread Paolo Molaro
On 10/17/07 Curt Hagenlocher wrote: > On 10/17/07, Paolo Molaro <[EMAIL PROTECTED]> wrote: > > As python extensions use a C API, I don't see how Managed C++ > > would provide source compatibility. Managed C++ would be an ill-advided > > method, IMHO. > > [...] > > You'd have two components: the C A

Re: [IronPython] Announcement: Project to get some CPython C extensions running under IronPython

2007-10-17 Thread Curt Hagenlocher
On 10/17/07, Giles Thomas <[EMAIL PROTECTED]> wrote: > > > I must admit I'd also misunderstood how a MC++ option would work, in the > same way as Paolo Molaro, but this sounds really useful. Is there any > particular resource you'd recommend for learning more about it? Perhaps you should read th

Re: [IronPython] Announcement: Project to get some CPython C extensions running under IronPython

2007-10-17 Thread Giles Thomas
Davy Mitchell wrote: > Are Resolver Users looking to reuse their existing code in > spreadsheets or just have the same facilities? If the latter then SWIG > for Dotnet seems a better option than COM and is more Mono friendly. > I think having the same facilities is vital, but having the same in

Re: [IronPython] Announcement: Project to get some CPython C extensions running under IronPython

2007-10-17 Thread Giles Thomas
Curt Hagenlocher wrote: > I'd guess they share some internals -- why write the same thunking > code twice, after all. But their usage patterns are sufficiently > different that I'd argue the internals don't really matter. P/Invoke > requires you to declare everything explicitly, while the goal

Re: [IronPython] Announcement: Project to get some CPython C extensions running under IronPython

2007-10-17 Thread Curt Hagenlocher
On 10/17/07, Giles Thomas <[EMAIL PROTECTED]> wrote: > > Curt - how does MC++ relate to using P/Invoke? That is, is it P/Invoke > plus some clever packaging stuff to allow you to produce a single assembly > with both machine code and MSIL, or is there more to it than that? Or is it > something co

Re: [IronPython] Announcement: Project to get some CPython C extensions running under IronPython

2007-10-17 Thread Giles Thomas
Curt Hagenlocher wrote: On 10/17/07, *Paolo Molaro* <[EMAIL PROTECTED] > wrote: As python extensions use a C API, I don't see how Managed C++ would provide source compatibility. Managed C++ would be an ill-advided method, IMHO. [...] You'd have

Re: [IronPython] Announcement: Project to get some CPython C extensions running under IronPython

2007-10-17 Thread Curt Hagenlocher
On 10/17/07, Paolo Molaro <[EMAIL PROTECTED]> wrote: > As python extensions use a C API, I don't see how Managed C++ > would provide source compatibility. Managed C++ would be an ill-advided > method, IMHO. > [...] > You'd have two components: the C API headers and some C code (this is > required

Re: [IronPython] Announcement: Project to get some CPython C extensions running under IronPython

2007-10-17 Thread Paolo Molaro
On 10/15/07 Giles Thomas wrote: > Curt Hagenlocher wrote: > > My two cents would be this: using Managed C++, try for source > compatibility first. As python extensions use a C API, I don't see how Managed C++ would provide source compatibility. Managed C++ would be an ill-advided method, IMHO.