From no_reply at codeplex.com Sun Jul 1 10:06:47 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 1 Jul 2012 01:06:47 -0700 Subject: [Ironpython-users] IronPython, Daily Digest 6/30/2012 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New issue] Can't see IronPython on New Project window. 2. [Status update] Can't see IronPython on New Project window. 3. [New comment] Running google's cpplint ---------------------------------------------- ISSUES 1. [New issue] Can't see IronPython on New Project window. http://ironpython.codeplex.com/workitem/32903 User gencer has proposed the issue: "I can't see IronPython on "New Project" window. I have VS2010 installed on my machine. (Win7 x64) Also, i installed IronRuby 1.1.3. I tried both stable and RC versions. No project added to my list."----------------- 2. [Status update] Can't see IronPython on New Project window. http://ironpython.codeplex.com/workitem/32903 User slide_o_mix has updated the issue: Status has changed from Proposed to Closed with the following comment, "You need to install Python Tools for Visual Studio for Visual Studio support for Python (and IronPython). You can get it here http://pytools.codeplex.com/"----------------- 3. [New comment] Running google's cpplint http://ironpython.codeplex.com/workitem/32902 User slide_o_mix has commented on the issue: "Can you add the command line you are using as well as an example C++ file to run on that will show the issue?" ---------------------------------------------- ---------------------------------------------- You are receiving this email because you subscribed to notifications on CodePlex. To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jschementi at gmail.com Tue Jul 3 03:14:20 2012 From: jschementi at gmail.com (Jimmy Schementi) Date: Mon, 2 Jul 2012 21:14:20 -0400 Subject: [Ironpython-users] WP7 & Silverlight Support in IronPython In-Reply-To: References: Message-ID: I'd only support the latest released version of Silverlight, as if someone really needs to support an older version of Silverlight (some internal app, for example). So I'd vote for only SL5. There are tests for SL in Hosts/Silverlight ~js On Saturday, June 30, 2012, Jeff Hardy wrote: > Throwing some thoughts out there on future platform support: > > Given that Windows Phone 7 is basically dead in the water at this > point, it doesn't seem worth it to support it. I'm going to remove the > existing WP7 binaries, which don't work anyway, from 2.7.3. If anyone > is interested in supporting it I'll certainly consider patches, but I > won't be adding it back to the distributions without a fully committed > maintainer. > > Silverlight is also basically dead, but still has some users, so I > have no intention of removing it yet. However, I would like to know if > Silverlight 4 is still required - I'll leave it in for 2.7.3, but I'd > like to remove it in 2.7.4, if Silverlight 4 has mostly been replaced > by SL 5. That said, I would like someone to take over maintaining > Silverlight; there really isn't any testing of it, so I'm basically > taking it on faith that it still works, and I don't like that. If no > one is willing to maintain it, I'm going to consider removing it > entirely from 2.7.5. > > None of this is set in stone. I just want to get some discussion going. > > - Jeff > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users > -- ~Jimmy -------------- next part -------------- An HTML attachment was scrubbed... URL: From jschementi at gmail.com Tue Jul 3 03:17:12 2012 From: jschementi at gmail.com (Jimmy Schementi) Date: Mon, 2 Jul 2012 21:17:12 -0400 Subject: [Ironpython-users] WP7 & Silverlight Support in IronPython In-Reply-To: References: Message-ID: Didn't finish a sentence, updated below: On Monday, July 2, 2012, Jimmy Schementi wrote: > I'd only support the latest released version of Silverlight, as if someone > really needs to support an older version of Silverlight (some internal app, > for example), they can use older versions of IronPython. So I'd vote for > only SL5 at this point. > > There are tests for SL in Hosts/Silverlight > > ~js > > > On Saturday, June 30, 2012, Jeff Hardy wrote: > >> Throwing some thoughts out there on future platform support: >> >> Given that Windows Phone 7 is basically dead in the water at this >> point, it doesn't seem worth it to support it. I'm going to remove the >> existing WP7 binaries, which don't work anyway, from 2.7.3. If anyone >> is interested in supporting it I'll certainly consider patches, but I >> won't be adding it back to the distributions without a fully committed >> maintainer. >> >> Silverlight is also basically dead, but still has some users, so I >> have no intention of removing it yet. However, I would like to know if >> Silverlight 4 is still required - I'll leave it in for 2.7.3, but I'd >> like to remove it in 2.7.4, if Silverlight 4 has mostly been replaced >> by SL 5. That said, I would like someone to take over maintaining >> Silverlight; there really isn't any testing of it, so I'm basically >> taking it on faith that it still works, and I don't like that. If no >> one is willing to maintain it, I'm going to consider removing it >> entirely from 2.7.5. >> >> None of this is set in stone. I just want to get some discussion going. >> >> - Jeff >> _______________________________________________ >> Ironpython-users mailing list >> Ironpython-users at python.org >> http://mail.python.org/mailman/listinfo/ironpython-users >> > > > -- > ~Jimmy > -- ~Jimmy -------------- next part -------------- An HTML attachment was scrubbed... URL: From no_reply at codeplex.com Thu Jul 5 10:04:30 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 5 Jul 2012 01:04:30 -0700 Subject: [Ironpython-users] IronPython, Daily Digest 7/4/2012 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New comment] Add AssemblyFoldersEx paths for other platforms 2. [New comment] Source code encoding is not working correctly 3. [Status update] ImportError: No module named setuptools.command.easy_install 4. [Status update] poplib.POP3_SSL OutOfMemory Bug in IronPython 2.0.3 5. [New comment] Running google's cpplint 6. [New comment] Running google's cpplint 7. [New comment] Compiling with pyc.py for Silverlight 8. [Status update] float(unicode(some huge number)) should throw ValueError, not return inf 9. [New comment] _ssl.RAND_add(x, y) should throw TypeError when x=None 10. [Status update] Doctest is broken in IronPython 2.6 11. [Status update] Need a way to have a base class in an extension which is not exposed to Python 12. [Status update] Passing CodeContext argument implicitly to .NET methods broken 13. [Status update] [windows phone] passing parameters to functions 14. [Status update] [Dynamic][Python] StackOverflowException when loading a .py file on JPN OS with VS Pro + VSTS 15. [New comment] Allow application/zip mime-type for ZIP file script-tags ---------------------------------------------- ISSUES 1. [New comment] Add AssemblyFoldersEx paths for other platforms http://ironpython.codeplex.com/workitem/32749 User jdhardy has commented on the issue: "Fixed in b082ec7."----------------- 2. [New comment] Source code encoding is not working correctly http://ironpython.codeplex.com/workitem/18637 User slide_o_mix has commented on the issue: "I am unable to reproduce this issue on 2.7.3rc1"----------------- 3. [Status update] ImportError: No module named setuptools.command.easy_install http://ironpython.codeplex.com/workitem/22659 User slide_o_mix has updated the issue: Status has changed from Fixed to Closed with the following comment, "Fixed in 2.7.2"----------------- 4. [Status update] poplib.POP3_SSL OutOfMemory Bug in IronPython 2.0.3 http://ironpython.codeplex.com/workitem/25355 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "This works in 2.7.3rc1"----------------- 5. [New comment] Running google's cpplint http://ironpython.codeplex.com/workitem/32902 User slide_o_mix has commented on the issue: "I get the following error on line 259 of cpplint.py when I run it with the following: ipy64 cpplint.py --output=vs7 --filter=+whitespace somefile.cpp AttributeError: 'NoneType' object has no attribute 'match' Need more info from person who filed the issue."----------------- 6. [New comment] Running google's cpplint http://ironpython.codeplex.com/workitem/32902 User Jorch has commented on the issue: "I'll try to reproduce it with a file I can share and upload it later. I'll also add more details."----------------- 7. [New comment] Compiling with pyc.py for Silverlight http://ironpython.codeplex.com/workitem/25680 User slide_o_mix has commented on the issue: "Can someone add a test case?"----------------- 8. [Status update] float(unicode(some huge number)) should throw ValueError, not return inf http://ironpython.codeplex.com/workitem/24383 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "Comment says not a bug"----------------- 9. [New comment] _ssl.RAND_add(x, y) should throw TypeError when x=None http://ironpython.codeplex.com/workitem/24276 User slide_o_mix has commented on the issue: "Fixed in b21758c"----------------- 10. [Status update] Doctest is broken in IronPython 2.6 http://ironpython.codeplex.com/workitem/24392 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "Works on 2.7.3rc1"----------------- 11. [Status update] Need a way to have a base class in an extension which is not exposed to Python http://ironpython.codeplex.com/workitem/28891 User slide_o_mix has updated the issue: Status has changed from Proposed to Closed with the following comment, "PythonHiddenBaseClass is used for this purpose."----------------- 12. [Status update] Passing CodeContext argument implicitly to .NET methods broken http://ironpython.codeplex.com/workitem/29773 User slide_o_mix has updated the issue: Status has changed from Proposed to Closed with the following comment, "This works fine when compiling the assembly with IronPython 2.7 and running under 2.7.3rc1 "----------------- 13. [Status update] [windows phone] passing parameters to functions http://ironpython.codeplex.com/workitem/32703 User slide_o_mix has updated the issue: Status has changed from Proposed to Closed with the following comment, "WP7 will no longer be supported."----------------- 14. [Status update] [Dynamic][Python] StackOverflowException when loading a .py file on JPN OS with VS Pro + VSTS http://ironpython.codeplex.com/workitem/24114 User slide_o_mix has updated the issue: Status has changed from Active to Closed with the following comment, "Internal MS reproduction."----------------- 15. [New comment] Allow application/zip mime-type for ZIP file script-tags http://ironpython.codeplex.com/workitem/26676 User slide_o_mix has commented on the issue: "Fixed in 67a18d2" ---------------------------------------------- ---------------------------------------------- You are receiving this email because you subscribed to notifications on CodePlex. To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From no_reply at codeplex.com Fri Jul 6 15:26:21 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 6 Jul 2012 06:26:21 -0700 Subject: [Ironpython-users] IronPython, Daily Digest 7/5/2012 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New comment] Compiling with pyc.py for Silverlight 2. [New comment] Compiling with pyc.py for Silverlight ---------------------------------------------- ISSUES 1. [New comment] Compiling with pyc.py for Silverlight http://ironpython.codeplex.com/workitem/25680 User jdhardy has commented on the issue: "This is going to be a huge pain, because pyc.py uses RefEmit, and RE is limited to generating assemblies for the current runtime only. To generate assemblies for different runtimes, it'll have to use IKVM.Reflection or something similar. On the plus side, it'll allow generating assemblies for Android and Windows RT as well."----------------- 2. [New comment] Compiling with pyc.py for Silverlight http://ironpython.codeplex.com/workitem/25680 User slide_o_mix has commented on the issue: "I've thought about using IKVM.Reflection, I hadn't looked at its license to see if there are any issues with putting it into the IP repo and distributing it." ---------------------------------------------- ---------------------------------------------- You are receiving this email because you subscribed to notifications on CodePlex. To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From slide.o.mix at gmail.com Fri Jul 6 16:34:02 2012 From: slide.o.mix at gmail.com (Slide) Date: Fri, 6 Jul 2012 07:34:02 -0700 Subject: [Ironpython-users] pyc port to IKVM.Reflection Message-ID: I ported the pyc.py script to use IKVM.Reflection instead of System.Reflection.Emit. It turns out some of the things (win32icon) are MUCH easier to do with IKVM.Reflection. I attached the ported version to [1] if people would like to give it a try. Let me know if you see any issues and if not, I'll go ahead and commit this version. Please don't file issues on CodePlex for this version since its not part of the codebase yet. Please just drop me an email with any problems you run into. There are lots more things that can be done with IKVM.Reflection (compile for different runtimes, unmanaged resources, etc) that are MUCH harder (or impossible) to do with System.Reflection.Emit, so hopefully we can get this included in one of the next releases. Thanks, slide 1 - http://ironpython.codeplex.com/workitem/22138 -- Website: http://earl-of-code.com From slide.o.mix at gmail.com Fri Jul 6 16:35:46 2012 From: slide.o.mix at gmail.com (Slide) Date: Fri, 6 Jul 2012 07:35:46 -0700 Subject: [Ironpython-users] pyc port to IKVM.Reflection In-Reply-To: References: Message-ID: As a quick follow-up, here is the license for IKVM, I think we can safely include it and distribute it, but IANAL Copyright (C) 2002-2012 Jeroen Frijters This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. Jeroen Frijters jeroen at frijters.net On Fri, Jul 6, 2012 at 7:34 AM, Slide wrote: > I ported the pyc.py script to use IKVM.Reflection instead of > System.Reflection.Emit. It turns out some of the things (win32icon) > are MUCH easier to do with IKVM.Reflection. I attached the ported > version to [1] if people would like to give it a try. Let me know if > you see any issues and if not, I'll go ahead and commit this version. > Please don't file issues on CodePlex for this version since its not > part of the codebase yet. Please just drop me an email with any > problems you run into. There are lots more things that can be done > with IKVM.Reflection (compile for different runtimes, unmanaged > resources, etc) that are MUCH harder (or impossible) to do with > System.Reflection.Emit, so hopefully we can get this included in one > of the next releases. > > Thanks, > > slide > > 1 - http://ironpython.codeplex.com/workitem/22138 > > -- > Website: http://earl-of-code.com -- Website: http://earl-of-code.com From jdhardy at gmail.com Fri Jul 6 17:24:07 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Fri, 6 Jul 2012 08:24:07 -0700 Subject: [Ironpython-users] pyc port to IKVM.Reflection In-Reply-To: References: Message-ID: Apparently I should think out loud on the issue tracker more often :) I haven't looked, but I'm glad to hear it was easy. I'm going to think out loud for a bit, but I promise it's related :). One limitation with pyc.py is that it doesn't generate assemblies that can be consumed from other .NET languages directly. Using __clrtype__ IronPython can generate assemblies at runtime that can be consumed, but not ahead of time (to be honest, I don't really understand the use case for that - Dino?). However, using __clrtype__ requires clrtype.py, which is floating around unsupported somewhere. Ultimately, I'd like to unify the two static compilers (runtime and AOT), keeping the __clrtype__ mechanism, but also letting pyc.py create consumable assemblies. My initial thought was to port both clrtype.py and pyc.py code-generation parts to C# (say IronPython.Compiler), put the clrtype helpers in the clr module, and have pyc.py just be a frontend to that assembly to handle command-line options and such. The tricky part is recognizing when to generate a CLR class from just the static code. A thought I had (which is a bit hackish) was to have the static compiler recognize a few special names and switch to generating a CLS-compliant class: import clr class Foo(clr.object): # or clr.struct, or clr.interface @clr.accepts(int) @clr.returns(str) def bar(self, x): pass In Python 3, it become a bit cleaner: import clr class Foo(clr.object): # or clr.struct, or clr.interface def bar(self, x : int) -> str: pass I still haven't thought about generics, or subclassing .NET classes, or implementing interfaces, or anything like that - I'm kinda worried to see how deep the rabbit hole goes :|. All of the those are going to be necessary to be of much use. Another option is to introduce new keywords, like clrclass/clrstruct/clrinterface. The code would no longer be "true" Python, but since you're inheriting from a .NET class, it's unlikely it would run on any other Python anyway. IT also makes it crystal clear to the compiler what you want. I doubt I'd want to introduce that into the 2.7-series though; it would likely be 3.0 only. - Jeff On Fri, Jul 6, 2012 at 7:34 AM, Slide wrote: > I ported the pyc.py script to use IKVM.Reflection instead of > System.Reflection.Emit. It turns out some of the things (win32icon) > are MUCH easier to do with IKVM.Reflection. I attached the ported > version to [1] if people would like to give it a try. Let me know if > you see any issues and if not, I'll go ahead and commit this version. > Please don't file issues on CodePlex for this version since its not > part of the codebase yet. Please just drop me an email with any > problems you run into. There are lots more things that can be done > with IKVM.Reflection (compile for different runtimes, unmanaged > resources, etc) that are MUCH harder (or impossible) to do with > System.Reflection.Emit, so hopefully we can get this included in one > of the next releases. > > Thanks, > > slide > > 1 - http://ironpython.codeplex.com/workitem/22138 > > -- > Website: http://earl-of-code.com > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users From jdhardy at gmail.com Fri Jul 6 17:28:12 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Fri, 6 Jul 2012 08:28:12 -0700 Subject: [Ironpython-users] WP7 & Silverlight Support in IronPython In-Reply-To: <4519.83.234.184.1.1341036310.squirrel@www.sibmail.com> References: <4519.83.234.184.1.1341036310.squirrel@www.sibmail.com> Message-ID: On Fri, Jun 29, 2012 at 11:05 PM, wrote: > Silverlight is very necessary. Would you be fine with SL5 only, as Jimmy suggested? Also, how necessary is it that IronPython 3 support it? I don't see SL having much more takeup from now on, so I'm fine with supporting SL5 on 2.7 but dropping it from the 3.0 series (keeping in mind 3.0 is probably a year away). That would leave 3.0 supported on desktop, WinRT (Win8 + WinPhone8), Android, and maybe iOS. Basically, platforms with a future, and WinRT. ;) - Jeff From jdhardy at gmail.com Fri Jul 6 17:29:35 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Fri, 6 Jul 2012 08:29:35 -0700 Subject: [Ironpython-users] pyc port to IKVM.Reflection In-Reply-To: References: Message-ID: NAL as well, but I'm pretty sure Mono includes it in their repo, so we should be OK. - Jeff On Fri, Jul 6, 2012 at 7:35 AM, Slide wrote: > As a quick follow-up, here is the license for IKVM, I think we can > safely include it and distribute it, but IANAL > > Copyright (C) 2002-2012 Jeroen Frijters > > This software is provided 'as-is', without any express or implied > warranty. In no event will the authors be held liable for any damages > arising from the use of this software. > > Permission is granted to anyone to use this software for any purpose, > including commercial applications, and to alter it and redistribute it > freely, subject to the following restrictions: > > 1. The origin of this software must not be misrepresented; you must not > claim that you wrote the original software. If you use this software > in a product, an acknowledgment in the product documentation would be > appreciated but is not required. > 2. Altered source versions must be plainly marked as such, and must not be > misrepresented as being the original software. > 3. This notice may not be removed or altered from any source distribution. > > Jeroen Frijters > jeroen at frijters.net > > > > On Fri, Jul 6, 2012 at 7:34 AM, Slide wrote: >> I ported the pyc.py script to use IKVM.Reflection instead of >> System.Reflection.Emit. It turns out some of the things (win32icon) >> are MUCH easier to do with IKVM.Reflection. I attached the ported >> version to [1] if people would like to give it a try. Let me know if >> you see any issues and if not, I'll go ahead and commit this version. >> Please don't file issues on CodePlex for this version since its not >> part of the codebase yet. Please just drop me an email with any >> problems you run into. There are lots more things that can be done >> with IKVM.Reflection (compile for different runtimes, unmanaged >> resources, etc) that are MUCH harder (or impossible) to do with >> System.Reflection.Emit, so hopefully we can get this included in one >> of the next releases. >> >> Thanks, >> >> slide >> >> 1 - http://ironpython.codeplex.com/workitem/22138 >> >> -- >> Website: http://earl-of-code.com > > > > -- > Website: http://earl-of-code.com > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users From slide.o.mix at gmail.com Fri Jul 6 17:31:45 2012 From: slide.o.mix at gmail.com (Slide) Date: Fri, 6 Jul 2012 08:31:45 -0700 Subject: [Ironpython-users] pyc port to IKVM.Reflection In-Reply-To: References: Message-ID: To be honest, some of the stuff in pyc would be a little easier in C# (which is strange I know), so creating IronPython.Compiler (or something similar) would be pretty nice for upkeep reasons. I would recommend we stick with the nomenclature that exists and have something like ipyc.exe for the executable, but this may be jumping the gun. I can take a stab at putting something together for that based on what exists in pyc.py. On Fri, Jul 6, 2012 at 8:24 AM, Jeff Hardy wrote: > Apparently I should think out loud on the issue tracker more often :) > I haven't looked, but I'm glad to hear it was easy. I'm going to think > out loud for a bit, but I promise it's related :). > > One limitation with pyc.py is that it doesn't generate assemblies that > can be consumed from other .NET languages directly. Using __clrtype__ > IronPython can generate assemblies at runtime that can be consumed, > but not ahead of time (to be honest, I don't really understand the use > case for that - Dino?). However, using __clrtype__ requires > clrtype.py, which is floating around unsupported somewhere. > > Ultimately, I'd like to unify the two static compilers (runtime and > AOT), keeping the __clrtype__ mechanism, but also letting pyc.py > create consumable assemblies. > > My initial thought was to port both clrtype.py and pyc.py > code-generation parts to C# (say IronPython.Compiler), put the clrtype > helpers in the clr module, and have pyc.py just be a frontend to that > assembly to handle command-line options and such. > > The tricky part is recognizing when to generate a CLR class from just > the static code. A thought I had (which is a bit hackish) was to have > the static compiler recognize a few special names and switch to > generating a CLS-compliant class: > > import clr > > class Foo(clr.object): # or clr.struct, or clr.interface > @clr.accepts(int) > @clr.returns(str) > def bar(self, x): > pass > > In Python 3, it become a bit cleaner: > > import clr > > class Foo(clr.object): # or clr.struct, or clr.interface > def bar(self, x : int) -> str: > pass > > I still haven't thought about generics, or subclassing .NET classes, > or implementing interfaces, or anything like that - I'm kinda worried > to see how deep the rabbit hole goes :|. All of the those are going to > be necessary to be of much use. > > Another option is to introduce new keywords, like > clrclass/clrstruct/clrinterface. The code would no longer be "true" > Python, but since you're inheriting from a .NET class, it's unlikely > it would run on any other Python anyway. IT also makes it crystal > clear to the compiler what you want. I doubt I'd want to introduce > that into the 2.7-series though; it would likely be 3.0 only. > > - Jeff > > On Fri, Jul 6, 2012 at 7:34 AM, Slide wrote: >> I ported the pyc.py script to use IKVM.Reflection instead of >> System.Reflection.Emit. It turns out some of the things (win32icon) >> are MUCH easier to do with IKVM.Reflection. I attached the ported >> version to [1] if people would like to give it a try. Let me know if >> you see any issues and if not, I'll go ahead and commit this version. >> Please don't file issues on CodePlex for this version since its not >> part of the codebase yet. Please just drop me an email with any >> problems you run into. There are lots more things that can be done >> with IKVM.Reflection (compile for different runtimes, unmanaged >> resources, etc) that are MUCH harder (or impossible) to do with >> System.Reflection.Emit, so hopefully we can get this included in one >> of the next releases. >> >> Thanks, >> >> slide >> >> 1 - http://ironpython.codeplex.com/workitem/22138 >> >> -- >> Website: http://earl-of-code.com >> _______________________________________________ >> Ironpython-users mailing list >> Ironpython-users at python.org >> http://mail.python.org/mailman/listinfo/ironpython-users -- Website: http://earl-of-code.com From rome at Wintellect.com Fri Jul 6 18:20:18 2012 From: rome at Wintellect.com (Keith Rome) Date: Fri, 6 Jul 2012 16:20:18 +0000 Subject: [Ironpython-users] WP7 & Silverlight Support in IronPython In-Reply-To: References: <4519.83.234.184.1.1341036310.squirrel@www.sibmail.com> Message-ID: <4C554C3A47C5024ABDE00E94DA17BC4D0F8E3DD2@SN2PRD0710MB396.namprd07.prod.outlook.com> Silverlight may be dead in Redmond, but Microsoft's customers were somewhat blind-sided by that recent strategy change - Build was only 8 months ago. For many customers, they don't really have a choice but to keep using SL. They bought into what was being pitched to them for years - the ability to run managed code in a browser - and Microsoft didn't give an alternative to that when it announced the early death of SL. I haven't seen any new projects since October that target SL, but I also haven't seen any cases where ongoing SL projects were abandoned either. For the project where we are using Iron Python with our client, SL support is pretty important for us for at least the one to two year timeframe, likely longer. If IP3 were to drop SL support, then we would not be able to move to it. In our case, we have a fairly sizable industry-vertical application that compiles to both WPF and Silverlight runtimes (plus some back-end processing services). Some customers use only the WPF front-end, others use both. Python scripts run in both the WPF and SL UI environment, as well as the back-end environment. It is therefore important for all to be synchronized to the same IP build. SL5 only (dropping SL4) should be OK, but dropping all SL support will put us in a very serious predicament. We can't just chop scripting support for the SL front-end and expect our users to get over it. So if v3 doesn't support SL, then we probably won't be able to move to it. This is further complicated because we are also exploring concepts for supporting the Android, WinRT and (perhaps) iOS platforms - and I would be very worried about 2.7's stability on those once v3 becomes the norm. Keith Rome Senior Consultant and Architect MCPD-EAD, MCSD, MCDBA, MCTS-WPF, MCTS-TFS, MCTS-WSS Wintellect | 770.617.4016 | krome at wintellect.com www.wintellect.com -----Original Message----- From: ironpython-users-bounces+rome=wintellect.com at python.org [mailto:ironpython-users-bounces+rome=wintellect.com at python.org] On Behalf Of Jeff Hardy Sent: Friday, July 06, 2012 11:28 AM To: sepatan at sibmail.com Cc: ironpython-users at python.org Subject: Re: [Ironpython-users] WP7 & Silverlight Support in IronPython On Fri, Jun 29, 2012 at 11:05 PM, wrote: > Silverlight is very necessary. Would you be fine with SL5 only, as Jimmy suggested? Also, how necessary is it that IronPython 3 support it? I don't see SL having much more takeup from now on, so I'm fine with supporting SL5 on 2.7 but dropping it from the 3.0 series (keeping in mind 3.0 is probably a year away). That would leave 3.0 supported on desktop, WinRT (Win8 + WinPhone8), Android, and maybe iOS. Basically, platforms with a future, and WinRT. ;) - Jeff _______________________________________________ Ironpython-users mailing list Ironpython-users at python.org http://mail.python.org/mailman/listinfo/ironpython-users From slide.o.mix at gmail.com Fri Jul 6 18:40:36 2012 From: slide.o.mix at gmail.com (Slide) Date: Fri, 6 Jul 2012 09:40:36 -0700 Subject: [Ironpython-users] pyc port to IKVM.Reflection In-Reply-To: References: Message-ID: I'm assuming this is the latest and greatest? https://github.com/IronLanguages/main/blob/master/Languages/IronPython/Samples/ClrType/clrtype.py On Fri, Jul 6, 2012 at 8:24 AM, Jeff Hardy wrote: > Apparently I should think out loud on the issue tracker more often :) > I haven't looked, but I'm glad to hear it was easy. I'm going to think > out loud for a bit, but I promise it's related :). > > One limitation with pyc.py is that it doesn't generate assemblies that > can be consumed from other .NET languages directly. Using __clrtype__ > IronPython can generate assemblies at runtime that can be consumed, > but not ahead of time (to be honest, I don't really understand the use > case for that - Dino?). However, using __clrtype__ requires > clrtype.py, which is floating around unsupported somewhere. > > Ultimately, I'd like to unify the two static compilers (runtime and > AOT), keeping the __clrtype__ mechanism, but also letting pyc.py > create consumable assemblies. > > My initial thought was to port both clrtype.py and pyc.py > code-generation parts to C# (say IronPython.Compiler), put the clrtype > helpers in the clr module, and have pyc.py just be a frontend to that > assembly to handle command-line options and such. > > The tricky part is recognizing when to generate a CLR class from just > the static code. A thought I had (which is a bit hackish) was to have > the static compiler recognize a few special names and switch to > generating a CLS-compliant class: > > import clr > > class Foo(clr.object): # or clr.struct, or clr.interface > @clr.accepts(int) > @clr.returns(str) > def bar(self, x): > pass > > In Python 3, it become a bit cleaner: > > import clr > > class Foo(clr.object): # or clr.struct, or clr.interface > def bar(self, x : int) -> str: > pass > > I still haven't thought about generics, or subclassing .NET classes, > or implementing interfaces, or anything like that - I'm kinda worried > to see how deep the rabbit hole goes :|. All of the those are going to > be necessary to be of much use. > > Another option is to introduce new keywords, like > clrclass/clrstruct/clrinterface. The code would no longer be "true" > Python, but since you're inheriting from a .NET class, it's unlikely > it would run on any other Python anyway. IT also makes it crystal > clear to the compiler what you want. I doubt I'd want to introduce > that into the 2.7-series though; it would likely be 3.0 only. > > - Jeff > > On Fri, Jul 6, 2012 at 7:34 AM, Slide wrote: >> I ported the pyc.py script to use IKVM.Reflection instead of >> System.Reflection.Emit. It turns out some of the things (win32icon) >> are MUCH easier to do with IKVM.Reflection. I attached the ported >> version to [1] if people would like to give it a try. Let me know if >> you see any issues and if not, I'll go ahead and commit this version. >> Please don't file issues on CodePlex for this version since its not >> part of the codebase yet. Please just drop me an email with any >> problems you run into. There are lots more things that can be done >> with IKVM.Reflection (compile for different runtimes, unmanaged >> resources, etc) that are MUCH harder (or impossible) to do with >> System.Reflection.Emit, so hopefully we can get this included in one >> of the next releases. >> >> Thanks, >> >> slide >> >> 1 - http://ironpython.codeplex.com/workitem/22138 >> >> -- >> Website: http://earl-of-code.com >> _______________________________________________ >> Ironpython-users mailing list >> Ironpython-users at python.org >> http://mail.python.org/mailman/listinfo/ironpython-users -- Website: http://earl-of-code.com From jdhardy at gmail.com Fri Jul 6 19:22:36 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Fri, 6 Jul 2012 10:22:36 -0700 Subject: [Ironpython-users] pyc port to IKVM.Reflection In-Reply-To: References: Message-ID: On Fri, Jul 6, 2012 at 9:40 AM, Slide wrote: > I'm assuming this is the latest and greatest? > > https://github.com/IronLanguages/main/blob/master/Languages/IronPython/Samples/ClrType/clrtype.py I believe so. The latest I've found, anyway. - Jeff From vernondcole at gmail.com Fri Jul 6 19:27:15 2012 From: vernondcole at gmail.com (Vernon Cole) Date: Fri, 6 Jul 2012 11:27:15 -0600 Subject: [Ironpython-users] WP7 & Silverlight Support in IronPython In-Reply-To: <4C554C3A47C5024ABDE00E94DA17BC4D0F8E3DD2@SN2PRD0710MB396.namprd07.prod.outlook.com> References: <4519.83.234.184.1.1341036310.squirrel@www.sibmail.com> <4C554C3A47C5024ABDE00E94DA17BC4D0F8E3DD2@SN2PRD0710MB396.namprd07.prod.outlook.com> Message-ID: I am really sorry to hear about this happening. The combination of IronPython and Silver(Moon)light was going to be (I thought) my ticket to writing Python code rather than Javascript for browser based code. So: My question for the group -- is Jython a viable alternative? Do we think that SL5 will not continue to be shipped for a very long time? I'm thinking that SL5 is still the best option for maintainable code on a browser, and we should continue to support it. -- Vernon On Fri, Jul 6, 2012 at 10:20 AM, Keith Rome wrote: > Silverlight may be dead in Redmond, but Microsoft's customers were > somewhat blind-sided by that recent strategy change - Build was only 8 > months ago. For many customers, they don't really have a choice but to keep > using SL. They bought into what was being pitched to them for years - the > ability to run managed code in a browser - and Microsoft didn't give an > alternative to that when it announced the early death of SL. I haven't seen > any new projects since October that target SL, but I also haven't seen any > cases where ongoing SL projects were abandoned either. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jschementi at gmail.com Fri Jul 6 19:37:10 2012 From: jschementi at gmail.com (Jimmy Schementi) Date: Fri, 6 Jul 2012 13:37:10 -0400 Subject: [Ironpython-users] pyc port to IKVM.Reflection In-Reply-To: References: Message-ID: <-7483682011744694088@unknownmsgid> > One limitation with pyc.py is that it doesn't generate assemblies that > can be consumed from other .NET languages directly. Using __clrtype__ > IronPython can generate assemblies at runtime that can be consumed, > but not ahead of time (to be honest, I don't really understand the use > case for that - Dino?). However, using __clrtype__ requires > clrtype.py, which is floating around unsupported somewhere. pyc in IronPython does as much compilation as possible ahead of time, but because IronPython types don't map to static CLR types, it doesn't generate the assembly to have matching static types. I'm not sure how easy it is to do, as I think you'd basically be making every Python type a built-in. Makes pyc closer to a static compiler, which isn't really the intention. Plus, in true Python form, it seems this type of control over the CLR type should be explicit (with clrtype.py) rather than just happen for you when you run your code through pyc.py. The use case for __clrtype__ is to emit specific static type information from IronPython, but not require generating an assembly before. For example, .NET attributes require an concrete CLR type or method for the attribute to be applied to. However, IronPython does not guarantee that each Python type or method maps to a static CLR type/method, as emitting the static types are expensive and cannot be disposed. __clrtype__ provides the ability to control the CLR type for a specific Python class. clrtype.py contains a bunch of helpers intended to make all this easier; generating a CLR type at runtime, adding methods to it, adding attributes, etc. This applies to more than just .NET attributes, though that was the most requested feature. It enables Data Binding, or any code which uses Reflection in its application model, like how ASP.NET MVC routes a HTTP request to a specific method. ~Jimmy On Jul 6, 2012, at 11:24 AM, Jeff Hardy wrote: > One limitation with pyc.py is that it doesn't generate assemblies that > can be consumed from other .NET languages directly. Using __clrtype__ > IronPython can generate assemblies at runtime that can be consumed, > but not ahead of time (to be honest, I don't really understand the use > case for that - Dino?). However, using __clrtype__ requires > clrtype.py, which is floating around unsupported somewhere. From jdhardy at gmail.com Fri Jul 6 19:40:57 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Fri, 6 Jul 2012 10:40:57 -0700 Subject: [Ironpython-users] WP7 & Silverlight Support in IronPython In-Reply-To: References: <4519.83.234.184.1.1341036310.squirrel@www.sibmail.com> <4C554C3A47C5024ABDE00E94DA17BC4D0F8E3DD2@SN2PRD0710MB396.namprd07.prod.outlook.com> Message-ID: On Fri, Jul 6, 2012 at 10:27 AM, Vernon Cole wrote: > I am really sorry to hear about this happening. The combination of > IronPython and Silver(Moon)light was going to be (I thought) my ticket to > writing Python code rather than Javascript for browser based code. So: My > question for the group -- is Jython a viable alternative? Do we think that > SL5 will not continue to be shipped for a very long time? I'm thinking that > SL5 is still the best option for maintainable code on a browser, and we > should continue to support it. Just to be clear, nothing has been decided yet. I do appreciate the concern of those who bet on SL only to get blindsided by MS's internal turf wars. However, each additional platform that is supported requires a fair bit of effort, especially in getting the test suites (which are a mess right now) up to date. My interests are on the desktop and Android, and maybe WinRT. Even though SL is a marginal increase over that, it's still something, and I just don't have the time or interest to do it. I'll leave it in future 2.7 releases (dropping SL4 but keeping SL5), but I'm not sure about 3.0. 3.0 is enough a break anyway that dropping old stuff might be possible. Ultimately, I'll leave it up to the community: someone(s) will have to commit to maintaining the SL port in 3.0, including coming up with and implementing a test strategy, watching for build failures, etc. Basically, being the people to talk to about IronPython/SL. - Jeff From jschementi at gmail.com Fri Jul 6 19:47:10 2012 From: jschementi at gmail.com (Jimmy Schementi) Date: Fri, 6 Jul 2012 13:47:10 -0400 Subject: [Ironpython-users] WP7 & Silverlight Support in IronPython In-Reply-To: References: <4519.83.234.184.1.1341036310.squirrel@www.sibmail.com> <4C554C3A47C5024ABDE00E94DA17BC4D0F8E3DD2@SN2PRD0710MB396.namprd07.prod.outlook.com> Message-ID: <-1627718716907408876@unknownmsgid> To reiterate Jeff's last point, if you'd really like to see something continue to be supported, volunteering to help support it is the best way to ensure that. ~Jimmy On Jul 6, 2012, at 1:41 PM, Jeff Hardy wrote: > On Fri, Jul 6, 2012 at 10:27 AM, Vernon Cole wrote: >> I am really sorry to hear about this happening. The combination of >> IronPython and Silver(Moon)light was going to be (I thought) my ticket to >> writing Python code rather than Javascript for browser based code. So: My >> question for the group -- is Jython a viable alternative? Do we think that >> SL5 will not continue to be shipped for a very long time? I'm thinking that >> SL5 is still the best option for maintainable code on a browser, and we >> should continue to support it. > > Just to be clear, nothing has been decided yet. I do appreciate the > concern of those who bet on SL only to get blindsided by MS's internal > turf wars. > > However, each additional platform that is supported requires a fair > bit of effort, especially in getting the test suites (which are a mess > right now) up to date. My interests are on the desktop and Android, > and maybe WinRT. Even though SL is a marginal increase over that, it's > still something, and I just don't have the time or interest to do it. > I'll leave it in future 2.7 releases (dropping SL4 but keeping SL5), > but I'm not sure about 3.0. 3.0 is enough a break anyway that dropping > old stuff might be possible. > > Ultimately, I'll leave it up to the community: someone(s) will have to > commit to maintaining the SL port in 3.0, including coming up with and > implementing a test strategy, watching for build failures, etc. > Basically, being the people to talk to about IronPython/SL. > > - Jeff > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users From dinov at microsoft.com Fri Jul 6 20:40:34 2012 From: dinov at microsoft.com (Dino Viehland) Date: Fri, 6 Jul 2012 18:40:34 +0000 Subject: [Ironpython-users] pyc port to IKVM.Reflection In-Reply-To: References: Message-ID: <6757ED2748BC0A43B9F3E4DA32D65AB001298229@CH1PRD0310MB357.namprd03.prod.outlook.com> The use case for __clrtype__ is that sometimes a .NET class expects a real type - either because there need to be attributes placed on it, or it needs a normal constructor which doesn't take a PythonType object, or for some other oddity of .NET... At the same time __clrtype__ is exposing the fact that there's a .NET type that's associated with each Python type and it lets you really customize it in anyway that you can dream about via your metaclass. I think one of the main scenarios in mind was frameworks like WCF but that didn't seem to go too far (Jimmy apparently beat me to the punch and mentions some other ones). The @clr.accepts/@clr.returns way was how we did this in IronPython 1.0/1.1 - I think these got used for both the static compilation feature (which was implemented in NewTypeMaker.cs and was there to support ASP.NET) as well as our round tripping via the WinForms designer. But the annotations are much nicer, I would almost think we could get away w/ supporting them before 3.x. Another way to approach this (and maybe this is what you're already thinking from an implementation stand point, maybe not) would be just making an easy way to define the fa?ade for Python modules/classes. That is everything gets compiled normally but we generate some wrapper classes automatically. The wrapper classes could use the hosting APIs to import the various modules and expose them as .NET classes. You could even imagine that the wrapper classes are generated from some non-turing complete language, but we could also have a script which would generate them from a .py file automatically and allow you to tweak them. Finally throw in some ILMerge tools and we have a pretty decent Python->.NET DLL/EXE story. > -----Original Message----- > From: ironpython-users-bounces+dinov=microsoft.com at python.org > [mailto:ironpython-users-bounces+dinov=microsoft.com at python.org] On > Behalf Of Jeff Hardy > Sent: Friday, July 06, 2012 8:24 AM > To: Slide > Cc: ironpython-users at python.org > Subject: Re: [Ironpython-users] pyc port to IKVM.Reflection > > Apparently I should think out loud on the issue tracker more often :) I haven't > looked, but I'm glad to hear it was easy. I'm going to think out loud for a bit, > but I promise it's related :). > > One limitation with pyc.py is that it doesn't generate assemblies that can be > consumed from other .NET languages directly. Using __clrtype__ IronPython > can generate assemblies at runtime that can be consumed, but not ahead of > time (to be honest, I don't really understand the use case for that - Dino?). > However, using __clrtype__ requires clrtype.py, which is floating around > unsupported somewhere. > > Ultimately, I'd like to unify the two static compilers (runtime and AOT), > keeping the __clrtype__ mechanism, but also letting pyc.py create > consumable assemblies. > > My initial thought was to port both clrtype.py and pyc.py code-generation > parts to C# (say IronPython.Compiler), put the clrtype helpers in the clr > module, and have pyc.py just be a frontend to that assembly to handle > command-line options and such. > > The tricky part is recognizing when to generate a CLR class from just the > static code. A thought I had (which is a bit hackish) was to have the static > compiler recognize a few special names and switch to generating a CLS- > compliant class: > > import clr > > class Foo(clr.object): # or clr.struct, or clr.interface > @clr.accepts(int) > @clr.returns(str) > def bar(self, x): > pass > > In Python 3, it become a bit cleaner: > > import clr > > class Foo(clr.object): # or clr.struct, or clr.interface > def bar(self, x : int) -> str: > pass > > I still haven't thought about generics, or subclassing .NET classes, or > implementing interfaces, or anything like that - I'm kinda worried to see how > deep the rabbit hole goes :|. All of the those are going to be necessary to be > of much use. > > Another option is to introduce new keywords, like > clrclass/clrstruct/clrinterface. The code would no longer be "true" > Python, but since you're inheriting from a .NET class, it's unlikely it would run > on any other Python anyway. IT also makes it crystal clear to the compiler > what you want. I doubt I'd want to introduce that into the 2.7-series though; > it would likely be 3.0 only. > > - Jeff > > On Fri, Jul 6, 2012 at 7:34 AM, Slide wrote: > > I ported the pyc.py script to use IKVM.Reflection instead of > > System.Reflection.Emit. It turns out some of the things (win32icon) > > are MUCH easier to do with IKVM.Reflection. I attached the ported > > version to [1] if people would like to give it a try. Let me know if > > you see any issues and if not, I'll go ahead and commit this version. > > Please don't file issues on CodePlex for this version since its not > > part of the codebase yet. Please just drop me an email with any > > problems you run into. There are lots more things that can be done > > with IKVM.Reflection (compile for different runtimes, unmanaged > > resources, etc) that are MUCH harder (or impossible) to do with > > System.Reflection.Emit, so hopefully we can get this included in one > > of the next releases. > > > > Thanks, > > > > slide > > > > 1 - http://ironpython.codeplex.com/workitem/22138 > > > > -- > > Website: http://earl-of-code.com > > _______________________________________________ > > Ironpython-users mailing list > > Ironpython-users at python.org > > http://mail.python.org/mailman/listinfo/ironpython-users > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users > > From jdhardy at gmail.com Fri Jul 6 21:05:05 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Fri, 6 Jul 2012 12:05:05 -0700 Subject: [Ironpython-users] pyc port to IKVM.Reflection In-Reply-To: <6757ED2748BC0A43B9F3E4DA32D65AB001298229@CH1PRD0310MB357.namprd03.prod.outlook.com> References: <6757ED2748BC0A43B9F3E4DA32D65AB001298229@CH1PRD0310MB357.namprd03.prod.outlook.com> Message-ID: On Fri, Jul 6, 2012 at 11:40 AM, Dino Viehland wrote: > The use case for __clrtype__ is that sometimes a .NET class expects a real type - > either because there need to be attributes placed on it, or it needs a normal > constructor which doesn't take a PythonType object, or for some other oddity of > .NET... At the same time __clrtype__ is exposing the fact that there's a .NET type > that's associated with each Python type and it lets you really customize it in > anyway that you can dream about via your metaclass. I think one of the main > scenarios in mind was frameworks like WCF but that didn't seem to go too > far (Jimmy apparently beat me to the punch and mentions some other ones). I actually forgot about attributes. That is pretty important :). > > The @clr.accepts/@clr.returns way was how we did this in IronPython 1.0/1.1 - I > think these got used for both the static compilation feature (which was implemented > in NewTypeMaker.cs and was there to support ASP.NET) as well as our round > tripping via the WinForms designer. But the annotations are much nicer, I would > almost think we could get away w/ supporting them before 3.x. I'm not sure I want to down that route, except as a prototype. IronPython already has the biggest breaking change (Unicode), so porting from 2.7 -> 3.0 shouldn't be too bad. > > Another way to approach this (and maybe this is what you're already thinking from an > implementation stand point, maybe not) would be just making an easy way to define > the fa?ade for Python modules/classes. That is everything gets compiled normally > but we generate some wrapper classes automatically. The wrapper classes could > use the hosting APIs to import the various modules and expose them as .NET > classes. You could even imagine that the wrapper classes are generated from > some non-turing complete language, but we could also have a script which would > generate them from a .py file automatically and allow you to tweak them. Finally > throw in some ILMerge tools and we have a pretty decent Python->.NET DLL/EXE > story. That's pretty much exactly it. I don't want to compile all of the Python code; I just want to produce CLS-compliant classes that call the Python code, so that I can reference them. Android has some limitations around what you can inherit from. It requires some AOT steps to inherit from Java classes ... which includes all of the UI widgets. I was hand-crafting the wrappers that just forward to Python code, but I figured there had to be an easier way, and pyc.py (or similar) seems like the ticket. - Jeff From dinov at microsoft.com Fri Jul 6 21:34:13 2012 From: dinov at microsoft.com (Dino Viehland) Date: Fri, 6 Jul 2012 19:34:13 +0000 Subject: [Ironpython-users] pyc port to IKVM.Reflection In-Reply-To: References: <6757ED2748BC0A43B9F3E4DA32D65AB001298229@CH1PRD0310MB357.namprd03.prod.outlook.com> Message-ID: <6757ED2748BC0A43B9F3E4DA32D65AB001298379@CH1PRD0310MB357.namprd03.prod.outlook.com> Jeff wrote: > Android has some limitations around what you can inherit from. It requires > some AOT steps to inherit from Java classes ... which includes all of the UI > widgets. I was hand-crafting the wrappers that just forward to Python code, > but I figured there had to be an easier way, and pyc.py (or similar) seems like > the ticket. > Not quite sure how this fits in with Java and Android, but throwing those out of the picture (let's say we're on the Windows Phone 7 and we don't have access to RefEmit), this too can actually potentially be handled by __clrtype__ :) You'll just need to run NewTypeMaker in a mode where it saves to disk (we can already do this I believe for debug builds where we want to verify the IL is legal). Then you just need a metaclass which goes off to the pre-compiled assembly and loads it rather than generating it. I can definitely see the desire to bring it all together in one tool though as there's now lots of moving parts. From jdhardy at gmail.com Fri Jul 6 21:53:07 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Fri, 6 Jul 2012 12:53:07 -0700 Subject: [Ironpython-users] pyc port to IKVM.Reflection In-Reply-To: <6757ED2748BC0A43B9F3E4DA32D65AB001298379@CH1PRD0310MB357.namprd03.prod.outlook.com> References: <6757ED2748BC0A43B9F3E4DA32D65AB001298229@CH1PRD0310MB357.namprd03.prod.outlook.com> <6757ED2748BC0A43B9F3E4DA32D65AB001298379@CH1PRD0310MB357.namprd03.prod.outlook.com> Message-ID: On Fri, Jul 6, 2012 at 12:34 PM, Dino Viehland wrote: > Jeff wrote: >> Android has some limitations around what you can inherit from. It requires >> some AOT steps to inherit from Java classes ... which includes all of the UI >> widgets. I was hand-crafting the wrappers that just forward to Python code, >> but I figured there had to be an easier way, and pyc.py (or similar) seems like >> the ticket. >> > > Not quite sure how this fits in with Java and Android, but throwing those out > of the picture (let's say we're on the Windows Phone 7 and we don't have access > to RefEmit), this too can actually potentially be handled by __clrtype__ :) The full explanation is at http://docs.xamarin.com/android/about/limitations and http://docs.xamarin.com/android/advanced_topics/architecture/android_callable_wrappers. It's similar to .NET's CCW support. > > You'll just need to run NewTypeMaker in a mode where it saves to disk (we > can already do this I believe for debug builds where we want to verify the > IL is legal). Then you just need a metaclass which goes off to the > pre-compiled assembly and loads it rather than generating it. > > I can definitely see the desire to bring it all together in one tool though as > there's now lots of moving parts. Yeah, -X:SaveAssemblies. Super useful, but it requires running the code, and I'd like to avoid that when generating the wrappers if possible. With some annotations (and maybe some assumptions), all of the information needed can be in the source code. - Jeff From dinov at microsoft.com Sat Jul 7 04:34:12 2012 From: dinov at microsoft.com (Dino Viehland) Date: Sat, 7 Jul 2012 02:34:12 +0000 Subject: [Ironpython-users] pyc port to IKVM.Reflection In-Reply-To: References: <6757ED2748BC0A43B9F3E4DA32D65AB001298229@CH1PRD0310MB357.namprd03.prod.outlook.com> <6757ED2748BC0A43B9F3E4DA32D65AB001298379@CH1PRD0310MB357.namprd03.prod.outlook.com> Message-ID: <6757ED2748BC0A43B9F3E4DA32D65AB001299DC9@CH1PRD0310MB357.namprd03.prod.outlook.com> Jeff wrote: > The full explanation is at > http://docs.xamarin.com/android/about/limitations and > http://docs.xamarin.com/android/advanced_topics/architecture/android_ca > llable_wrappers. > It's similar to .NET's CCW support. Oh, awesome, and of course! Somehow I was just totally missing the context there. > > > > > You'll just need to run NewTypeMaker in a mode where it saves to disk > > (we can already do this I believe for debug builds where we want to > > verify the IL is legal). Then you just need a metaclass which goes > > off to the pre-compiled assembly and loads it rather than generating it. > > > > I can definitely see the desire to bring it all together in one tool > > though as there's now lots of moving parts. > > Yeah, -X:SaveAssemblies. Super useful, but it requires running the code, and > I'd like to avoid that when generating the wrappers if possible. With some > annotations (and maybe some assumptions), all of the information needed > can be in the source code. There's also clr.CompileSubclassTypes which doesn't require running the code but it has the problem which started this thread - it's still based upon Reflection instead of IKVM which has all the cool multi-targetting capabilities. From slide.o.mix at gmail.com Sat Jul 7 04:50:36 2012 From: slide.o.mix at gmail.com (Alex Earl) Date: Fri, 6 Jul 2012 19:50:36 -0700 Subject: [Ironpython-users] pyc port to IKVM.Reflection Message-ID: <7489644406628289664@unknownmsgid> Is there interest in moving to IKVM for more of the internal stuff? Mono seems to have had quite a bit of success. Sent from my Windows Phone From: Dino Viehland Sent: 7/6/2012 7:34 PM To: Jeff Hardy Cc: Slide; ironpython-users at python.org Subject: RE: [Ironpython-users] pyc port to IKVM.Reflection Jeff wrote: > The full explanation is at > http://docs.xamarin.com/android/about/limitations and > http://docs.xamarin.com/android/advanced_topics/architecture/android_ca > llable_wrappers. > It's similar to .NET's CCW support. Oh, awesome, and of course! Somehow I was just totally missing the context there. > > > > > You'll just need to run NewTypeMaker in a mode where it saves to disk > > (we can already do this I believe for debug builds where we want to > > verify the IL is legal). Then you just need a metaclass which goes > > off to the pre-compiled assembly and loads it rather than generating it. > > > > I can definitely see the desire to bring it all together in one tool > > though as there's now lots of moving parts. > > Yeah, -X:SaveAssemblies. Super useful, but it requires running the code, and > I'd like to avoid that when generating the wrappers if possible. With some > annotations (and maybe some assumptions), all of the information needed > can be in the source code. There's also clr.CompileSubclassTypes which doesn't require running the code but it has the problem which started this thread - it's still based upon Reflection instead of IKVM which has all the cool multi-targetting capabilities. From jdhardy at gmail.com Sat Jul 7 08:45:58 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Fri, 6 Jul 2012 23:45:58 -0700 Subject: [Ironpython-users] IronPython 2.7.3 Released! Message-ID: On behalf of the IronPython team, I'm happy to announce the final release of IronPython 2.7.3 . This release includes everything from IronPython 2.7 , 2.7.1 , and 2.7.2.1 as well. Like all IronPython 2.7-series releases, *.NET 4 is required* to install it. Installing this release will replace any existing IronPython 2.7-series installation. The incompatibility with IronRuby has been resolved, and they can once again be installed side-by-side. The biggest improvements in IronPython 2.7.3 are: - the winsound and _bisect modules, - the bz2 module, - major improvements to the _ast module, - support for response files in pyc.py, - support for loading zip packages from resources, - the "SuperConsole" is now the default, which adds line history and tab-completion on all platforms, - improvements to Android support, - and numerous other bug fixes . Due to major bugs, the Windows Phone 7 assemblies included in 2.7.2 are not included. IronPython 2.7.3 is also available for embedding via NuGet. The main package is IronPython, and the standard library is in IronPython.StdLib. Because this is a prerelease package, you must use -IncludePrerelease on the command line or select "Include Prerelease" from the package drop-down menu (NuGet 1.7 only). A huge thanks to everyone who helped make this release possible; this wouldn't have been nearly as big a release without your help! - Jeff -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdhardy at gmail.com Sat Jul 7 10:21:49 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Sat, 7 Jul 2012 01:21:49 -0700 Subject: [Ironpython-users] pyc port to IKVM.Reflection In-Reply-To: <7489644406628289664@unknownmsgid> References: <7489644406628289664@unknownmsgid> Message-ID: On Fri, Jul 6, 2012 at 7:50 PM, Alex Earl wrote: > Is there interest in moving to IKVM for more of the internal stuff? > Mono seems to have had quite a bit of success. > I'd prefer not to for the core, just to avoid another deployment dependency. I'm fine with it for the compiler though, since it doesn't have to be deployed with a hosting application. - Jeff -------------- next part -------------- An HTML attachment was scrubbed... URL: From loocas at duber.cz Sat Jul 7 11:20:18 2012 From: loocas at duber.cz (=?UTF-8?B?THVrw6HFoSBEdWLEm2Rh?=) Date: Sat, 07 Jul 2012 11:20:18 +0200 Subject: [Ironpython-users] IronPython 2.7.3 Released! In-Reply-To: References: Message-ID: <4FF7FF52.10200@duber.cz> Hi everyone, first off, congratulations for the release! However, I'm having issues with the console. I downloaded the binaries (windows 7), not the installer. When I execute the ipy.exe, the console crashes immediately (same with ipy64.exe) with this exception: Unhandled Exception: System.MissingMethodException: Method not found: 'Boolean IronPython.Hosting.PythonConsoleOptions.get_BasicConsole()'. at PythonConsoleHost.CreateConsole(ScriptEngine engine, CommandLine commandLine, ConsoleOptions options) at Microsoft.Scripting.Hosting.Shell.ConsoleHost.RunCommandLine() at Microsoft.Scripting.Hosting.Shell.ConsoleHost.ExecuteInternal() at PythonConsoleHost.ExecuteInternal() at Microsoft.Scripting.Hosting.Shell.ConsoleHost.Execute() at Microsoft.Scripting.Hosting.Shell.ConsoleHost.Run(String[] args) at PythonConsoleHost.Main(String[] args) Thank you in advance, cheers, Luk?? Dub?da Company Dictator [T] +420 602 444 164 duber studio(tm) [M] info at duber.cz [W] http://www.duber.cz [A] R.A.Dvorsk?ho 601, Praha 10 [A] 10900, Czech Republic, Europe On 7.7.2012 8:45, Jeff Hardy wrote: > On behalf of the IronPython team, I'm happy to announce the final > release of IronPython 2.7.3 > . This release > includes everything from IronPython 2.7 > , 2.7.1 > , and 2.7.2.1 > as well. Like all > IronPython 2.7-series releases, *.NET 4 is required* to install it. > Installing this release will replace any existing IronPython 2.7-series > installation. > > The incompatibility with IronRuby has been resolved, and they can once > again be installed side-by-side. > > The biggest improvements in IronPython 2.7.3 are: > > * the winsound and _bisect modules, > * the bz2 module, > * major improvements to the _ast module, > * support for response files in pyc.py, > * support for loading zip packages from resources, > * the "SuperConsole" is now the default, which adds line history and > tab-completion on all platforms, > * improvements to Android support, > * and numerous other bug fixes > . > > Due to major bugs, the Windows Phone 7 assemblies included in 2.7.2 are > not included. > > IronPython 2.7.3 is also available for embedding via NuGet > . The main package is IronPython, and the standard > library is in IronPython.StdLib. Because this is a prerelease package, > you must use -IncludePrerelease on the command line or select "Include > Prerelease" from the package drop-down menu (NuGet 1.7 only). > > A huge thanks to everyone who helped make this release possible; this > wouldn't have been nearly as big a release without your help! > > - Jeff > > > > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users From no_reply at codeplex.com Sat Jul 7 15:51:57 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 7 Jul 2012 06:51:57 -0700 Subject: [Ironpython-users] IronPython, Daily Digest 7/6/2012 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New comment] PYC - Allow the Setting of the Icon if generating EXE ---------------------------------------------- ISSUES 1. [New comment] PYC - Allow the Setting of the Icon if generating EXE http://ironpython.codeplex.com/workitem/22138 User slide_o_mix has commented on the issue: "This is much easier to do using IKVM.Reflection (one method call!). I have attached a version of pyc.py that uses IKVM (minimal testing has been done on it). /win32icon:Path/To.ico has been added" ---------------------------------------------- ---------------------------------------------- You are receiving this email because you subscribed to notifications on CodePlex. To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From no_reply at codeplex.com Sun Jul 8 12:27:11 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 8 Jul 2012 03:27:11 -0700 Subject: [Ironpython-users] IronPython, Daily Digest 7/7/2012 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New issue] ipy 2.7.3 console crashes immediately 2. [New comment] ipy 2.7.3 console crashes immediately 3. [New comment] ipy 2.7.3 console crashes immediately 4. [Status update] ipy 2.7.3 console crashes immediately 5. [New comment] ipy 2.7.3 console crashes immediately ---------------------------------------------- ISSUES 1. [New issue] ipy 2.7.3 console crashes immediately http://ironpython.codeplex.com/workitem/32915 User loocas has proposed the issue: "When I try to run either ipy.exe or ipy64.exe, every time I get an immediate crash and this error output: Unhandled Exception: System.MissingMethodException: Method not found: 'Boolean IronPython.Hosting.Py thonConsoleOptions.get_BasicConsole()'. at PythonConsoleHost.CreateConsole(ScriptEngine engine, CommandLine commandLine, ConsoleOptions o ptions) at Microsoft.Scripting.Hosting.Shell.ConsoleHost.RunCommandLine() at Microsoft.Scripting.Hosting.Shell.ConsoleHost.ExecuteInternal() at PythonConsoleHost.ExecuteInternal() at Microsoft.Scripting.Hosting.Shell.ConsoleHost.Execute() at Microsoft.Scripting.Hosting.Shell.ConsoleHost.Run(String[] args) at PythonConsoleHost.Main(String[] args) I'm on Windows 7 Pro x64. Previous version of IronPython (2.7.2.1) console ran without any issues on my machine."----------------- 2. [New comment] ipy 2.7.3 console crashes immediately http://ironpython.codeplex.com/workitem/32915 User slide_o_mix has commented on the issue: "Is 2.7.2.1 still installed? Did you install using the installer or binaries? "----------------- 3. [New comment] ipy 2.7.3 console crashes immediately http://ironpython.codeplex.com/workitem/32915 User loocas has commented on the issue: "Hi, slide_o_mix, yes, I have 2.7.2.1 on my system, but I've never installed it, per se. I only downloaded and copied the binaries to my custom folder structure. However, I had 2.6.1 installed properly and after uninstalling it, it works!!! Thank you!"----------------- 4. [Status update] ipy 2.7.3 console crashes immediately http://ironpython.codeplex.com/workitem/32915 User slide_o_mix has updated the issue: Status has changed from Proposed to Closed with the following comment, "The issue is that ipy.exe was finding the IronPython assemblies in the GAC and they did not have the necessary classes/methods."----------------- 5. [New comment] ipy 2.7.3 console crashes immediately http://ironpython.codeplex.com/workitem/32915 User loocas has commented on the issue: "I only copied 2.7.2.1 from the binary download. I don't like installers as I put all of my tools in specific folders and have to make them run without installation anyways on many machines. Thanks for the tip with the GAC, though, I actually didn't know about it until now. :)" ---------------------------------------------- ---------------------------------------------- You are receiving this email because you subscribed to notifications on CodePlex. To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From m.schaber at 3s-software.com Mon Jul 9 08:41:20 2012 From: m.schaber at 3s-software.com (Markus Schaber) Date: Mon, 9 Jul 2012 06:41:20 +0000 Subject: [Ironpython-users] pyc port to IKVM.Reflection In-Reply-To: References: <6757ED2748BC0A43B9F3E4DA32D65AB001298229@CH1PRD0310MB357.namprd03.prod.outlook.com> Message-ID: <727D8E16AE957149B447FE368139F2B50D800A5E@SERVER10> Hi, > Von: Jeff Hardy > On Fri, Jul 6, 2012 at 11:40 AM, Dino Viehland > wrote: > > The use case for __clrtype__ is that sometimes a .NET class expects a > > real type - either because there need to be attributes placed on it, > > or it needs a normal constructor which doesn't take a PythonType > > object, or for some other oddity of .NET... At the same time > > __clrtype__ is exposing the fact that there's a .NET type that's > > associated with each Python type and it lets you really customize it > > in anyway that you can dream about via your metaclass. I think one of > > the main scenarios in mind was frameworks like WCF but that didn't seem > to go too far (Jimmy apparently beat me to the punch and mentions some > other ones). > > I actually forgot about attributes. That is pretty important :). For a complete solution, we do not only need the ability to expose .NET attributes for types and methods, there needs to be a way to specify them on the assembly level. In C#, they usually reside in the AssemblyInfo.cs file. Apart from the basic AssemblyTitle, AssemblyVersion & Co, some frameworks use custom attributes like PluginGuid. > > Another way to approach this (and maybe this is what you're already > > thinking from an implementation stand point, maybe not) would be just > > making an easy way to define the fa?ade for Python modules/classes. > > That is everything gets compiled normally but we generate some wrapper > > classes automatically. The wrapper classes could use the hosting APIs > > to import the various modules and expose them as .NET classes. You > > could even imagine that the wrapper classes are generated from some > > non-turing complete language, but we could also have a script which > > would generate them from a .py file automatically and allow you to > > tweak them. Finally throw in some ILMerge tools and we have a pretty > decent Python->.NET DLL/EXE story. > > That's pretty much exactly it. I don't want to compile all of the Python > code; I just want to produce CLS-compliant classes that call the Python > code, so that I can reference them. That seems like a sensible way. Most of those frameworks use either fully qualified class name or custom attributes, most of the time in combination with the list of base classes and implemented interfaces. They don't concern about the implementation details, only the "surface" of the class needs to fit their expectations. Best regards Markus Schaber -- ___________________________ We software Automation. 3S-Smart Software Solutions GmbH Markus Schaber | Developer Memminger Str. 151 | 87439 Kempten | Germany | Tel. +49-831-54031-0 | Fax +49-831-54031-50 Email: m.schaber at 3s-software.com | Web: http://www.3s-software.com CoDeSys internet forum: http://forum.3s-software.com Download CoDeSys sample projects: http://www.3s-software.com/index.shtml?sample_projects Managing Directors: Dipl.Inf. Dieter Hess, Dipl.Inf. Manfred Werner | Trade register: Kempten HRB 6186 | Tax ID No.: DE 167014915 From no_reply at codeplex.com Tue Jul 10 10:38:24 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 10 Jul 2012 01:38:24 -0700 Subject: [Ironpython-users] IronPython, Daily Digest 7/9/2012 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New issue] Relative import in non-package error 2. [New comment] Relative import in non-package error 3. [New comment] Relative import in non-package error 4. [New comment] Relative import in non-package error 5. [New comment] Relative import in non-package error ---------------------------------------------- ISSUES 1. [New issue] Relative import in non-package error http://ironpython.codeplex.com/workitem/32916 User loocas has proposed the issue: "Hi, I'm having trouble with relative path imports in IronPython 2.7.3. I add paths to the modules in my code (via sys.path.append()) so the modules are accessible. However, one of the modules I'm trying to import contains the following relative path import statement: from .lib.httplib2 import Http, ProxyInfo, socks When IronPython is trying to import the modules it errors out with this stderr: Traceback (most recent call last): File "", line 1, in File "C:\duber\Shotgun\3.0.9b2\shotgun.py", line 52, in ValueError: Attempted relative import in non-package As soon as I remove the relative path notation (deleting the first dot from the import statement), all runs smoothly without issues. If you want to try this exact scenario out, here is an article about what is needed in order to run the Shotgun API: http://blog.duber.cz/software/calling-shotgun-api-3-0-9b2-from-ironpython-2-7-3"----------------- 2. [New comment] Relative import in non-package error http://ironpython.codeplex.com/workitem/32916 User slide_o_mix has commented on the issue: "Can you verify if this works on CPython 2.7.3? From what I have read regarding relative imports, relative imports only work on packages. The blog post you mention shows that you are trying to import from lib\ which is a subdirectory for the shotgun api code, is there an __init__,py in the lib directory?"----------------- 3. [New comment] Relative import in non-package error http://ironpython.codeplex.com/workitem/32916 User loocas has commented on the issue: "Hi, yes, there is __init__.py in the lib directory. And actually, no, it doesn't seem to be working in CPython 2.7.2 :/ I don't have any other CPython installed here, so I can't verify that on any other version. I got prompted to report this issue here from one of my commenters, so I did. :D I don't have any experience with relative path name imports, to be honest."----------------- 4. [New comment] Relative import in non-package error http://ironpython.codeplex.com/workitem/32916 User slide_o_mix has commented on the issue: "Is the __init__.py empty? It was me who asked you to report the issue, I saw the info on twitter and wanted to make sure the issue was captured and figured out if possible."----------------- 5. [New comment] Relative import in non-package error http://ironpython.codeplex.com/workitem/32916 User loocas has commented on the issue: "Yes, the __init__.py under the lib folder is empty." ---------------------------------------------- ---------------------------------------------- You are receiving this email because you subscribed to notifications on CodePlex. To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From no_reply at codeplex.com Thu Jul 12 12:51:44 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 12 Jul 2012 03:51:44 -0700 Subject: [Ironpython-users] IronPython, Daily Digest 7/11/2012 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New issue] Installation of IronPython on Windows XP over VMware Fusion 2. [New comment] Installation of IronPython on Windows XP over VMware Fusion ---------------------------------------------- ISSUES 1. [New issue] Installation of IronPython on Windows XP over VMware Fusion http://ironpython.codeplex.com/workitem/32925 User SkipsSGI has proposed the issue: "I have IronPython installed on a virtual machine running Windows XP (SP3). It appears to operate OK except when I try to load certain external assemblies (e.g. HDF5DotNet.dll - a .NET 4.0 assembly providing .NET access to the HDF5 libraries). I get the error "IOError: [Errno 2] Could not load file or assembly 'HDF5DotNet.dll or one of its dependencies. The specified module could not be found." I have placed the module (and its dependencies) in several places along sys.path. I have tried several forms clr.AddReference* to identify the module. I have tried uninstalling and reinstalling IronPython (2.7.3) but get the same behavior. I have two other native PC's (one laptop and one desktop) both running Win-XP with identical IronPython installations and they have no problems with importing .NET assemblies and, in particular, HDF5DotNet.dll. It seems that only real difference in the 3 installations is that my problem machine is a virtual machine (VMware Fusion 4.1.3). Am I missing something here? Any ideas? SkipS"----------------- 2. [New comment] Installation of IronPython on Windows XP over VMware Fusion http://ironpython.codeplex.com/workitem/32925 User slide_o_mix has commented on the issue: "Can you verify that you have the sane .NET versions installed on the vm? " ---------------------------------------------- ---------------------------------------------- You are receiving this email because you subscribed to notifications on CodePlex. To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From no_reply at codeplex.com Sat Jul 14 14:20:11 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 14 Jul 2012 05:20:11 -0700 Subject: [Ironpython-users] IronPython, Daily Digest 7/13/2012 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New comment] sys.version is incomplete in user created engine, creating problems in platform.py ---------------------------------------------- ISSUES 1. [New comment] sys.version is incomplete in user created engine, creating problems in platform.py http://ironpython.codeplex.com/workitem/31736 User jdhardy has commented on the issue: "If you can't change the engine hosting code (if you use pyc.py, for example), you can also do sys.version = '2.7.2 (IronPython 2.7.2.1 (2.7.0.40) on .NET 4.0.30319.239 (32-bit))' before importing the platform module." ---------------------------------------------- ---------------------------------------------- You are receiving this email because you subscribed to notifications on CodePlex. To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From no_reply at codeplex.com Sun Jul 15 11:39:03 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 15 Jul 2012 02:39:03 -0700 Subject: [Ironpython-users] IronPython, Daily Digest 7/14/2012 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New issue] IronRuby 1.1.3 incompatible with Microsoft.Scripting 1.1.0.21 ---------------------------------------------- ISSUES 1. [New issue] IronRuby 1.1.3 incompatible with Microsoft.Scripting 1.1.0.21 http://ironpython.codeplex.com/workitem/32936 User Alien282 has proposed the issue: "That is, the latest IronRuby is incompatible with the latest Microsoft.Scripting from IronPython 2.7.3. When doing: rubyEngine.ExecuteFile(...) This error is thrown: System.MissingMethodException: Method not found: 'Void Microsoft.Scripting.Generation.ILGen.EmitPropertyGet(System.Type, System.String)'." ---------------------------------------------- ---------------------------------------------- You are receiving this email because you subscribed to notifications on CodePlex. To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From no_reply at codeplex.com Thu Jul 19 13:11:29 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 19 Jul 2012 04:11:29 -0700 Subject: [Ironpython-users] IronPython, Daily Digest 7/18/2012 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New issue] ipy64.exe compiling assembly ---------------------------------------------- ISSUES 1. [New issue] ipy64.exe compiling assembly http://ironpython.codeplex.com/workitem/32946 User barbar01 has proposed the issue: "Loading code from an assembly (created with pyc.py) is more than 10 times slower with ipy64.exe than ipy.exe" ---------------------------------------------- ---------------------------------------------- You are receiving this email because you subscribed to notifications on CodePlex. To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From hfoffani at gmail.com Fri Jul 20 19:10:52 2012 From: hfoffani at gmail.com (=?iso-8859-1?Q?Hern=E1n_Foffani?=) Date: Fri, 20 Jul 2012 19:10:52 +0200 Subject: [Ironpython-users] locale with datetimes Message-ID: <5769543E-0736-4357-80D4-0893119777AC@gmail.com> Hi, I'm must be doing something wrong but can't see why I'm not able to get datetime.strftime(?) work as expected: In IronPython: IronPython 2.7.2.1 (2.7.0.40) on .NET 4.0.30319.269 (32-bit) Type "help", "copyright", "credits" or "license" for more information. >>> >>> >>> import locale >>> locale.setlocale(locale.LC_ALL, 'es_ES') 'es_ES' >>> >>> import datetime >>> >>> n = datetime.datetime.today() >>> n.strftime("%c") '07/20/12 17:40:56' >>> >>> In CPython (Mac OSX) Python 2.7.1 (r271:86832, Jun 16 2011, 16:59:05) [GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> >>> import locale >>> locale.setlocale(locale.LC_ALL, 'es_ES') 'es_ES' >>> import datetime >>> n = datetime.datetime.today() >>> n.strftime("%c") 'vie 20 jul 19:05:20 2012' >>> I'm not expecting to get the same thing as the Mac but at least something along the lines of dd/mm/yy. Regards, Hern?n. From no_reply at codeplex.com Sat Jul 21 14:49:47 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 21 Jul 2012 05:49:47 -0700 Subject: [Ironpython-users] IronPython, Daily Digest 7/20/2012 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New issue] urllib speed issues 2. [New comment] urllib speed issues ---------------------------------------------- ISSUES 1. [New issue] urllib speed issues http://ironpython.codeplex.com/workitem/32953 User JacksonReed has proposed the issue: "urllib2.urlopen took 0.0937347412109 seconds to download a file, while urllib.urlopen took 30.0861663818 seconds to fetch the same file. The file is a 240kb text file."----------------- 2. [New comment] urllib speed issues http://ironpython.codeplex.com/workitem/32953 User JacksonReed has commented on the issue: "this isn't very clear let me poast the source that was the issue: resp_time= time.time() resp= urllib.urlopen(host_name+plugin_name+url) resp_time= time.time()-resp_time write_time= time.time() data = resp.read() write_time= time.time()-write_time f = open(file_disk_name, 'wb') f.write(data) obj = print_obj(resp_time,write_time,file_disk_name) G_PRINT_QUE.insert(obj)" ---------------------------------------------- ---------------------------------------------- You are receiving this email because you subscribed to notifications on CodePlex. To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jesper at taxboel.dk Mon Jul 23 11:31:10 2012 From: jesper at taxboel.dk (=?ISO-8859-1?Q?Jesper_Taxb=F8l?=) Date: Mon, 23 Jul 2012 11:31:10 +0200 Subject: [Ironpython-users] Gradually executing a python script Message-ID: Hi, I am not that familiar with Ironpython yet, but I have a question that I hope you can help me answer. I am working on a programming-game where I will allow users to do some simple python scripting against a simple API that I will control a game character. Instructions like move and shoot etc, alongside some simple sense functions that return info on the game world. My current prototype creates an ironpython engine for each game character and executes the script in a thread by itself, which sort of works. But I have the problem that the outcome of executing the game gives different results every time. Therefore I would like to ask the question: Is it possible to execute a script inside the Ironpython engine gradually? I imagine that I could update a list of engines with a tick(int cycles) and get a fair sharing of resources between engines and ensure the same result every time. Kind regards Tax P.S: As this is a programming game I would also like to be able to limit the available memory each script is using. Is there a way to limit this, so a script like this would be killed. x = 0 v = {} while True: v[x]=x x= x + 1 -------------- next part -------------- An HTML attachment was scrubbed... URL: From wkhazzard at gmail.com Mon Jul 23 16:27:52 2012 From: wkhazzard at gmail.com (Kevin Hazzard) Date: Mon, 23 Jul 2012 10:27:52 -0400 Subject: [Ironpython-users] Gradually executing a python script In-Reply-To: References: Message-ID: Why don't you use a scripting host and inject commands into a ScriptEngine reusing a ScriptScope as you need to execute them? Kevin On Mon, Jul 23, 2012 at 5:31 AM, Jesper Taxb?l wrote: > Hi, > > I am not that familiar with Ironpython yet, but I have a question that I > hope you can help me answer. > > I am working on a programming-game where I will allow users to do some > simple python scripting against a simple API that I will control a game > character. Instructions like move and shoot etc, alongside some simple > sense functions that return info on the game world. > > My current prototype creates an ironpython engine for each game character > and executes the script in a thread by itself, which sort of works. But I > have the problem that the outcome of executing the game gives different > results every time. Therefore I would like to ask the question: > > Is it possible to execute a script inside the Ironpython engine gradually? > > I imagine that I could update a list of engines with a tick(int cycles) > and get a fair sharing of resources between engines and ensure the same > result every time. > > Kind regards > > Tax > > > P.S: > As this is a programming game I would also like to be able to limit the > available memory each script is using. Is there a way to limit this, so a > script like this would be killed. > > x = 0 > v = {} > while True: > v[x]=x > x= x + 1 > > > > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users > > -- *W. Kevin Hazzard* Consultant, Author, Teacher, Microsoft MVP (804) 928-3444 book | mvp| twitter | facebook| linkedin | captech -------------- next part -------------- An HTML attachment was scrubbed... URL: From jesper at taxboel.dk Mon Jul 23 17:05:02 2012 From: jesper at taxboel.dk (=?ISO-8859-1?Q?Jesper_Taxb=F8l?=) Date: Mon, 23 Jul 2012 17:05:02 +0200 Subject: [Ironpython-users] Gradually executing a python script In-Reply-To: References: Message-ID: Would that allow me to step gradually through a loop? like: x = 0 while x < 10: dostuff() x=x+1 while x > 0: dootherstuff() x=x-1 2012/7/23 Kevin Hazzard > Why don't you use a scripting host and inject commands into a ScriptEngine > reusing a ScriptScope as you need to execute them? > > Kevin > > On Mon, Jul 23, 2012 at 5:31 AM, Jesper Taxb?l wrote: > >> Hi, >> >> I am not that familiar with Ironpython yet, but I have a question that I >> hope you can help me answer. >> >> I am working on a programming-game where I will allow users to do some >> simple python scripting against a simple API that I will control a game >> character. Instructions like move and shoot etc, alongside some simple >> sense functions that return info on the game world. >> >> My current prototype creates an ironpython engine for each game character >> and executes the script in a thread by itself, which sort of works. But I >> have the problem that the outcome of executing the game gives different >> results every time. Therefore I would like to ask the question: >> >> Is it possible to execute a script inside the Ironpython engine gradually? >> >> I imagine that I could update a list of engines with a tick(int cycles) >> and get a fair sharing of resources between engines and ensure the same >> result every time. >> >> Kind regards >> >> Tax >> >> >> P.S: >> As this is a programming game I would also like to be able to limit the >> available memory each script is using. Is there a way to limit this, so a >> script like this would be killed. >> >> x = 0 >> v = {} >> while True: >> v[x]=x >> x= x + 1 >> >> >> >> _______________________________________________ >> Ironpython-users mailing list >> Ironpython-users at python.org >> http://mail.python.org/mailman/listinfo/ironpython-users >> >> > > > -- > *W. Kevin Hazzard* > Consultant, Author, Teacher, Microsoft MVP > (804) 928-3444 > book | mvp| > twitter | facebook| > linkedin | captech > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jesper at taxboel.dk Mon Jul 23 17:13:13 2012 From: jesper at taxboel.dk (=?ISO-8859-1?Q?Jesper_Taxb=F8l?=) Date: Mon, 23 Jul 2012 17:13:13 +0200 Subject: [Ironpython-users] Gradually executing a python script In-Reply-To: References: Message-ID: Sorry for the spam, but the reason is that I am interrested is that I aim to run my avatar's "ai" in a script like this: while True: shoot == (sense == True) Where the gameworld writes to the variable sense and reads from shoot. The script will run forever and therefore needs to be updated gradually on a lower level than script. Kind regards and thanx for your time :) Tax where I read and write to 2012/7/23 Jesper Taxb?l > Would that allow me to step gradually through a loop? > > like: > > x = 0 > while x < 10: > dostuff() > x=x+1 > while x > 0: > dootherstuff() > x=x-1 > > > > > 2012/7/23 Kevin Hazzard > >> Why don't you use a scripting host and inject commands into a >> ScriptEngine reusing a ScriptScope as you need to execute them? >> >> Kevin >> >> On Mon, Jul 23, 2012 at 5:31 AM, Jesper Taxb?l wrote: >> >>> Hi, >>> >>> I am not that familiar with Ironpython yet, but I have a question that I >>> hope you can help me answer. >>> >>> I am working on a programming-game where I will allow users to do some >>> simple python scripting against a simple API that I will control a game >>> character. Instructions like move and shoot etc, alongside some simple >>> sense functions that return info on the game world. >>> >>> My current prototype creates an ironpython engine for each game >>> character and executes the script in a thread by itself, which sort of >>> works. But I have the problem that the outcome of executing the game gives >>> different results every time. Therefore I would like to ask the question: >>> >>> Is it possible to execute a script inside the Ironpython engine >>> gradually? >>> >>> I imagine that I could update a list of engines with a tick(int cycles) >>> and get a fair sharing of resources between engines and ensure the same >>> result every time. >>> >>> Kind regards >>> >>> Tax >>> >>> >>> P.S: >>> As this is a programming game I would also like to be able to limit the >>> available memory each script is using. Is there a way to limit this, so a >>> script like this would be killed. >>> >>> x = 0 >>> v = {} >>> while True: >>> v[x]=x >>> x= x + 1 >>> >>> >>> >>> _______________________________________________ >>> Ironpython-users mailing list >>> Ironpython-users at python.org >>> http://mail.python.org/mailman/listinfo/ironpython-users >>> >>> >> >> >> -- >> *W. Kevin Hazzard* >> Consultant, Author, Teacher, Microsoft MVP >> (804) 928-3444 >> book | mvp| >> twitter | facebook| >> linkedin | captech >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rome at Wintellect.com Mon Jul 23 17:33:34 2012 From: rome at Wintellect.com (Keith Rome) Date: Mon, 23 Jul 2012 15:33:34 +0000 Subject: [Ironpython-users] Gradually executing a python script In-Reply-To: References: Message-ID: <4C554C3A47C5024ABDE00E94DA17BC4D0F8FD491@SN2PRD0710MB396.namprd07.prod.outlook.com> You may want to look into leveraging the sys.settrace() feature of Python for controlling line-by-line execution. This API allows you to install a profiling function that gets invoked for every frame of script code that is executed. In your profiling function, you could compute the amount of memory being used by variables within the ScriptScope, and halt execution if you need to. Just be careful about what you do in your profiling function, as it will be called extremely often by the runtime. http://docs.python.org/library/sys.html#sys.settrace The reason you are seeing variant results is probably due to how you have implemented multithreading. The IronPython runtime is mostly thread-safe (as long as you don't use libraries that make use of mutable objects, and as long as you import all libraries used at least once prior to forking threads). But your code must also be thread-safe as well. From your descriptions of your game engine, it sounds like your game engine is not designed to be thread-safe so I would strongly recommend avoiding multithreading as a means of providing resource sharing. It is very difficult to write 100% thread-safe code, and nothing will stop people from writing unsafe scripts in your game. Instead, I would suggest implementing your game engine as a turn-based system. For each turn, the script for each character is executed completely. This will allow you to cycle through all characters one turn at a time, equally, and will also eliminate the problem of having variant outcomes since the program will become deterministic. Keith Rome Senior Consultant and Architect MCPD-EAD, MCSD, MCDBA, MCTS-WPF, MCTS-TFS, MCTS-WSS Wintellect | 770.617.4016 | krome at wintellect.com www.wintellect.com From: ironpython-users-bounces+rome=wintellect.com at python.org [mailto:ironpython-users-bounces+rome=wintellect.com at python.org] On Behalf Of Jesper Taxb?l Sent: Monday, July 23, 2012 11:05 AM To: Kevin Hazzard Cc: ironpython-users at python.org Subject: Re: [Ironpython-users] Gradually executing a python script Would that allow me to step gradually through a loop? like: x = 0 while x < 10: dostuff() x=x+1 while x > 0: dootherstuff() x=x-1 2012/7/23 Kevin Hazzard > Why don't you use a scripting host and inject commands into a ScriptEngine reusing a ScriptScope as you need to execute them? Kevin On Mon, Jul 23, 2012 at 5:31 AM, Jesper Taxb?l > wrote: Hi, I am not that familiar with Ironpython yet, but I have a question that I hope you can help me answer. I am working on a programming-game where I will allow users to do some simple python scripting against a simple API that I will control a game character. Instructions like move and shoot etc, alongside some simple sense functions that return info on the game world. My current prototype creates an ironpython engine for each game character and executes the script in a thread by itself, which sort of works. But I have the problem that the outcome of executing the game gives different results every time. Therefore I would like to ask the question: Is it possible to execute a script inside the Ironpython engine gradually? I imagine that I could update a list of engines with a tick(int cycles) and get a fair sharing of resources between engines and ensure the same result every time. Kind regards Tax P.S: As this is a programming game I would also like to be able to limit the available memory each script is using. Is there a way to limit this, so a script like this would be killed. x = 0 v = {} while True: v[x]=x x= x + 1 _______________________________________________ Ironpython-users mailing list Ironpython-users at python.org http://mail.python.org/mailman/listinfo/ironpython-users -- W. Kevin Hazzard Consultant, Author, Teacher, Microsoft MVP (804) 928-3444 book | mvp | twitter | facebook | linkedin | captech -------------- next part -------------- An HTML attachment was scrubbed... URL: From jesper at taxboel.dk Mon Jul 23 19:48:48 2012 From: jesper at taxboel.dk (=?ISO-8859-1?Q?Jesper_Taxb=F8l?=) Date: Mon, 23 Jul 2012 19:48:48 +0200 Subject: [Ironpython-users] Gradually executing a python script In-Reply-To: <4C554C3A47C5024ABDE00E94DA17BC4D0F8FD491@SN2PRD0710MB396.namprd07.prod.outlook.com> References: <4C554C3A47C5024ABDE00E94DA17BC4D0F8FD491@SN2PRD0710MB396.namprd07.prod.outlook.com> Message-ID: The reason I want to do it gradually is that I cant be sure that the script ever terminates or has syntax errors. Would that not be a problem in a turn based setup? 2012/7/23 Keith Rome > You may want to look into leveraging the sys.settrace() feature of > Python for controlling line-by-line execution. This API allows you to > install a profiling function that gets invoked for every frame of script > code that is executed. In your profiling function, you could compute the > amount of memory being used by variables within the ScriptScope, and halt > execution if you need to. Just be careful about what you do in your > profiling function, as it will be called extremely often by the runtime.** > ** > > ** ** > > http://docs.python.org/library/sys.html#sys.settrace**** > > ** ** > > ** ** > > The reason you are seeing variant results is probably due to how you have > implemented multithreading. The IronPython runtime is mostly thread-safe > (as long as you don?t use libraries that make use of mutable objects, and > as long as you import all libraries used at least once prior to forking > threads). But your code must also be thread-safe as well. From your > descriptions of your game engine, it sounds like your game engine is not > designed to be thread-safe so I would strongly recommend avoiding > multithreading as a means of providing resource sharing. It is very > difficult to write 100% thread-safe code, and nothing will stop people from > writing unsafe scripts in your game.**** > > ** ** > > Instead, I would suggest implementing your game engine as a turn-based > system. For each turn, the script for each character is executed > completely. This will allow you to cycle through all characters one turn at > a time, equally, and will also eliminate the problem of having variant > outcomes since the program will become deterministic.**** > > ** ** > > ** ** > > ** ** > > *Keith Rome* > > *Senior Consultant and Architect* > > MCPD-EAD, MCSD, MCDBA, MCTS-WPF, MCTS-TFS, MCTS-WSS**** > > Wintellect | 770.617.4016 | krome at wintellect.com **** > > www.wintellect.com**** > > ** ** > > *From:* ironpython-users-bounces+rome=wintellect.com at python.org [mailto: > ironpython-users-bounces+rome=wintellect.com at python.org] *On Behalf Of *Jesper > Taxb?l > *Sent:* Monday, July 23, 2012 11:05 AM > *To:* Kevin Hazzard > *Cc:* ironpython-users at python.org > *Subject:* Re: [Ironpython-users] Gradually executing a python script**** > > ** ** > > Would that allow me to step gradually through a loop?**** > > ** ** > > like:**** > > ** ** > > x = 0**** > > while x < 10:**** > > dostuff()**** > > x=x+1**** > > while x > 0:**** > > dootherstuff()**** > > x=x-1**** > > ** ** > > ** ** > > ** ** > > 2012/7/23 Kevin Hazzard **** > > Why don't you use a scripting host and inject commands into a ScriptEngine > reusing a ScriptScope as you need to execute them?**** > > **** > > Kevin**** > > On Mon, Jul 23, 2012 at 5:31 AM, Jesper Taxb?l wrote:* > *** > > Hi,**** > > ** ** > > I am not that familiar with Ironpython yet, but I have a question that I > hope you can help me answer.**** > > ** ** > > I am working on a programming-game where I will allow users to do some > simple python scripting against a simple API that I will control a game > character. Instructions like move and shoot etc, alongside some simple > sense functions that return info on the game world. **** > > ** ** > > My current prototype creates an ironpython engine for each game character > and executes the script in a thread by itself, which sort of works. But I > have the problem that the outcome of executing the game gives different > results every time. Therefore I would like to ask the question:**** > > ** ** > > Is it possible to execute a script inside the Ironpython engine gradually? > **** > > ** ** > > I imagine that I could update a list of engines with a tick(int cycles) > and get a fair sharing of resources between engines and ensure the same > result every time.**** > > ** ** > > Kind regards **** > > ** ** > > Tax**** > > ** ** > > ** ** > > P.S:**** > > As this is a programming game I would also like to be able to limit the > available memory each script is using. Is there a way to limit this, so a > script like this would be killed.**** > > ** ** > > x = 0**** > > v = {}**** > > while True:**** > > v[x]=x**** > > x= x + 1**** > > ** ** > > ** ** > > ** ** > > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users**** > > > > > -- > *W. Kevin Hazzard***** > > Consultant, Author, Teacher, Microsoft MVP**** > > (804) 928-3444**** > > book | mvp| > twitter | facebook| > linkedin | captech > **** > > ** ** > > ** ** > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rome at Wintellect.com Mon Jul 23 20:12:24 2012 From: rome at Wintellect.com (Keith Rome) Date: Mon, 23 Jul 2012 18:12:24 +0000 Subject: [Ironpython-users] Gradually executing a python script In-Reply-To: References: <4C554C3A47C5024ABDE00E94DA17BC4D0F8FD491@SN2PRD0710MB396.namprd07.prod.outlook.com> Message-ID: <4C554C3A47C5024ABDE00E94DA17BC4D0F8FD5B9@SN2PRD0710MB396.namprd07.prod.outlook.com> Turn-based design is to safely address the non-deterministic characteristics of your current design (you said: "I have the problem that the outcome of executing the game gives different results every time"). By making the design turn-based, you can share computation cycles among all of your character AI scripts, without needing to run them on parallel threads. You run each AI for one turn, then cycle through them again for the next turn, etc., all on one thread of execution. The alternative is to introduce thread synchronization code to your parallel AI implementations - which is a far more difficult task, and ultimately cannot be 100% fool-proof. Using a trace profiler function was suggested as a possible solution to your requirement of controlling line-by-line execution of the scripts (to enforce a memory quota). These are distinct and separate solutions to the two problems that you were wanting to solve - they are not dependent upon each other. Also, the IronPython compiler will catch syntax errors for you. It isn't a line interpreter - it compiles an AST from the entire script prior to execution. So you don't have to worry about it encountering syntax errors once execution starts. You can get to those errors if you need, but the script will not be runnable until it compiles cleanly. Runtime errors are different, and they will generate Exceptions that can be caught and handled by the python script code, and if they are unhandled by the script then they will be raised in the hosting runtime environment - ultimately bubbling up to where you made the call to execute the script. Keith Rome Senior Consultant and Architect MCPD-EAD, MCSD, MCDBA, MCTS-WPF, MCTS-TFS, MCTS-WSS Wintellect | 770.617.4016 | krome at wintellect.com www.wintellect.com From: Jesper Taxb?l [mailto:jesper at taxboel.dk] Sent: Monday, July 23, 2012 1:49 PM To: Keith Rome Cc: Kevin Hazzard; ironpython-users at python.org Subject: Re: [Ironpython-users] Gradually executing a python script The reason I want to do it gradually is that I cant be sure that the script ever terminates or has syntax errors. Would that not be a problem in a turn based setup? 2012/7/23 Keith Rome > You may want to look into leveraging the sys.settrace() feature of Python for controlling line-by-line execution. This API allows you to install a profiling function that gets invoked for every frame of script code that is executed. In your profiling function, you could compute the amount of memory being used by variables within the ScriptScope, and halt execution if you need to. Just be careful about what you do in your profiling function, as it will be called extremely often by the runtime. http://docs.python.org/library/sys.html#sys.settrace The reason you are seeing variant results is probably due to how you have implemented multithreading. The IronPython runtime is mostly thread-safe (as long as you don't use libraries that make use of mutable objects, and as long as you import all libraries used at least once prior to forking threads). But your code must also be thread-safe as well. From your descriptions of your game engine, it sounds like your game engine is not designed to be thread-safe so I would strongly recommend avoiding multithreading as a means of providing resource sharing. It is very difficult to write 100% thread-safe code, and nothing will stop people from writing unsafe scripts in your game. Instead, I would suggest implementing your game engine as a turn-based system. For each turn, the script for each character is executed completely. This will allow you to cycle through all characters one turn at a time, equally, and will also eliminate the problem of having variant outcomes since the program will become deterministic. Keith Rome Senior Consultant and Architect MCPD-EAD, MCSD, MCDBA, MCTS-WPF, MCTS-TFS, MCTS-WSS Wintellect | 770.617.4016 | krome at wintellect.com www.wintellect.com From: ironpython-users-bounces+rome=wintellect.com at python.org [mailto:ironpython-users-bounces+rome=wintellect.com at python.org] On Behalf Of Jesper Taxb?l Sent: Monday, July 23, 2012 11:05 AM To: Kevin Hazzard Cc: ironpython-users at python.org Subject: Re: [Ironpython-users] Gradually executing a python script Would that allow me to step gradually through a loop? like: x = 0 while x < 10: dostuff() x=x+1 while x > 0: dootherstuff() x=x-1 2012/7/23 Kevin Hazzard > Why don't you use a scripting host and inject commands into a ScriptEngine reusing a ScriptScope as you need to execute them? Kevin On Mon, Jul 23, 2012 at 5:31 AM, Jesper Taxb?l > wrote: Hi, I am not that familiar with Ironpython yet, but I have a question that I hope you can help me answer. I am working on a programming-game where I will allow users to do some simple python scripting against a simple API that I will control a game character. Instructions like move and shoot etc, alongside some simple sense functions that return info on the game world. My current prototype creates an ironpython engine for each game character and executes the script in a thread by itself, which sort of works. But I have the problem that the outcome of executing the game gives different results every time. Therefore I would like to ask the question: Is it possible to execute a script inside the Ironpython engine gradually? I imagine that I could update a list of engines with a tick(int cycles) and get a fair sharing of resources between engines and ensure the same result every time. Kind regards Tax P.S: As this is a programming game I would also like to be able to limit the available memory each script is using. Is there a way to limit this, so a script like this would be killed. x = 0 v = {} while True: v[x]=x x= x + 1 _______________________________________________ Ironpython-users mailing list Ironpython-users at python.org http://mail.python.org/mailman/listinfo/ironpython-users -- W. Kevin Hazzard Consultant, Author, Teacher, Microsoft MVP (804) 928-3444 book | mvp | twitter | facebook | linkedin | captech -------------- next part -------------- An HTML attachment was scrubbed... URL: From wkhazzard at gmail.com Mon Jul 23 20:13:23 2012 From: wkhazzard at gmail.com (Kevin Hazzard) Date: Mon, 23 Jul 2012 14:13:23 -0400 Subject: [Ironpython-users] Gradually executing a python script In-Reply-To: References: <4C554C3A47C5024ABDE00E94DA17BC4D0F8FD491@SN2PRD0710MB396.namprd07.prod.outlook.com> Message-ID: What you're describing is a state machine. There are many ways to build such a thing and honestly, I've never thought of single-stepping through code as a way to do that. It's actually quite an intriguing idea, if not inefficient. But efficiency isn't always measured with elegance (and vice versa). Keith's settrace idea is good, too. You should check that out. What it really comes down to is this: do you want the controller to also define the code or merely to drive it? For the example you posted, do you want the while loops implemented in Python to execute your dostuff() and dootherstuff() methods? Or do you want the controller that authorizes a "step" to do that? In that context, you could write the controller in Python, too, but the design of your code would look very different than what you proposed. Kevin On Mon, Jul 23, 2012 at 1:48 PM, Jesper Taxb?l wrote: > The reason I want to do it gradually is that I cant be sure that the > script ever terminates or has syntax errors. Would that not be a problem in > a turn based setup? > > > 2012/7/23 Keith Rome > >> You may want to look into leveraging the sys.settrace() feature of >> Python for controlling line-by-line execution. This API allows you to >> install a profiling function that gets invoked for every frame of script >> code that is executed. In your profiling function, you could compute the >> amount of memory being used by variables within the ScriptScope, and halt >> execution if you need to. Just be careful about what you do in your >> profiling function, as it will be called extremely often by the runtime.* >> *** >> >> ** ** >> >> http://docs.python.org/library/sys.html#sys.settrace**** >> >> ** ** >> >> ** ** >> >> The reason you are seeing variant results is probably due to how you have >> implemented multithreading. The IronPython runtime is mostly thread-safe >> (as long as you don?t use libraries that make use of mutable objects, and >> as long as you import all libraries used at least once prior to forking >> threads). But your code must also be thread-safe as well. From your >> descriptions of your game engine, it sounds like your game engine is not >> designed to be thread-safe so I would strongly recommend avoiding >> multithreading as a means of providing resource sharing. It is very >> difficult to write 100% thread-safe code, and nothing will stop people from >> writing unsafe scripts in your game.**** >> >> ** ** >> >> Instead, I would suggest implementing your game engine as a turn-based >> system. For each turn, the script for each character is executed >> completely. This will allow you to cycle through all characters one turn at >> a time, equally, and will also eliminate the problem of having variant >> outcomes since the program will become deterministic.**** >> >> ** ** >> >> ** ** >> >> ** ** >> >> *Keith Rome* >> >> *Senior Consultant and Architect* >> >> MCPD-EAD, MCSD, MCDBA, MCTS-WPF, MCTS-TFS, MCTS-WSS**** >> >> Wintellect | 770.617.4016 | krome at wintellect.com *** >> * >> >> www.wintellect.com**** >> >> ** ** >> >> *From:* ironpython-users-bounces+rome=wintellect.com at python.org [mailto: >> ironpython-users-bounces+rome=wintellect.com at python.org] *On Behalf Of *Jesper >> Taxb?l >> *Sent:* Monday, July 23, 2012 11:05 AM >> *To:* Kevin Hazzard >> *Cc:* ironpython-users at python.org >> *Subject:* Re: [Ironpython-users] Gradually executing a python script**** >> >> ** ** >> >> Would that allow me to step gradually through a loop?**** >> >> ** ** >> >> like:**** >> >> ** ** >> >> x = 0**** >> >> while x < 10:**** >> >> dostuff()**** >> >> x=x+1**** >> >> while x > 0:**** >> >> dootherstuff()**** >> >> x=x-1**** >> >> ** ** >> >> ** ** >> >> ** ** >> >> 2012/7/23 Kevin Hazzard **** >> >> Why don't you use a scripting host and inject commands into a >> ScriptEngine reusing a ScriptScope as you need to execute them?**** >> >> **** >> >> Kevin**** >> >> On Mon, Jul 23, 2012 at 5:31 AM, Jesper Taxb?l wrote: >> **** >> >> Hi,**** >> >> ** ** >> >> I am not that familiar with Ironpython yet, but I have a question that I >> hope you can help me answer.**** >> >> ** ** >> >> I am working on a programming-game where I will allow users to do some >> simple python scripting against a simple API that I will control a game >> character. Instructions like move and shoot etc, alongside some simple >> sense functions that return info on the game world. **** >> >> ** ** >> >> My current prototype creates an ironpython engine for each game character >> and executes the script in a thread by itself, which sort of works. But I >> have the problem that the outcome of executing the game gives different >> results every time. Therefore I would like to ask the question:**** >> >> ** ** >> >> Is it possible to execute a script inside the Ironpython engine gradually? >> **** >> >> ** ** >> >> I imagine that I could update a list of engines with a tick(int cycles) >> and get a fair sharing of resources between engines and ensure the same >> result every time.**** >> >> ** ** >> >> Kind regards **** >> >> ** ** >> >> Tax**** >> >> ** ** >> >> ** ** >> >> P.S:**** >> >> As this is a programming game I would also like to be able to limit the >> available memory each script is using. Is there a way to limit this, so a >> script like this would be killed.**** >> >> ** ** >> >> x = 0**** >> >> v = {}**** >> >> while True:**** >> >> v[x]=x**** >> >> x= x + 1**** >> >> ** ** >> >> ** ** >> >> ** ** >> >> _______________________________________________ >> Ironpython-users mailing list >> Ironpython-users at python.org >> http://mail.python.org/mailman/listinfo/ironpython-users**** >> >> >> >> >> -- >> *W. Kevin Hazzard***** >> >> Consultant, Author, Teacher, Microsoft MVP**** >> >> (804) 928-3444**** >> >> book | mvp| >> twitter | facebook| >> linkedin | captech >> **** >> >> ** ** >> >> ** ** >> > > -- *W. Kevin Hazzard* Consultant, Author, Teacher, Microsoft MVP (804) 928-3444 book | mvp| twitter | facebook| linkedin | captech -------------- next part -------------- An HTML attachment was scrubbed... URL: From jesper at taxboel.dk Tue Jul 24 00:18:07 2012 From: jesper at taxboel.dk (=?ISO-8859-1?Q?Jesper_Taxb=F8l?=) Date: Tue, 24 Jul 2012 00:18:07 +0200 Subject: [Ironpython-users] Gradually executing a python script In-Reply-To: References: <4C554C3A47C5024ABDE00E94DA17BC4D0F8FD491@SN2PRD0710MB396.namprd07.prod.outlook.com> Message-ID: First of all, thank you for your time. I am not that experienced when it comes to all the terms used in this area of software, so please be patient with me. To give you a more clear idea of what I am doing I have posted a video of the current progress here http://www.youtube.com/watch?v=HER6WSIwSBQ&feature=youtu.be . This is a simple gameengine, with a physics based robot. It has simple senes (A vector to the nearest bot and the length of a raycast in front of the robot) and three actions (left_wheel_speed, right_wheel_speed and fire). IronPython is embeeded inside the Unity3D game engine which runs on .NET 2.0. I am using the dll version of ironpython in the project. (I could not figure out how to integrate the source into my game project.) The whole prototype was made at 48 hour game jam called "No More Sweden" in Malm? the past weekend. I did not know that the python code is compiled in IronPython before it is executed, and therefore will catch syntax errors before execution. That will be very usefull. :) I will need to look into the settrace advice, but my gut feeling is that it is not the direction I want to be going in. It might be later during work on the GUI / programming interface. I agree that I should have a simple singlethreaded, turn based solution, as that can be made deterministic and its far easier to implement. That is definitely the way I want to go. The threading was only used in the prototype because I could not execute my script gradually. I saw the execute command as the only way to have Ironpython run my script, and saw a thread as the only way out. (at 3 am in the morning) The reason I keep mentioning gradually execution requires some backstory: The reference project I have been inspired by is an old game called GunTactyx (http://www.youtube.com/watch?v=vT8PYETav7A&feature=relmfu), where you program robots to hunt down other robots. It uses an old version of the PAWN Language/abstract machine ( http://www.compuphase.com/pawn/pawn.htm). As far as I understand each robot there has an isolated abstract machine with limited memory and it is ticked gradually, like you control the clock on its CPU. If a robot crashes, has an infinite loop or a memory leak it does not affect the cpu in the other robots. The reason I am not using PAWN is that it is C++ based and my target platform runs .NET 2.0. Besides that I prefer Python over the PAWN language. Kevin: When you say statemachine, I imagined Ironpython had something of that sort inside its belly? That might be where I am wrong. Is a statemachine and an abstract machine the same thing in this context? With regard to the dostuff() functions, I dont mind the robots firing many instructions at a time. I just need to be able to let the robots run the same number of "ticks" between each game cycle. I imagine assigning a tick cost to the dostuff() functions, as they probably will do stuff inside the game world. I have been looking at other solutions to allow me to make a programming game. During the 48 hours I briefly used the AluminumLua project which I was able to tick, but it lacked debelopment on the language side. (for loops was not implemented) I would prefer to stick to Pythoon as I love the language and I feel it contains the elements needed to write an interristing AI. I need to read up on the IronPython system and have therefore just ordered "Ironpython in action" book, I hope it will give me a better understanding. Other recommendations are welcome. Kind regards and thank you again for your feedback. Tax 2012/7/23 Kevin Hazzard > What you're describing is a state machine. There are many ways to build > such a thing and honestly, I've never thought of single-stepping through > code as a way to do that. It's actually quite an intriguing idea, if not > inefficient. But efficiency isn't always measured with elegance (and vice > versa). Keith's settrace idea is good, too. You should check that out. > > What it really comes down to is this: do you want the controller to also > define the code or merely to drive it? For the example you posted, do you > want the while loops implemented in Python to execute your dostuff() and > dootherstuff() methods? Or do you want the controller that authorizes a > "step" to do that? In that context, you could write the controller in > Python, too, but the design of your code would look very different than > what you proposed. > > Kevin > > On Mon, Jul 23, 2012 at 1:48 PM, Jesper Taxb?l wrote: > >> The reason I want to do it gradually is that I cant be sure that the >> script ever terminates or has syntax errors. Would that not be a problem in >> a turn based setup? >> >> >> 2012/7/23 Keith Rome >> >>> You may want to look into leveraging the sys.settrace() feature of >>> Python for controlling line-by-line execution. This API allows you to >>> install a profiling function that gets invoked for every frame of script >>> code that is executed. In your profiling function, you could compute the >>> amount of memory being used by variables within the ScriptScope, and halt >>> execution if you need to. Just be careful about what you do in your >>> profiling function, as it will be called extremely often by the runtime. >>> **** >>> >>> ** ** >>> >>> http://docs.python.org/library/sys.html#sys.settrace**** >>> >>> ** ** >>> >>> ** ** >>> >>> The reason you are seeing variant results is probably due to how you >>> have implemented multithreading. The IronPython runtime is mostly >>> thread-safe (as long as you don?t use libraries that make use of mutable >>> objects, and as long as you import all libraries used at least once prior >>> to forking threads). But your code must also be thread-safe as well. From >>> your descriptions of your game engine, it sounds like your game engine is >>> not designed to be thread-safe so I would strongly recommend avoiding >>> multithreading as a means of providing resource sharing. It is very >>> difficult to write 100% thread-safe code, and nothing will stop people from >>> writing unsafe scripts in your game.**** >>> >>> ** ** >>> >>> Instead, I would suggest implementing your game engine as a turn-based >>> system. For each turn, the script for each character is executed >>> completely. This will allow you to cycle through all characters one turn at >>> a time, equally, and will also eliminate the problem of having variant >>> outcomes since the program will become deterministic.**** >>> >>> ** ** >>> >>> ** ** >>> >>> ** ** >>> >>> *Keith Rome* >>> >>> *Senior Consultant and Architect* >>> >>> MCPD-EAD, MCSD, MCDBA, MCTS-WPF, MCTS-TFS, MCTS-WSS**** >>> >>> Wintellect | 770.617.4016 | krome at wintellect.com ** >>> ** >>> >>> www.wintellect.com**** >>> >>> ** ** >>> >>> *From:* ironpython-users-bounces+rome=wintellect.com at python.org [mailto: >>> ironpython-users-bounces+rome=wintellect.com at python.org] *On Behalf Of *Jesper >>> Taxb?l >>> *Sent:* Monday, July 23, 2012 11:05 AM >>> *To:* Kevin Hazzard >>> *Cc:* ironpython-users at python.org >>> *Subject:* Re: [Ironpython-users] Gradually executing a python script*** >>> * >>> >>> ** ** >>> >>> Would that allow me to step gradually through a loop?**** >>> >>> ** ** >>> >>> like:**** >>> >>> ** ** >>> >>> x = 0**** >>> >>> while x < 10:**** >>> >>> dostuff()**** >>> >>> x=x+1**** >>> >>> while x > 0:**** >>> >>> dootherstuff()**** >>> >>> x=x-1**** >>> >>> ** ** >>> >>> ** ** >>> >>> ** ** >>> >>> 2012/7/23 Kevin Hazzard **** >>> >>> Why don't you use a scripting host and inject commands into a >>> ScriptEngine reusing a ScriptScope as you need to execute them?**** >>> >>> **** >>> >>> Kevin**** >>> >>> On Mon, Jul 23, 2012 at 5:31 AM, Jesper Taxb?l >>> wrote:**** >>> >>> Hi,**** >>> >>> ** ** >>> >>> I am not that familiar with Ironpython yet, but I have a question that I >>> hope you can help me answer.**** >>> >>> ** ** >>> >>> I am working on a programming-game where I will allow users to do some >>> simple python scripting against a simple API that I will control a game >>> character. Instructions like move and shoot etc, alongside some simple >>> sense functions that return info on the game world. **** >>> >>> ** ** >>> >>> My current prototype creates an ironpython engine for each game >>> character and executes the script in a thread by itself, which sort of >>> works. But I have the problem that the outcome of executing the game gives >>> different results every time. Therefore I would like to ask the question: >>> **** >>> >>> ** ** >>> >>> Is it possible to execute a script inside the Ironpython engine >>> gradually?**** >>> >>> ** ** >>> >>> I imagine that I could update a list of engines with a tick(int cycles) >>> and get a fair sharing of resources between engines and ensure the same >>> result every time.**** >>> >>> ** ** >>> >>> Kind regards **** >>> >>> ** ** >>> >>> Tax**** >>> >>> ** ** >>> >>> ** ** >>> >>> P.S:**** >>> >>> As this is a programming game I would also like to be able to limit the >>> available memory each script is using. Is there a way to limit this, so a >>> script like this would be killed.**** >>> >>> ** ** >>> >>> x = 0**** >>> >>> v = {}**** >>> >>> while True:**** >>> >>> v[x]=x**** >>> >>> x= x + 1**** >>> >>> ** ** >>> >>> ** ** >>> >>> ** ** >>> >>> _______________________________________________ >>> Ironpython-users mailing list >>> Ironpython-users at python.org >>> http://mail.python.org/mailman/listinfo/ironpython-users**** >>> >>> >>> >>> >>> -- >>> *W. Kevin Hazzard***** >>> >>> Consultant, Author, Teacher, Microsoft MVP**** >>> >>> (804) 928-3444**** >>> >>> book | mvp| >>> twitter | facebook| >>> linkedin | captech >>> **** >>> >>> ** ** >>> >>> ** ** >>> >> >> > > > -- > *W. Kevin Hazzard* > Consultant, Author, Teacher, Microsoft MVP > (804) 928-3444 > book | mvp| > twitter | facebook| > linkedin | captech > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rome at Wintellect.com Tue Jul 24 02:05:43 2012 From: rome at Wintellect.com (Keith Rome) Date: Tue, 24 Jul 2012 00:05:43 +0000 Subject: [Ironpython-users] Gradually executing a python script In-Reply-To: References: <4C554C3A47C5024ABDE00E94DA17BC4D0F8FD491@SN2PRD0710MB396.namprd07.prod.outlook.com> Message-ID: <4C554C3A47C5024ABDE00E94DA17BC4D0F8FD8B6@SN2PRD0710MB396.namprd07.prod.outlook.com> That is a pretty cool demo already :) The term "abstract machine" used by PAWN on that page you have linked is a reference to the execution environment of that language. The "abstract machine" (more often referred to as a "virtual machine") in that sense is roughly equivalent to the .NET Runtime. You can also view the IronPython engine similarly as a virtual machine - think of it as a runtime within a runtime. What you have described as "ticks" of the AI runtime sounds roughly equivalent to what I described as "turns". Either way, the idea is to break up actions into a series of discrete steps, each step with an associated unit of cost. For example, the "shoot" action might have a cost of 5, which means it can only be activated once every 5 turns (or ticks). I am pretty sure that this is what Kevin is referring to when he says "state machine": http://en.wikipedia.org/wiki/Finite-state_machine. It can be a little confusing because these are also sometimes called "abstract machines" - but these are an entirely unrelated concept from the virtual machine environment I describe above. Essentially, a state machine is a way to describe the various viable "states" something can be in, and the allowable transitions that can occur to move from one state to another. For example, your robots could have states for rotation speed of each wheel that can only be changed by 0.1 at a time, up to a maximum speed of ?1.0. Or, your robots might have a "gun cooldown" state that lasts for 5 turns/ticks, and the "shoot" action is only usable while not in a "gun cooldown" state (and using the "shoot" action will trigger the 5-turn "gun cooldown"). And you can imagine numerous additional mechanics that build on the general principle... but the main idea is that you have one model (the "state machine") that ensures that the AI must adhere to the rules of your game. In other words, making sure a robot is not able to "shoot" again until it's gun cools down. Keith Rome Senior Consultant and Architect MCPD-EAD, MCSD, MCDBA, MCTS-WPF, MCTS-TFS, MCTS-WSS Wintellect | 770.617.4016 | krome at wintellect.com www.wintellect.com From: Jesper Taxb?l [mailto:jesper at taxboel.dk] Sent: Monday, July 23, 2012 6:18 PM To: Kevin Hazzard Cc: Keith Rome; ironpython-users at python.org Subject: Re: [Ironpython-users] Gradually executing a python script First of all, thank you for your time. I am not that experienced when it comes to all the terms used in this area of software, so please be patient with me. To give you a more clear idea of what I am doing I have posted a video of the current progress here http://www.youtube.com/watch?v=HER6WSIwSBQ&feature=youtu.be . This is a simple gameengine, with a physics based robot. It has simple senes (A vector to the nearest bot and the length of a raycast in front of the robot) and three actions (left_wheel_speed, right_wheel_speed and fire). IronPython is embeeded inside the Unity3D game engine which runs on .NET 2.0. I am using the dll version of ironpython in the project. (I could not figure out how to integrate the source into my game project.) The whole prototype was made at 48 hour game jam called "No More Sweden" in Malm? the past weekend. I did not know that the python code is compiled in IronPython before it is executed, and therefore will catch syntax errors before execution. That will be very usefull. :) I will need to look into the settrace advice, but my gut feeling is that it is not the direction I want to be going in. It might be later during work on the GUI / programming interface. I agree that I should have a simple singlethreaded, turn based solution, as that can be made deterministic and its far easier to implement. That is definitely the way I want to go. The threading was only used in the prototype because I could not execute my script gradually. I saw the execute command as the only way to have Ironpython run my script, and saw a thread as the only way out. (at 3 am in the morning) The reason I keep mentioning gradually execution requires some backstory: The reference project I have been inspired by is an old game called GunTactyx (http://www.youtube.com/watch?v=vT8PYETav7A&feature=relmfu), where you program robots to hunt down other robots. It uses an old version of the PAWN Language/abstract machine (http://www.compuphase.com/pawn/pawn.htm). As far as I understand each robot there has an isolated abstract machine with limited memory and it is ticked gradually, like you control the clock on its CPU. If a robot crashes, has an infinite loop or a memory leak it does not affect the cpu in the other robots. The reason I am not using PAWN is that it is C++ based and my target platform runs .NET 2.0. Besides that I prefer Python over the PAWN language. Kevin: When you say statemachine, I imagined Ironpython had something of that sort inside its belly? That might be where I am wrong. Is a statemachine and an abstract machine the same thing in this context? With regard to the dostuff() functions, I dont mind the robots firing many instructions at a time. I just need to be able to let the robots run the same number of "ticks" between each game cycle. I imagine assigning a tick cost to the dostuff() functions, as they probably will do stuff inside the game world. I have been looking at other solutions to allow me to make a programming game. During the 48 hours I briefly used the AluminumLua project which I was able to tick, but it lacked debelopment on the language side. (for loops was not implemented) I would prefer to stick to Pythoon as I love the language and I feel it contains the elements needed to write an interristing AI. I need to read up on the IronPython system and have therefore just ordered "Ironpython in action" book, I hope it will give me a better understanding. Other recommendations are welcome. Kind regards and thank you again for your feedback. Tax 2012/7/23 Kevin Hazzard > What you're describing is a state machine. There are many ways to build such a thing and honestly, I've never thought of single-stepping through code as a way to do that. It's actually quite an intriguing idea, if not inefficient. But efficiency isn't always measured with elegance (and vice versa). Keith's settrace idea is good, too. You should check that out. What it really comes down to is this: do you want the controller to also define the code or merely to drive it? For the example you posted, do you want the while loops implemented in Python to execute your dostuff() and dootherstuff() methods? Or do you want the controller that authorizes a "step" to do that? In that context, you could write the controller in Python, too, but the design of your code would look very different than what you proposed. Kevin On Mon, Jul 23, 2012 at 1:48 PM, Jesper Taxb?l > wrote: The reason I want to do it gradually is that I cant be sure that the script ever terminates or has syntax errors. Would that not be a problem in a turn based setup? 2012/7/23 Keith Rome > You may want to look into leveraging the sys.settrace() feature of Python for controlling line-by-line execution. This API allows you to install a profiling function that gets invoked for every frame of script code that is executed. In your profiling function, you could compute the amount of memory being used by variables within the ScriptScope, and halt execution if you need to. Just be careful about what you do in your profiling function, as it will be called extremely often by the runtime. http://docs.python.org/library/sys.html#sys.settrace The reason you are seeing variant results is probably due to how you have implemented multithreading. The IronPython runtime is mostly thread-safe (as long as you don't use libraries that make use of mutable objects, and as long as you import all libraries used at least once prior to forking threads). But your code must also be thread-safe as well. From your descriptions of your game engine, it sounds like your game engine is not designed to be thread-safe so I would strongly recommend avoiding multithreading as a means of providing resource sharing. It is very difficult to write 100% thread-safe code, and nothing will stop people from writing unsafe scripts in your game. Instead, I would suggest implementing your game engine as a turn-based system. For each turn, the script for each character is executed completely. This will allow you to cycle through all characters one turn at a time, equally, and will also eliminate the problem of having variant outcomes since the program will become deterministic. Keith Rome Senior Consultant and Architect MCPD-EAD, MCSD, MCDBA, MCTS-WPF, MCTS-TFS, MCTS-WSS Wintellect | 770.617.4016 | krome at wintellect.com www.wintellect.com From: ironpython-users-bounces+rome=wintellect.com at python.org [mailto:ironpython-users-bounces+rome=wintellect.com at python.org] On Behalf Of Jesper Taxb?l Sent: Monday, July 23, 2012 11:05 AM To: Kevin Hazzard Cc: ironpython-users at python.org Subject: Re: [Ironpython-users] Gradually executing a python script Would that allow me to step gradually through a loop? like: x = 0 while x < 10: dostuff() x=x+1 while x > 0: dootherstuff() x=x-1 2012/7/23 Kevin Hazzard > Why don't you use a scripting host and inject commands into a ScriptEngine reusing a ScriptScope as you need to execute them? Kevin On Mon, Jul 23, 2012 at 5:31 AM, Jesper Taxb?l > wrote: Hi, I am not that familiar with Ironpython yet, but I have a question that I hope you can help me answer. I am working on a programming-game where I will allow users to do some simple python scripting against a simple API that I will control a game character. Instructions like move and shoot etc, alongside some simple sense functions that return info on the game world. My current prototype creates an ironpython engine for each game character and executes the script in a thread by itself, which sort of works. But I have the problem that the outcome of executing the game gives different results every time. Therefore I would like to ask the question: Is it possible to execute a script inside the Ironpython engine gradually? I imagine that I could update a list of engines with a tick(int cycles) and get a fair sharing of resources between engines and ensure the same result every time. Kind regards Tax P.S: As this is a programming game I would also like to be able to limit the available memory each script is using. Is there a way to limit this, so a script like this would be killed. x = 0 v = {} while True: v[x]=x x= x + 1 _______________________________________________ Ironpython-users mailing list Ironpython-users at python.org http://mail.python.org/mailman/listinfo/ironpython-users -- W. Kevin Hazzard Consultant, Author, Teacher, Microsoft MVP (804) 928-3444 book | mvp | twitter | facebook | linkedin | captech -- W. Kevin Hazzard Consultant, Author, Teacher, Microsoft MVP (804) 928-3444 book | mvp | twitter | facebook | linkedin | captech -------------- next part -------------- An HTML attachment was scrubbed... URL: From jesper at taxboel.dk Tue Jul 24 11:59:01 2012 From: jesper at taxboel.dk (=?ISO-8859-1?Q?Jesper_Taxb=F8l?=) Date: Tue, 24 Jul 2012 11:59:01 +0200 Subject: [Ironpython-users] Gradually executing a python script In-Reply-To: <4C554C3A47C5024ABDE00E94DA17BC4D0F8FD8B6@SN2PRD0710MB396.namprd07.prod.outlook.com> References: <4C554C3A47C5024ABDE00E94DA17BC4D0F8FD491@SN2PRD0710MB396.namprd07.prod.outlook.com> <4C554C3A47C5024ABDE00E94DA17BC4D0F8FD8B6@SN2PRD0710MB396.namprd07.prod.outlook.com> Message-ID: Thanx, :) Meanwhile i was looking at sandbox environments in .NET via AppDomain's. It is used here http://www.finalbot.com. From reading their FAQ they battle the exact same issues I do, and solve them by passing them to the player. :( http://www.finalbot.com/faq.aspx To better understand what I want I have listed my priorities (highest first): 1) Completely seperate execution of avatar code. No limitations on what code can be run. (Infinite loops, division by zero, memory leaks) Code will be hostile and must support syntax like this without hanging the game (its ok for the avatar to crash as that is the game): while True: format_harddisk() while sense1==False: action_1=True action_2=False while sense2==True: action_1=False action_2=True a = 99.0 / 0 Note: My goal code-form is actually quite similar to the types of programs you write on the Arduino platform where you basically just write a main loop. (I am ignoring interrupts, even though they could be cool to have available) 2) Fair sharing of memory and CPU cycles. 3) Ability to communicate with game engine to exchange actions and senses. 4) Deterministic outcome. 5) It must be based on a higher level language that can send players into other fields of programming. (Python is my first choice) 6) A prototype must be below 100 hours of development time. () So it looks I am on the market for an Abstract machine (execution environment). Do you know any implemented in .Net? There seem to be a java one http://www.ikvm.net/, but its too early to say if it will work for me. Unless I can prepare the python environment with some hook into settrace as was suggested earlier. I think this wilkl be my next research vector. Alternatively I could build my own Turing machine. But that would miss my target audience by 15+ years. :) I know my statemachines. I am already using them in the demo as I have cooldown on the firing mechanism and the physics engine sets limitations on how long driving the wheels take. Tax P.S: To give some insight to my setup I have attached the avatar script I am using. The interresting part is kickstarted from SetCode(). using UnityEngine; using System.Collections; using System.Collections.Generic; using System; using IronPython; using IronPython.Hosting; using Microsoft.Scripting; using Microsoft.Scripting.Hosting; using System.Threading; public class Tank : MonoBehaviour { Transform body; Transform lf, rf, lb, rb; Transform cannon; ScriptEngine engine; ScriptScope scope; Thread PythonThread; string code = ""; float right = 0.0f; float left = 0.0f; bool fire = false; float fireinterval = 1.0f; float lastfire = -1.0f; //Senses float distance = 100.0f; Vector3 nearest_enemy = new Vector3(); bool destroyme = false; object result = null; void Awake() { GameManager.Instance.tanks.Add(this); body = transform.FindChild("Body"); cannon = transform.FindChild("Cannon"); lf = transform.FindChild("LF"); lb = transform.FindChild("LB"); rf = transform.FindChild("RF"); rb = transform.FindChild("RB"); Physics.IgnoreCollision(lf.collider, body.collider); Physics.IgnoreCollision(lb.collider, body.collider); Physics.IgnoreCollision(rf.collider, body.collider); Physics.IgnoreCollision(rb.collider, body.collider); Physics.IgnoreCollision(cannon.collider, body.collider); Physics.IgnoreCollision(rf.collider, rb.collider); Physics.IgnoreCollision(lf.collider, lb.collider); Physics.IgnoreCollision(lf.collider, GameObject.Find("/World/maze1").collider); Physics.IgnoreCollision(lf.collider, GameObject.Find("/World/maze2").collider); Physics.IgnoreCollision(lf.collider, GameObject.Find("/World/maze3").collider); Physics.IgnoreCollision(lf.collider, GameObject.Find("/World/maze4").collider); Physics.IgnoreCollision(lb.collider, GameObject.Find("/World/maze1").collider); Physics.IgnoreCollision(lb.collider, GameObject.Find("/World/maze2").collider); Physics.IgnoreCollision(lb.collider, GameObject.Find("/World/maze3").collider); Physics.IgnoreCollision(lb.collider, GameObject.Find("/World/maze4").collider); Physics.IgnoreCollision(rf.collider, GameObject.Find("/World/maze1").collider); Physics.IgnoreCollision(rf.collider, GameObject.Find("/World/maze2").collider); Physics.IgnoreCollision(rf.collider, GameObject.Find("/World/maze3").collider); Physics.IgnoreCollision(rf.collider, GameObject.Find("/World/maze4").collider); Physics.IgnoreCollision(rb.collider, GameObject.Find("/World/maze1").collider); Physics.IgnoreCollision(rb.collider, GameObject.Find("/World/maze2").collider); Physics.IgnoreCollision(rb.collider, GameObject.Find("/World/maze3").collider); Physics.IgnoreCollision(rb.collider, GameObject.Find("/World/maze4").collider); } public void PythonThreadFunction() { Dictionary options = new Dictionary(); options["DivisionOptions"] = PythonDivisionOptions.New; engine = Python.CreateEngine(options); scope = engine.CreateScope(); ScriptSource source = engine.CreateScriptSourceFromString(code, SourceCodeKind.Statements); //Set senses scope.SetVariable("distance", distance); float f = nearest_enemy.x; scope.SetVariable("nex", (double)f); f = nearest_enemy.y; scope.SetVariable("ney", (double)f); f = nearest_enemy.z; scope.SetVariable("nez", (double)f); //Also declare action variables scope.SetVariable("left", left); scope.SetVariable("right", right); scope.SetVariable("fire", fire); try{ //Wish I had a source.Execute(scope, [number of IL instructions to execute]) result = source.Execute(scope); } catch (Exception e) { Debug.Log ("Execution error" + e.ToString()); } destroyme = true; } public void SetCode(string c) { code = c; PythonThread = new Thread(new ThreadStart(PythonThreadFunction)); PythonThread.IsBackground = true; PythonThread.Priority = System.Threading.ThreadPriority.Lowest; PythonThread.Start(); } // Update is called once per frame void Update () { JointMotor jm = new JointMotor(); jm.force = 100; //Probe senses RaycastHit hit = new RaycastHit(); if(Physics.Raycast(new Ray(body.position, body.rotation * Vector3.forward), out hit, 100.0f)) { distance = hit.distance; } nearest_enemy = body.position; foreach(Tank t in GameManager.Instance.tanks) { if(t != this) { if(nearest_enemy == body.position || (t.body.position - body.position).magnitude < (nearest_enemy - body.position).magnitude) { nearest_enemy = t.body.position; } } } nearest_enemy = body.InverseTransformPoint(nearest_enemy); //Fetch output if(code != "") { try{left = Mathf.Clamp(scope.GetVariable("left"), -1.0f, 1.0f);}catch{left = 0.0f;} try{right = Mathf.Clamp(scope.GetVariable("right"), -1.0f, 1.0f);}catch{right = 0.0f;} try{fire = scope.GetVariable("fire");}catch{fire = false;} } jm.targetVelocity = right * 400.0f; //rs * s; rf.hingeJoint.motor = jm; rb.hingeJoint.motor = jm; jm.targetVelocity = left * 400.0f; //ls * s; lf.hingeJoint.motor = jm; lb.hingeJoint.motor = jm; if(Input.GetKeyDown(KeyCode.Space)) { fire = true; } //Tick if(fire && Time.time > lastfire + fireinterval) { lastfire = Time.time; fire = false; float force = 10.0f; GameObject go = (GameObject)GameObject.Instantiate((GameObject)Resources.Load("prefabs/Projectile"), cannon.position + cannon.rotation* (Vector3.up * 0.055f + Vector3.forward * 0.4f), cannon.rotation); go.rigidbody.AddForce(cannon.rotation * Vector3.forward * force, ForceMode.Impulse); cannon.rigidbody.AddForce(cannon.rotation * Vector3.forward * -force, ForceMode.Impulse); Physics.IgnoreCollision(go.collider, cannon.collider); Physics.IgnoreCollision(go.collider, body.collider); } if(destroyme) { Destroy(transform.gameObject); } } public void hit() { Destroy (transform.gameObject); } void OnGUI() { Vector3 p = Camera.mainCamera.WorldToScreenPoint(body.position); GUI.Label(new Rect(p.x,Screen.height - p.y, 100,100), string.Format("left {0:0.00}", left)); GUI.Label(new Rect(p.x,Screen.height - p.y + 20, 100,100), string.Format("right {0:0.00}", right)); GUI.Label(new Rect(p.x,Screen.height - p.y + 40, 100,100), string.Format("distance {0:0.00}", distance)); GUI.Label(new Rect(p.x,Screen.height - p.y + 60, 100,100), string.Format("nearest_enemy {0:0.00} {1:0.00} {2:0.00} ", nearest_enemy.x, nearest_enemy.y, nearest_enemy.z)); } void OnDestroy() { GameManager.Instance.tanks.Remove(this); if(PythonThread != null) { PythonThread.Abort(); } } } 2012/7/24 Keith Rome > That is a pretty cool demo already J**** > > ** ** > > The term ?abstract machine? used by PAWN on that page you have linked is a > reference to the execution environment of that language. The ?abstract > machine? (more often referred to as a ?virtual machine?) in that sense is > roughly equivalent to the .NET Runtime. You can also view the IronPython > engine similarly as a virtual machine ? think of it as a runtime within a > runtime.**** > > ** ** > > What you have described as ?ticks? of the AI runtime sounds roughly > equivalent to what I described as ?turns?. Either way, the idea is to break > up actions into a series of discrete steps, each step with an associated > unit of cost. For example, the ?shoot? action might have a cost of 5, which > means it can only be activated once every 5 turns (or ticks).**** > > ** ** > > I am pretty sure that this is what Kevin is referring to when he says > ?state machine?: http://en.wikipedia.org/wiki/Finite-state_machine. It > can be a little confusing because these are also sometimes called ?abstract > machines? ? but these are an entirely unrelated concept from the virtual > machine environment I describe above.**** > > ** ** > > Essentially, a state machine is a way to describe the various viable > ?states? something can be in, and the allowable transitions that can occur > to move from one state to another. For example, your robots could have > states for rotation speed of each wheel that can only be changed by 0.1 at > a time, up to a maximum speed of ?1.0. Or, your robots might have a ?gun > cooldown? state that lasts for 5 turns/ticks, and the ?shoot? action is > only usable while not in a ?gun cooldown? state (and using the ?shoot? > action will trigger the 5-turn ?gun cooldown?). And you can imagine > numerous additional mechanics that build on the general principle? but the > main idea is that you have one model (the ?state machine?) that ensures > that the AI must adhere to the rules of your game. In other words, making > sure a robot is not able to ?shoot? again until it?s gun cools down.**** > > ** ** > > ** ** > > *Keith Rome* > > *Senior Consultant and Architect* > > MCPD-EAD, MCSD, MCDBA, MCTS-WPF, MCTS-TFS, MCTS-WSS**** > > Wintellect | 770.617.4016 | krome at wintellect.com **** > > www.wintellect.com**** > > ** ** > > *From:* Jesper Taxb?l [mailto:jesper at taxboel.dk] > *Sent:* Monday, July 23, 2012 6:18 PM > *To:* Kevin Hazzard > *Cc:* Keith Rome; ironpython-users at python.org > > *Subject:* Re: [Ironpython-users] Gradually executing a python script**** > > ** ** > > First of all, thank you for your time. I am not that experienced when it > comes to all the terms used in this area of software, so please be patient > with me. **** > > ** ** > > To give you a more clear idea of what I am doing I have posted a video of > the current progress here > http://www.youtube.com/watch?v=HER6WSIwSBQ&feature=youtu.be . This is a > simple gameengine, with a physics based robot. It has simple senes (A > vector to the nearest bot and the length of a raycast in front of the > robot) and three actions (left_wheel_speed, right_wheel_speed and > fire). IronPython is embeeded inside the Unity3D game engine which runs on > .NET 2.0. I am using the dll version of ironpython in the project. (I could > not figure out how to integrate the source into my game project.) **** > > ** ** > > The whole prototype was made at 48 hour game jam called "No More Sweden" > in Malm? the past weekend. **** > > **** > > I did not know that the python code is compiled in IronPython before it is > executed, and therefore will catch syntax errors before execution. That > will be very usefull. :)**** > > ** ** > > I will need to look into the settrace advice, but my gut feeling is that > it is not the direction I want to be going in. It might be later during > work on the GUI / programming interface. **** > > ** ** > > I agree that I should have a simple singlethreaded, turn based solution, > as that can be made deterministic and its far easier to implement. That is > definitely the way I want to go. The threading was only used in the > prototype because I could not execute my script gradually. I saw the > execute command as the only way to have Ironpython run my script, and saw a > thread as the only way out. (at 3 am in the morning) **** > > ** ** > > The reason I keep mentioning gradually execution requires some > backstory: The reference project I have been inspired by is an old game > called GunTactyx ( > http://www.youtube.com/watch?v=vT8PYETav7A&feature=relmfu), where you > program robots to hunt down other robots. It uses an old version of the > PAWN Language/abstract machine (http://www.compuphase.com/pawn/pawn.htm). > As far as I understand each robot there has an isolated abstract machine > with limited memory and it is ticked gradually, like you control the clock > on its CPU. If a robot crashes, has an infinite loop or a memory leak it > does not affect the cpu in the other robots. The reason I am not using PAWN > is that it is C++ based and my target platform runs .NET 2.0. Besides that > I prefer Python over the PAWN language.**** > > ** ** > > Kevin: When you say statemachine, I imagined Ironpython had something of > that sort inside its belly? That might be where I am wrong. Is a > statemachine and an abstract machine the same thing in this context?**** > > ** ** > > With regard to the dostuff() functions, I dont mind the robots firing many > instructions at a time. I just need to be able to let the robots run the > same number of "ticks" between each game cycle. I imagine assigning a tick > cost to the dostuff() functions, as they probably will do stuff inside the > game world. **** > > ** ** > > I have been looking at other solutions to allow me to make a programming > game. During the 48 hours I briefly used the AluminumLua project which I > was able to tick, but it lacked debelopment on the language side. (for > loops was not implemented) I would prefer to stick to Pythoon as I love the > language and I feel it contains the elements needed to write an > interristing AI. **** > > ** ** > > I need to read up on the IronPython system and have therefore just > ordered "Ironpython in action" book, I hope it will give me a better > understanding. Other recommendations are welcome.**** > > ** ** > > Kind regards and thank you again for your feedback.**** > > ** ** > > Tax**** > > ** ** > > **** > > ** ** > > 2012/7/23 Kevin Hazzard **** > > What you're describing is a state machine. There are many ways to build > such a thing and honestly, I've never thought of single-stepping through > code as a way to do that. It's actually quite an intriguing idea, if not > inefficient. But efficiency isn't always measured with elegance (and vice > versa). Keith's settrace idea is good, too. You should check that out.**** > > **** > > What it really comes down to is this: do you want the controller to also > define the code or merely to drive it? For the example you posted, do you > want the while loops implemented in Python to execute your dostuff() and > dootherstuff() methods? Or do you want the controller that authorizes a > "step" to do that? In that context, you could write the controller in > Python, too, but the design of your code would look very different than > what you proposed.**** > > **** > > Kevin**** > > On Mon, Jul 23, 2012 at 1:48 PM, Jesper Taxb?l wrote:* > *** > > The reason I want to do it gradually is that I cant be sure that the > script ever terminates or has syntax errors. Would that not be a problem in > a turn based setup? **** > > ** ** > > 2012/7/23 Keith Rome **** > > You may want to look into leveraging the sys.settrace() feature of Python > for controlling line-by-line execution. This API allows you to install a > profiling function that gets invoked for every frame of script code that is > executed. In your profiling function, you could compute the amount of > memory being used by variables within the ScriptScope, and halt execution > if you need to. Just be careful about what you do in your profiling > function, as it will be called extremely often by the runtime.**** > > **** > > http://docs.python.org/library/sys.html#sys.settrace**** > > **** > > **** > > The reason you are seeing variant results is probably due to how you have > implemented multithreading. The IronPython runtime is mostly thread-safe > (as long as you don?t use libraries that make use of mutable objects, and > as long as you import all libraries used at least once prior to forking > threads). But your code must also be thread-safe as well. From your > descriptions of your game engine, it sounds like your game engine is not > designed to be thread-safe so I would strongly recommend avoiding > multithreading as a means of providing resource sharing. It is very > difficult to write 100% thread-safe code, and nothing will stop people from > writing unsafe scripts in your game.**** > > **** > > Instead, I would suggest implementing your game engine as a turn-based > system. For each turn, the script for each character is executed > completely. This will allow you to cycle through all characters one turn at > a time, equally, and will also eliminate the problem of having variant > outcomes since the program will become deterministic.**** > > **** > > **** > > **** > > *Keith Rome***** > > *Senior Consultant and Architect***** > > MCPD-EAD, MCSD, MCDBA, MCTS-WPF, MCTS-TFS, MCTS-WSS**** > > Wintellect | 770.617.4016 | krome at wintellect.com **** > > www.wintellect.com**** > > **** > > *From:* ironpython-users-bounces+rome=wintellect.com at python.org [mailto: > ironpython-users-bounces+rome=wintellect.com at python.org] *On Behalf Of *Jesper > Taxb?l > *Sent:* Monday, July 23, 2012 11:05 AM > *To:* Kevin Hazzard > *Cc:* ironpython-users at python.org > *Subject:* Re: [Ironpython-users] Gradually executing a python script**** > > **** > > Would that allow me to step gradually through a loop?**** > > **** > > like:**** > > **** > > x = 0**** > > while x < 10:**** > > dostuff()**** > > x=x+1**** > > while x > 0:**** > > dootherstuff()**** > > x=x-1**** > > **** > > **** > > **** > > 2012/7/23 Kevin Hazzard **** > > Why don't you use a scripting host and inject commands into a ScriptEngine > reusing a ScriptScope as you need to execute them?**** > > **** > > Kevin**** > > On Mon, Jul 23, 2012 at 5:31 AM, Jesper Taxb?l wrote:* > *** > > Hi,**** > > **** > > I am not that familiar with Ironpython yet, but I have a question that I > hope you can help me answer.**** > > **** > > I am working on a programming-game where I will allow users to do some > simple python scripting against a simple API that I will control a game > character. Instructions like move and shoot etc, alongside some simple > sense functions that return info on the game world. **** > > **** > > My current prototype creates an ironpython engine for each game character > and executes the script in a thread by itself, which sort of works. But I > have the problem that the outcome of executing the game gives different > results every time. Therefore I would like to ask the question:**** > > **** > > Is it possible to execute a script inside the Ironpython engine gradually? > **** > > **** > > I imagine that I could update a list of engines with a tick(int cycles) > and get a fair sharing of resources between engines and ensure the same > result every time.**** > > **** > > Kind regards **** > > **** > > Tax**** > > **** > > **** > > P.S:**** > > As this is a programming game I would also like to be able to limit the > available memory each script is using. Is there a way to limit this, so a > script like this would be killed.**** > > **** > > x = 0**** > > v = {}**** > > while True:**** > > v[x]=x**** > > x= x + 1**** > > **** > > **** > > **** > > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users**** > > > > > -- > *W. Kevin Hazzard***** > > Consultant, Author, Teacher, Microsoft MVP**** > > (804) 928-3444**** > > book | mvp| > twitter | facebook| > linkedin | captech > **** > > **** > > **** > > ** ** > > > > > -- > *W. Kevin Hazzard***** > > Consultant, Author, Teacher, Microsoft MVP**** > > (804) 928-3444**** > > book | mvp| > twitter | facebook| > linkedin | captech > **** > > ** ** > > ** ** > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jesper at taxboel.dk Tue Jul 24 14:54:47 2012 From: jesper at taxboel.dk (=?ISO-8859-1?Q?Jesper_Taxb=F8l?=) Date: Tue, 24 Jul 2012 14:54:47 +0200 Subject: [Ironpython-users] Gradually executing a python script In-Reply-To: <727D8E16AE957149B447FE368139F2B50D8182AD@SERVER10> References: <4C554C3A47C5024ABDE00E94DA17BC4D0F8FD491@SN2PRD0710MB396.namprd07.prod.outlook.com> <727D8E16AE957149B447FE368139F2B50D8182AD@SERVER10> Message-ID: Agreed that could work :), but would still hang if a kid writes an infinite loop without actions inside. I am really into making something robust for kids to play with. Tax 2012/7/24 Markus Schaber > Hi, Jesper,**** > > ** ** > > Let me suggest some different design: Do not use variables, but offer an > ?Action? function / delegate which is provided by the hosting code, and > called by the player scripts. It gets the possible actions > (left_wheel_speed, right_wheel_speed and fire) as Parameters. Inside this > Action, you synchronize to some internal ?cycle? mechanism, e. G. 50 ticks > per second. When a player script wants to perform more than one action per > tick, the Action() function waits for the next tick to come before it > proceeds.**** > > ** ** > > Also you need to properly synchronize the input variables, one idea is > that the Action() function takes a snapshot of them after setting the > output.**** > > ** ** > > Another idea is that you could use the ?yield return? with yield > parameters ? the script yields the actions, and gets the next snapshot in > return. Here, you still can synchronize internally.**** > > ** ** > > Gr??e,**** > > Markus**** > > ** ** > > *Von:* ironpython-users-bounces+m.schaber=3s-software.com at python.org[mailto: > ironpython-users-bounces+m.schaber=3s-software.com at python.org] *Im > Auftrag von *Jesper Taxb?l > *Gesendet:* Dienstag, 24. Juli 2012 00:18 > *An:* Kevin Hazzard > *Cc:* ironpython-users at python.org > *Betreff:* Re: [Ironpython-users] Gradually executing a python script**** > > ** ** > > First of all, thank you for your time. I am not that experienced when it > comes to all the terms used in this area of software, so please be patient > with me. **** > > ** ** > > To give you a more clear idea of what I am doing I have posted a video of > the current progress here > http://www.youtube.com/watch?v=HER6WSIwSBQ&feature=youtu.be . This is a > simple gameengine, with a physics based robot. It has simple senes (A > vector to the nearest bot and the length of a raycast in front of the > robot) and three actions (left_wheel_speed, right_wheel_speed and > fire). IronPython is embeeded inside the Unity3D game engine which runs on > .NET 2.0. I am using the dll version of ironpython in the project. (I could > not figure out how to integrate the source into my game project.) **** > > ** ** > > The whole prototype was made at 48 hour game jam called "No More Sweden" > in Malm? the past weekend. **** > > **** > > I did not know that the python code is compiled in IronPython before it is > executed, and therefore will catch syntax errors before execution. That > will be very usefull. :)**** > > ** ** > > I will need to look into the settrace advice, but my gut feeling is that > it is not the direction I want to be going in. It might be later during > work on the GUI / programming interface. **** > > ** ** > > I agree that I should have a simple singlethreaded, turn based solution, > as that can be made deterministic and its far easier to implement. That is > definitely the way I want to go. The threading was only used in the > prototype because I could not execute my script gradually. I saw the > execute command as the only way to have Ironpython run my script, and saw a > thread as the only way out. (at 3 am in the morning) **** > > ** ** > > The reason I keep mentioning gradually execution requires some > backstory: The reference project I have been inspired by is an old game > called GunTactyx ( > http://www.youtube.com/watch?v=vT8PYETav7A&feature=relmfu), where you > program robots to hunt down other robots. It uses an old version of the > PAWN Language/abstract machine (http://www.compuphase.com/pawn/pawn.htm). > As far as I understand each robot there has an isolated abstract machine > with limited memory and it is ticked gradually, like you control the clock > on its CPU. If a robot crashes, has an infinite loop or a memory leak it > does not affect the cpu in the other robots. The reason I am not using PAWN > is that it is C++ based and my target platform runs .NET 2.0. Besides that > I prefer Python over the PAWN language.**** > > ** ** > > Kevin: When you say statemachine, I imagined Ironpython had something of > that sort inside its belly? That might be where I am wrong. Is a > statemachine and an abstract machine the same thing in this context?**** > > ** ** > > With regard to the dostuff() functions, I dont mind the robots firing many > instructions at a time. I just need to be able to let the robots run the > same number of "ticks" between each game cycle. I imagine assigning a tick > cost to the dostuff() functions, as they probably will do stuff inside the > game world. **** > > ** ** > > I have been looking at other solutions to allow me to make a programming > game. During the 48 hours I briefly used the AluminumLua project which I > was able to tick, but it lacked debelopment on the language side. (for > loops was not implemented) I would prefer to stick to Pythoon as I love the > language and I feel it contains the elements needed to write an > interristing AI. **** > > ** ** > > I need to read up on the IronPython system and have therefore just > ordered "Ironpython in action" book, I hope it will give me a better > understanding. Other recommendations are welcome.**** > > ** ** > > Kind regards and thank you again for your feedback.**** > > ** ** > > Tax**** > > ** ** > > **** > > ** ** > > 2012/7/23 Kevin Hazzard **** > > What you're describing is a state machine. There are many ways to build > such a thing and honestly, I've never thought of single-stepping through > code as a way to do that. It's actually quite an intriguing idea, if not > inefficient. But efficiency isn't always measured with elegance (and vice > versa). Keith's settrace idea is good, too. You should check that out.**** > > **** > > What it really comes down to is this: do you want the controller to also > define the code or merely to drive it? For the example you posted, do you > want the while loops implemented in Python to execute your dostuff() and > dootherstuff() methods? Or do you want the controller that authorizes a > "step" to do that? In that context, you could write the controller in > Python, too, but the design of your code would look very different than > what you proposed.**** > > **** > > Kevin**** > > On Mon, Jul 23, 2012 at 1:48 PM, Jesper Taxb?l wrote:* > *** > > The reason I want to do it gradually is that I cant be sure that the > script ever terminates or has syntax errors. Would that not be a problem in > a turn based setup? **** > > ** ** > > 2012/7/23 Keith Rome **** > > You may want to look into leveraging the sys.settrace() feature of Python > for controlling line-by-line execution. This API allows you to install a > profiling function that gets invoked for every frame of script code that is > executed. In your profiling function, you could compute the amount of > memory being used by variables within the ScriptScope, and halt execution > if you need to. Just be careful about what you do in your profiling > function, as it will be called extremely often by the runtime.**** > > **** > > http://docs.python.org/library/sys.html#sys.settrace**** > > **** > > **** > > The reason you are seeing variant results is probably due to how you have > implemented multithreading. The IronPython runtime is mostly thread-safe > (as long as you don?t use libraries that make use of mutable objects, and > as long as you import all libraries used at least once prior to forking > threads). But your code must also be thread-safe as well. From your > descriptions of your game engine, it sounds like your game engine is not > designed to be thread-safe so I would strongly recommend avoiding > multithreading as a means of providing resource sharing. It is very > difficult to write 100% thread-safe code, and nothing will stop people from > writing unsafe scripts in your game.**** > > **** > > Instead, I would suggest implementing your game engine as a turn-based > system. For each turn, the script for each character is executed > completely. This will allow you to cycle through all characters one turn at > a time, equally, and will also eliminate the problem of having variant > outcomes since the program will become deterministic.**** > > **** > > **** > > **** > > *Keith Rome***** > > *Senior Consultant and Architect***** > > MCPD-EAD, MCSD, MCDBA, MCTS-WPF, MCTS-TFS, MCTS-WSS**** > > Wintellect | 770.617.4016 | krome at wintellect.com **** > > www.wintellect.com**** > > **** > > *From:* ironpython-users-bounces+rome=wintellect.com at python.org [mailto: > ironpython-users-bounces+rome=wintellect.com at python.org] *On Behalf Of *Jesper > Taxb?l > *Sent:* Monday, July 23, 2012 11:05 AM > *To:* Kevin Hazzard > *Cc:* ironpython-users at python.org > *Subject:* Re: [Ironpython-users] Gradually executing a python script**** > > **** > > Would that allow me to step gradually through a loop?**** > > **** > > like:**** > > **** > > x = 0**** > > while x < 10:**** > > dostuff()**** > > x=x+1**** > > while x > 0:**** > > dootherstuff()**** > > x=x-1**** > > **** > > **** > > **** > > 2012/7/23 Kevin Hazzard **** > > Why don't you use a scripting host and inject commands into a ScriptEngine > reusing a ScriptScope as you need to execute them?**** > > **** > > Kevin**** > > On Mon, Jul 23, 2012 at 5:31 AM, Jesper Taxb?l wrote:* > *** > > Hi,**** > > **** > > I am not that familiar with Ironpython yet, but I have a question that I > hope you can help me answer.**** > > **** > > I am working on a programming-game where I will allow users to do some > simple python scripting against a simple API that I will control a game > character. Instructions like move and shoot etc, alongside some simple > sense functions that return info on the game world. **** > > **** > > My current prototype creates an ironpython engine for each game character > and executes the script in a thread by itself, which sort of works. But I > have the problem that the outcome of executing the game gives different > results every time. Therefore I would like to ask the question:**** > > **** > > Is it possible to execute a script inside the Ironpython engine gradually? > **** > > **** > > I imagine that I could update a list of engines with a tick(int cycles) > and get a fair sharing of resources between engines and ensure the same > result every time.**** > > **** > > Kind regards **** > > **** > > Tax**** > > **** > > **** > > P.S:**** > > As this is a programming game I would also like to be able to limit the > available memory each script is using. Is there a way to limit this, so a > script like this would be killed.**** > > **** > > x = 0**** > > v = {}**** > > while True:**** > > v[x]=x**** > > x= x + 1**** > > **** > > **** > > **** > > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users**** > > > > > -- > *W. Kevin Hazzard***** > > Consultant, Author, Teacher, Microsoft MVP**** > > (804) 928-3444**** > > book | mvp| > twitter | facebook| > linkedin | captech > **** > > **** > > **** > > ** ** > > > > > -- > *W. Kevin Hazzard***** > > Consultant, Author, Teacher, Microsoft MVP**** > > (804) 928-3444**** > > book | mvp| > twitter | facebook| > linkedin | captech > **** > > ** ** > > ** ** > -------------- next part -------------- An HTML attachment was scrubbed... URL: From m.schaber at 3s-software.com Tue Jul 24 15:07:47 2012 From: m.schaber at 3s-software.com (Markus Schaber) Date: Tue, 24 Jul 2012 13:07:47 +0000 Subject: [Ironpython-users] Gradually executing a python script In-Reply-To: References: <4C554C3A47C5024ABDE00E94DA17BC4D0F8FD491@SN2PRD0710MB396.namprd07.prod.outlook.com> <727D8E16AE957149B447FE368139F2B50D8182AD@SERVER10> Message-ID: <727D8E16AE957149B447FE368139F2B50D8182CA@SERVER10> Hi, Tax, If you run each of those scripts in its own thread, possibly encapsulated into its own app domain, then only the player script "hangs", and not the whole application. You could also use rather strong methods like "Thread.Abort()" or "AppDomain.Unload()" to clean up player scripts which don't play nicely. Gr??e, Markus Von: Jesper Taxb?l [mailto:jesper at taxboel.dk] Gesendet: Dienstag, 24. Juli 2012 14:55 An: Markus Schaber Cc: ironpython-users at python.org Betreff: Re: [Ironpython-users] Gradually executing a python script Agreed that could work :), but would still hang if a kid writes an infinite loop without actions inside. I am really into making something robust for kids to play with. Tax 2012/7/24 Markus Schaber > Hi, Jesper, Let me suggest some different design: Do not use variables, but offer an "Action" function / delegate which is provided by the hosting code, and called by the player scripts. It gets the possible actions (left_wheel_speed, right_wheel_speed and fire) as Parameters. Inside this Action, you synchronize to some internal "cycle" mechanism, e. G. 50 ticks per second. When a player script wants to perform more than one action per tick, the Action() function waits for the next tick to come before it proceeds. Also you need to properly synchronize the input variables, one idea is that the Action() function takes a snapshot of them after setting the output. Another idea is that you could use the "yield return" with yield parameters - the script yields the actions, and gets the next snapshot in return. Here, you still can synchronize internally. Gr??e, Markus Von: ironpython-users-bounces+m.schaber=3s-software.com at python.org [mailto:ironpython-users-bounces+m.schaber=3s-software.com at python.org] Im Auftrag von Jesper Taxb?l Gesendet: Dienstag, 24. Juli 2012 00:18 An: Kevin Hazzard Cc: ironpython-users at python.org Betreff: Re: [Ironpython-users] Gradually executing a python script First of all, thank you for your time. I am not that experienced when it comes to all the terms used in this area of software, so please be patient with me. To give you a more clear idea of what I am doing I have posted a video of the current progress here http://www.youtube.com/watch?v=HER6WSIwSBQ&feature=youtu.be . This is a simple gameengine, with a physics based robot. It has simple senes (A vector to the nearest bot and the length of a raycast in front of the robot) and three actions (left_wheel_speed, right_wheel_speed and fire). IronPython is embeeded inside the Unity3D game engine which runs on .NET 2.0. I am using the dll version of ironpython in the project. (I could not figure out how to integrate the source into my game project.) The whole prototype was made at 48 hour game jam called "No More Sweden" in Malm? the past weekend. I did not know that the python code is compiled in IronPython before it is executed, and therefore will catch syntax errors before execution. That will be very usefull. :) I will need to look into the settrace advice, but my gut feeling is that it is not the direction I want to be going in. It might be later during work on the GUI / programming interface. I agree that I should have a simple singlethreaded, turn based solution, as that can be made deterministic and its far easier to implement. That is definitely the way I want to go. The threading was only used in the prototype because I could not execute my script gradually. I saw the execute command as the only way to have Ironpython run my script, and saw a thread as the only way out. (at 3 am in the morning) The reason I keep mentioning gradually execution requires some backstory: The reference project I have been inspired by is an old game called GunTactyx (http://www.youtube.com/watch?v=vT8PYETav7A&feature=relmfu), where you program robots to hunt down other robots. It uses an old version of the PAWN Language/abstract machine (http://www.compuphase.com/pawn/pawn.htm). As far as I understand each robot there has an isolated abstract machine with limited memory and it is ticked gradually, like you control the clock on its CPU. If a robot crashes, has an infinite loop or a memory leak it does not affect the cpu in the other robots. The reason I am not using PAWN is that it is C++ based and my target platform runs .NET 2.0. Besides that I prefer Python over the PAWN language. Kevin: When you say statemachine, I imagined Ironpython had something of that sort inside its belly? That might be where I am wrong. Is a statemachine and an abstract machine the same thing in this context? With regard to the dostuff() functions, I dont mind the robots firing many instructions at a time. I just need to be able to let the robots run the same number of "ticks" between each game cycle. I imagine assigning a tick cost to the dostuff() functions, as they probably will do stuff inside the game world. I have been looking at other solutions to allow me to make a programming game. During the 48 hours I briefly used the AluminumLua project which I was able to tick, but it lacked debelopment on the language side. (for loops was not implemented) I would prefer to stick to Pythoon as I love the language and I feel it contains the elements needed to write an interristing AI. I need to read up on the IronPython system and have therefore just ordered "Ironpython in action" book, I hope it will give me a better understanding. Other recommendations are welcome. Kind regards and thank you again for your feedback. Tax 2012/7/23 Kevin Hazzard > What you're describing is a state machine. There are many ways to build such a thing and honestly, I've never thought of single-stepping through code as a way to do that. It's actually quite an intriguing idea, if not inefficient. But efficiency isn't always measured with elegance (and vice versa). Keith's settrace idea is good, too. You should check that out. What it really comes down to is this: do you want the controller to also define the code or merely to drive it? For the example you posted, do you want the while loops implemented in Python to execute your dostuff() and dootherstuff() methods? Or do you want the controller that authorizes a "step" to do that? In that context, you could write the controller in Python, too, but the design of your code would look very different than what you proposed. Kevin On Mon, Jul 23, 2012 at 1:48 PM, Jesper Taxb?l > wrote: The reason I want to do it gradually is that I cant be sure that the script ever terminates or has syntax errors. Would that not be a problem in a turn based setup? 2012/7/23 Keith Rome > You may want to look into leveraging the sys.settrace() feature of Python for controlling line-by-line execution. This API allows you to install a profiling function that gets invoked for every frame of script code that is executed. In your profiling function, you could compute the amount of memory being used by variables within the ScriptScope, and halt execution if you need to. Just be careful about what you do in your profiling function, as it will be called extremely often by the runtime. http://docs.python.org/library/sys.html#sys.settrace The reason you are seeing variant results is probably due to how you have implemented multithreading. The IronPython runtime is mostly thread-safe (as long as you don't use libraries that make use of mutable objects, and as long as you import all libraries used at least once prior to forking threads). But your code must also be thread-safe as well. From your descriptions of your game engine, it sounds like your game engine is not designed to be thread-safe so I would strongly recommend avoiding multithreading as a means of providing resource sharing. It is very difficult to write 100% thread-safe code, and nothing will stop people from writing unsafe scripts in your game. Instead, I would suggest implementing your game engine as a turn-based system. For each turn, the script for each character is executed completely. This will allow you to cycle through all characters one turn at a time, equally, and will also eliminate the problem of having variant outcomes since the program will become deterministic. Keith Rome Senior Consultant and Architect MCPD-EAD, MCSD, MCDBA, MCTS-WPF, MCTS-TFS, MCTS-WSS Wintellect | 770.617.4016 | krome at wintellect.com www.wintellect.com From: ironpython-users-bounces+rome=wintellect.com at python.org [mailto:ironpython-users-bounces+rome=wintellect.com at python.org] On Behalf Of Jesper Taxb?l Sent: Monday, July 23, 2012 11:05 AM To: Kevin Hazzard Cc: ironpython-users at python.org Subject: Re: [Ironpython-users] Gradually executing a python script Would that allow me to step gradually through a loop? like: x = 0 while x < 10: dostuff() x=x+1 while x > 0: dootherstuff() x=x-1 2012/7/23 Kevin Hazzard > Why don't you use a scripting host and inject commands into a ScriptEngine reusing a ScriptScope as you need to execute them? Kevin On Mon, Jul 23, 2012 at 5:31 AM, Jesper Taxb?l > wrote: Hi, I am not that familiar with Ironpython yet, but I have a question that I hope you can help me answer. I am working on a programming-game where I will allow users to do some simple python scripting against a simple API that I will control a game character. Instructions like move and shoot etc, alongside some simple sense functions that return info on the game world. My current prototype creates an ironpython engine for each game character and executes the script in a thread by itself, which sort of works. But I have the problem that the outcome of executing the game gives different results every time. Therefore I would like to ask the question: Is it possible to execute a script inside the Ironpython engine gradually? I imagine that I could update a list of engines with a tick(int cycles) and get a fair sharing of resources between engines and ensure the same result every time. Kind regards Tax P.S: As this is a programming game I would also like to be able to limit the available memory each script is using. Is there a way to limit this, so a script like this would be killed. x = 0 v = {} while True: v[x]=x x= x + 1 _______________________________________________ Ironpython-users mailing list Ironpython-users at python.org http://mail.python.org/mailman/listinfo/ironpython-users -- W. Kevin Hazzard Consultant, Author, Teacher, Microsoft MVP (804) 928-3444 book | mvp | twitter | facebook | linkedin | captech -- W. Kevin Hazzard Consultant, Author, Teacher, Microsoft MVP (804) 928-3444 book | mvp | twitter | facebook | linkedin | captech -------------- next part -------------- An HTML attachment was scrubbed... URL: From m.schaber at 3s-software.com Tue Jul 24 14:48:22 2012 From: m.schaber at 3s-software.com (Markus Schaber) Date: Tue, 24 Jul 2012 12:48:22 +0000 Subject: [Ironpython-users] Gradually executing a python script In-Reply-To: References: <4C554C3A47C5024ABDE00E94DA17BC4D0F8FD491@SN2PRD0710MB396.namprd07.prod.outlook.com> Message-ID: <727D8E16AE957149B447FE368139F2B50D8182AD@SERVER10> Hi, Jesper, Let me suggest some different design: Do not use variables, but offer an "Action" function / delegate which is provided by the hosting code, and called by the player scripts. It gets the possible actions (left_wheel_speed, right_wheel_speed and fire) as Parameters. Inside this Action, you synchronize to some internal "cycle" mechanism, e. G. 50 ticks per second. When a player script wants to perform more than one action per tick, the Action() function waits for the next tick to come before it proceeds. Also you need to properly synchronize the input variables, one idea is that the Action() function takes a snapshot of them after setting the output. Another idea is that you could use the "yield return" with yield parameters - the script yields the actions, and gets the next snapshot in return. Here, you still can synchronize internally. Gr??e, Markus Von: ironpython-users-bounces+m.schaber=3s-software.com at python.org [mailto:ironpython-users-bounces+m.schaber=3s-software.com at python.org] Im Auftrag von Jesper Taxb?l Gesendet: Dienstag, 24. Juli 2012 00:18 An: Kevin Hazzard Cc: ironpython-users at python.org Betreff: Re: [Ironpython-users] Gradually executing a python script First of all, thank you for your time. I am not that experienced when it comes to all the terms used in this area of software, so please be patient with me. To give you a more clear idea of what I am doing I have posted a video of the current progress here http://www.youtube.com/watch?v=HER6WSIwSBQ&feature=youtu.be . This is a simple gameengine, with a physics based robot. It has simple senes (A vector to the nearest bot and the length of a raycast in front of the robot) and three actions (left_wheel_speed, right_wheel_speed and fire). IronPython is embeeded inside the Unity3D game engine which runs on .NET 2.0. I am using the dll version of ironpython in the project. (I could not figure out how to integrate the source into my game project.) The whole prototype was made at 48 hour game jam called "No More Sweden" in Malm? the past weekend. I did not know that the python code is compiled in IronPython before it is executed, and therefore will catch syntax errors before execution. That will be very usefull. :) I will need to look into the settrace advice, but my gut feeling is that it is not the direction I want to be going in. It might be later during work on the GUI / programming interface. I agree that I should have a simple singlethreaded, turn based solution, as that can be made deterministic and its far easier to implement. That is definitely the way I want to go. The threading was only used in the prototype because I could not execute my script gradually. I saw the execute command as the only way to have Ironpython run my script, and saw a thread as the only way out. (at 3 am in the morning) The reason I keep mentioning gradually execution requires some backstory: The reference project I have been inspired by is an old game called GunTactyx (http://www.youtube.com/watch?v=vT8PYETav7A&feature=relmfu), where you program robots to hunt down other robots. It uses an old version of the PAWN Language/abstract machine (http://www.compuphase.com/pawn/pawn.htm). As far as I understand each robot there has an isolated abstract machine with limited memory and it is ticked gradually, like you control the clock on its CPU. If a robot crashes, has an infinite loop or a memory leak it does not affect the cpu in the other robots. The reason I am not using PAWN is that it is C++ based and my target platform runs .NET 2.0. Besides that I prefer Python over the PAWN language. Kevin: When you say statemachine, I imagined Ironpython had something of that sort inside its belly? That might be where I am wrong. Is a statemachine and an abstract machine the same thing in this context? With regard to the dostuff() functions, I dont mind the robots firing many instructions at a time. I just need to be able to let the robots run the same number of "ticks" between each game cycle. I imagine assigning a tick cost to the dostuff() functions, as they probably will do stuff inside the game world. I have been looking at other solutions to allow me to make a programming game. During the 48 hours I briefly used the AluminumLua project which I was able to tick, but it lacked debelopment on the language side. (for loops was not implemented) I would prefer to stick to Pythoon as I love the language and I feel it contains the elements needed to write an interristing AI. I need to read up on the IronPython system and have therefore just ordered "Ironpython in action" book, I hope it will give me a better understanding. Other recommendations are welcome. Kind regards and thank you again for your feedback. Tax 2012/7/23 Kevin Hazzard > What you're describing is a state machine. There are many ways to build such a thing and honestly, I've never thought of single-stepping through code as a way to do that. It's actually quite an intriguing idea, if not inefficient. But efficiency isn't always measured with elegance (and vice versa). Keith's settrace idea is good, too. You should check that out. What it really comes down to is this: do you want the controller to also define the code or merely to drive it? For the example you posted, do you want the while loops implemented in Python to execute your dostuff() and dootherstuff() methods? Or do you want the controller that authorizes a "step" to do that? In that context, you could write the controller in Python, too, but the design of your code would look very different than what you proposed. Kevin On Mon, Jul 23, 2012 at 1:48 PM, Jesper Taxb?l > wrote: The reason I want to do it gradually is that I cant be sure that the script ever terminates or has syntax errors. Would that not be a problem in a turn based setup? 2012/7/23 Keith Rome > You may want to look into leveraging the sys.settrace() feature of Python for controlling line-by-line execution. This API allows you to install a profiling function that gets invoked for every frame of script code that is executed. In your profiling function, you could compute the amount of memory being used by variables within the ScriptScope, and halt execution if you need to. Just be careful about what you do in your profiling function, as it will be called extremely often by the runtime. http://docs.python.org/library/sys.html#sys.settrace The reason you are seeing variant results is probably due to how you have implemented multithreading. The IronPython runtime is mostly thread-safe (as long as you don't use libraries that make use of mutable objects, and as long as you import all libraries used at least once prior to forking threads). But your code must also be thread-safe as well. From your descriptions of your game engine, it sounds like your game engine is not designed to be thread-safe so I would strongly recommend avoiding multithreading as a means of providing resource sharing. It is very difficult to write 100% thread-safe code, and nothing will stop people from writing unsafe scripts in your game. Instead, I would suggest implementing your game engine as a turn-based system. For each turn, the script for each character is executed completely. This will allow you to cycle through all characters one turn at a time, equally, and will also eliminate the problem of having variant outcomes since the program will become deterministic. Keith Rome Senior Consultant and Architect MCPD-EAD, MCSD, MCDBA, MCTS-WPF, MCTS-TFS, MCTS-WSS Wintellect | 770.617.4016 | krome at wintellect.com www.wintellect.com From: ironpython-users-bounces+rome=wintellect.com at python.org [mailto:ironpython-users-bounces+rome=wintellect.com at python.org] On Behalf Of Jesper Taxb?l Sent: Monday, July 23, 2012 11:05 AM To: Kevin Hazzard Cc: ironpython-users at python.org Subject: Re: [Ironpython-users] Gradually executing a python script Would that allow me to step gradually through a loop? like: x = 0 while x < 10: dostuff() x=x+1 while x > 0: dootherstuff() x=x-1 2012/7/23 Kevin Hazzard > Why don't you use a scripting host and inject commands into a ScriptEngine reusing a ScriptScope as you need to execute them? Kevin On Mon, Jul 23, 2012 at 5:31 AM, Jesper Taxb?l > wrote: Hi, I am not that familiar with Ironpython yet, but I have a question that I hope you can help me answer. I am working on a programming-game where I will allow users to do some simple python scripting against a simple API that I will control a game character. Instructions like move and shoot etc, alongside some simple sense functions that return info on the game world. My current prototype creates an ironpython engine for each game character and executes the script in a thread by itself, which sort of works. But I have the problem that the outcome of executing the game gives different results every time. Therefore I would like to ask the question: Is it possible to execute a script inside the Ironpython engine gradually? I imagine that I could update a list of engines with a tick(int cycles) and get a fair sharing of resources between engines and ensure the same result every time. Kind regards Tax P.S: As this is a programming game I would also like to be able to limit the available memory each script is using. Is there a way to limit this, so a script like this would be killed. x = 0 v = {} while True: v[x]=x x= x + 1 _______________________________________________ Ironpython-users mailing list Ironpython-users at python.org http://mail.python.org/mailman/listinfo/ironpython-users -- W. Kevin Hazzard Consultant, Author, Teacher, Microsoft MVP (804) 928-3444 book | mvp | twitter | facebook | linkedin | captech -- W. Kevin Hazzard Consultant, Author, Teacher, Microsoft MVP (804) 928-3444 book | mvp | twitter | facebook | linkedin | captech -------------- next part -------------- An HTML attachment was scrubbed... URL: From jesper at taxboel.dk Tue Jul 24 15:59:30 2012 From: jesper at taxboel.dk (=?ISO-8859-1?Q?Jesper_Taxb=F8l?=) Date: Tue, 24 Jul 2012 15:59:30 +0200 Subject: [Ironpython-users] Gradually executing a python script In-Reply-To: <727D8E16AE957149B447FE368139F2B50D8182CA@SERVER10> References: <4C554C3A47C5024ABDE00E94DA17BC4D0F8FD491@SN2PRD0710MB396.namprd07.prod.outlook.com> <727D8E16AE957149B447FE368139F2B50D8182AD@SERVER10> <727D8E16AE957149B447FE368139F2B50D8182CA@SERVER10> Message-ID: That seems to be a good idea. I actually researched it a bit last night. It still has some issues, but seems to be easier than finding an abstract machine. As I see it. Threads will still affect eachother depending on how much cpu they consume and it will be non deterministic. But besides that it could work. :))) Tax Only problem I see here is that scripts will have different number of "cycle" 2012/7/24 Markus Schaber > Hi, Tax,**** > > ** ** > > If you run each of those scripts in its own thread, possibly encapsulated > into its own app domain, then only the player script ?hangs?, and not the > whole application.**** > > ** ** > > You could also use rather strong methods like ?Thread.Abort()? or > ?AppDomain.Unload()? to clean up player scripts which don?t play nicely.** > ** > > ** ** > > Gr??e,**** > > Markus**** > > ** ** > > *Von:* Jesper Taxb?l [mailto:jesper at taxboel.dk] > *Gesendet:* Dienstag, 24. Juli 2012 14:55 > *An:* Markus Schaber > > *Cc:* ironpython-users at python.org > *Betreff:* Re: [Ironpython-users] Gradually executing a python script**** > > ** ** > > Agreed that could work :), but would still hang if a kid writes an > infinite loop without actions inside.**** > > ** ** > > I am really into making something robust for kids to play with.**** > > ** ** > > Tax > > **** > > 2012/7/24 Markus Schaber **** > > Hi, Jesper,**** > > **** > > Let me suggest some different design: Do not use variables, but offer an > ?Action? function / delegate which is provided by the hosting code, and > called by the player scripts. It gets the possible actions > (left_wheel_speed, right_wheel_speed and fire) as Parameters. Inside this > Action, you synchronize to some internal ?cycle? mechanism, e. G. 50 ticks > per second. When a player script wants to perform more than one action per > tick, the Action() function waits for the next tick to come before it > proceeds.**** > > **** > > Also you need to properly synchronize the input variables, one idea is > that the Action() function takes a snapshot of them after setting the > output.**** > > **** > > Another idea is that you could use the ?yield return? with yield > parameters ? the script yields the actions, and gets the next snapshot in > return. Here, you still can synchronize internally.**** > > **** > > Gr??e,**** > > Markus**** > > **** > > *Von:* ironpython-users-bounces+m.schaber=3s-software.com at python.org[mailto: > ironpython-users-bounces+m.schaber=3s-software.com at python.org] *Im > Auftrag von *Jesper Taxb?l > *Gesendet:* Dienstag, 24. Juli 2012 00:18 > *An:* Kevin Hazzard > *Cc:* ironpython-users at python.org > *Betreff:* Re: [Ironpython-users] Gradually executing a python script**** > > **** > > First of all, thank you for your time. I am not that experienced when it > comes to all the terms used in this area of software, so please be patient > with me. **** > > **** > > To give you a more clear idea of what I am doing I have posted a video of > the current progress here > http://www.youtube.com/watch?v=HER6WSIwSBQ&feature=youtu.be . This is a > simple gameengine, with a physics based robot. It has simple senes (A > vector to the nearest bot and the length of a raycast in front of the > robot) and three actions (left_wheel_speed, right_wheel_speed and > fire). IronPython is embeeded inside the Unity3D game engine which runs on > .NET 2.0. I am using the dll version of ironpython in the project. (I could > not figure out how to integrate the source into my game project.) **** > > **** > > The whole prototype was made at 48 hour game jam called "No More Sweden" > in Malm? the past weekend. **** > > **** > > I did not know that the python code is compiled in IronPython before it is > executed, and therefore will catch syntax errors before execution. That > will be very usefull. :)**** > > **** > > I will need to look into the settrace advice, but my gut feeling is that > it is not the direction I want to be going in. It might be later during > work on the GUI / programming interface. **** > > **** > > I agree that I should have a simple singlethreaded, turn based solution, > as that can be made deterministic and its far easier to implement. That is > definitely the way I want to go. The threading was only used in the > prototype because I could not execute my script gradually. I saw the > execute command as the only way to have Ironpython run my script, and saw a > thread as the only way out. (at 3 am in the morning) **** > > **** > > The reason I keep mentioning gradually execution requires some > backstory: The reference project I have been inspired by is an old game > called GunTactyx ( > http://www.youtube.com/watch?v=vT8PYETav7A&feature=relmfu), where you > program robots to hunt down other robots. It uses an old version of the > PAWN Language/abstract machine (http://www.compuphase.com/pawn/pawn.htm). > As far as I understand each robot there has an isolated abstract machine > with limited memory and it is ticked gradually, like you control the clock > on its CPU. If a robot crashes, has an infinite loop or a memory leak it > does not affect the cpu in the other robots. The reason I am not using PAWN > is that it is C++ based and my target platform runs .NET 2.0. Besides that > I prefer Python over the PAWN language.**** > > **** > > Kevin: When you say statemachine, I imagined Ironpython had something of > that sort inside its belly? That might be where I am wrong. Is a > statemachine and an abstract machine the same thing in this context?**** > > **** > > With regard to the dostuff() functions, I dont mind the robots firing many > instructions at a time. I just need to be able to let the robots run the > same number of "ticks" between each game cycle. I imagine assigning a tick > cost to the dostuff() functions, as they probably will do stuff inside the > game world. **** > > **** > > I have been looking at other solutions to allow me to make a programming > game. During the 48 hours I briefly used the AluminumLua project which I > was able to tick, but it lacked debelopment on the language side. (for > loops was not implemented) I would prefer to stick to Pythoon as I love the > language and I feel it contains the elements needed to write an > interristing AI. **** > > **** > > I need to read up on the IronPython system and have therefore just > ordered "Ironpython in action" book, I hope it will give me a better > understanding. Other recommendations are welcome.**** > > **** > > Kind regards and thank you again for your feedback.**** > > **** > > Tax**** > > **** > > **** > > **** > > 2012/7/23 Kevin Hazzard **** > > What you're describing is a state machine. There are many ways to build > such a thing and honestly, I've never thought of single-stepping through > code as a way to do that. It's actually quite an intriguing idea, if not > inefficient. But efficiency isn't always measured with elegance (and vice > versa). Keith's settrace idea is good, too. You should check that out.**** > > **** > > What it really comes down to is this: do you want the controller to also > define the code or merely to drive it? For the example you posted, do you > want the while loops implemented in Python to execute your dostuff() and > dootherstuff() methods? Or do you want the controller that authorizes a > "step" to do that? In that context, you could write the controller in > Python, too, but the design of your code would look very different than > what you proposed.**** > > **** > > Kevin**** > > On Mon, Jul 23, 2012 at 1:48 PM, Jesper Taxb?l wrote:* > *** > > The reason I want to do it gradually is that I cant be sure that the > script ever terminates or has syntax errors. Would that not be a problem in > a turn based setup? **** > > **** > > 2012/7/23 Keith Rome **** > > You may want to look into leveraging the sys.settrace() feature of Python > for controlling line-by-line execution. This API allows you to install a > profiling function that gets invoked for every frame of script code that is > executed. In your profiling function, you could compute the amount of > memory being used by variables within the ScriptScope, and halt execution > if you need to. Just be careful about what you do in your profiling > function, as it will be called extremely often by the runtime.**** > > **** > > http://docs.python.org/library/sys.html#sys.settrace**** > > **** > > **** > > The reason you are seeing variant results is probably due to how you have > implemented multithreading. The IronPython runtime is mostly thread-safe > (as long as you don?t use libraries that make use of mutable objects, and > as long as you import all libraries used at least once prior to forking > threads). But your code must also be thread-safe as well. From your > descriptions of your game engine, it sounds like your game engine is not > designed to be thread-safe so I would strongly recommend avoiding > multithreading as a means of providing resource sharing. It is very > difficult to write 100% thread-safe code, and nothing will stop people from > writing unsafe scripts in your game.**** > > **** > > Instead, I would suggest implementing your game engine as a turn-based > system. For each turn, the script for each character is executed > completely. This will allow you to cycle through all characters one turn at > a time, equally, and will also eliminate the problem of having variant > outcomes since the program will become deterministic.**** > > **** > > **** > > **** > > *Keith Rome***** > > *Senior Consultant and Architect***** > > MCPD-EAD, MCSD, MCDBA, MCTS-WPF, MCTS-TFS, MCTS-WSS**** > > Wintellect | 770.617.4016 | krome at wintellect.com **** > > www.wintellect.com**** > > **** > > *From:* ironpython-users-bounces+rome=wintellect.com at python.org [mailto: > ironpython-users-bounces+rome=wintellect.com at python.org] *On Behalf Of *Jesper > Taxb?l > *Sent:* Monday, July 23, 2012 11:05 AM > *To:* Kevin Hazzard > *Cc:* ironpython-users at python.org > *Subject:* Re: [Ironpython-users] Gradually executing a python script**** > > **** > > Would that allow me to step gradually through a loop?**** > > **** > > like:**** > > **** > > x = 0**** > > while x < 10:**** > > dostuff()**** > > x=x+1**** > > while x > 0:**** > > dootherstuff()**** > > x=x-1**** > > **** > > **** > > **** > > 2012/7/23 Kevin Hazzard **** > > Why don't you use a scripting host and inject commands into a ScriptEngine > reusing a ScriptScope as you need to execute them?**** > > **** > > Kevin**** > > On Mon, Jul 23, 2012 at 5:31 AM, Jesper Taxb?l wrote:* > *** > > Hi,**** > > **** > > I am not that familiar with Ironpython yet, but I have a question that I > hope you can help me answer.**** > > **** > > I am working on a programming-game where I will allow users to do some > simple python scripting against a simple API that I will control a game > character. Instructions like move and shoot etc, alongside some simple > sense functions that return info on the game world. **** > > **** > > My current prototype creates an ironpython engine for each game character > and executes the script in a thread by itself, which sort of works. But I > have the problem that the outcome of executing the game gives different > results every time. Therefore I would like to ask the question:**** > > **** > > Is it possible to execute a script inside the Ironpython engine gradually? > **** > > **** > > I imagine that I could update a list of engines with a tick(int cycles) > and get a fair sharing of resources between engines and ensure the same > result every time.**** > > **** > > Kind regards **** > > **** > > Tax**** > > **** > > **** > > P.S:**** > > As this is a programming game I would also like to be able to limit the > available memory each script is using. Is there a way to limit this, so a > script like this would be killed.**** > > **** > > x = 0**** > > v = {}**** > > while True:**** > > v[x]=x**** > > x= x + 1**** > > **** > > **** > > **** > > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users**** > > > > > -- > *W. Kevin Hazzard***** > > Consultant, Author, Teacher, Microsoft MVP**** > > (804) 928-3444**** > > book | mvp| > twitter | facebook| > linkedin | captech > **** > > **** > > **** > > **** > > > > > -- > *W. Kevin Hazzard***** > > Consultant, Author, Teacher, Microsoft MVP**** > > (804) 928-3444**** > > book | mvp| > twitter | facebook| > linkedin | captech > **** > > **** > > **** > > ** ** > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdhardy at gmail.com Tue Jul 24 20:22:42 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Tue, 24 Jul 2012 11:22:42 -0700 Subject: [Ironpython-users] Gradually executing a python script In-Reply-To: <727D8E16AE957149B447FE368139F2B50D8182AD@SERVER10> References: <4C554C3A47C5024ABDE00E94DA17BC4D0F8FD491@SN2PRD0710MB396.namprd07.prod.outlook.com> <727D8E16AE957149B447FE368139F2B50D8182AD@SERVER10> Message-ID: On Tue, Jul 24, 2012 at 5:48 AM, Markus Schaber wrote: > Another idea is that you could use the ?yield return? with yield parameters > ? the script yields the actions, and gets the next snapshot in return. Here, > you still can synchronize internally. IIRC, this is how UnrealScript works. It's a bit mind-bending at first if you learned "traditional" programming, but if you're teaching kids their minds are free to warp as needed. :) David Beazley has some great background on how to do this: http://www.dabeaz.com/generators-uk/index.html http://www.dabeaz.com/coroutines/index.html (this one, especially, is relevant) I won't say it's easy, because it's not, but it's incredibly powerful. Here's a basic overview: you need your scripts to yield back to the host system at some point, and get an updated state. Using yield, that would look like: def robot_ccw(): state = yield None while True: state = yield actions.turn_left Obviously a real robot would use 'state' to determine what to do, but that's the idea. Your host then looks like: def turn(state): for robot in robots: action = robot.send(state) do_action(robot, action) On Tue, Jul 24, 2012 at 5:54 AM, Jesper Taxb?l wrote: > Agreed that could work :), but would still hang if a kid writes an infinite > loop without actions inside. > > I am really into making something robust for kids to play with. > sys.settrace is your friend here. Basically, if a robot tries to execute too many lines between yields (i.e. per turn), remove it from the list of valid robots and show an error. - Jeff From jdhardy at gmail.com Tue Jul 24 20:23:41 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Tue, 24 Jul 2012 11:23:41 -0700 Subject: [Ironpython-users] Gradually executing a python script In-Reply-To: References: <4C554C3A47C5024ABDE00E94DA17BC4D0F8FD491@SN2PRD0710MB396.namprd07.prod.outlook.com> <727D8E16AE957149B447FE368139F2B50D8182AD@SERVER10> Message-ID: On Tue, Jul 24, 2012 at 11:22 AM, Jeff Hardy wrote: > On Tue, Jul 24, 2012 at 5:54 AM, Jesper Taxb?l wrote: >> Agreed that could work :), but would still hang if a kid writes an infinite >> loop without actions inside. >> >> I am really into making something robust for kids to play with. >> > > sys.settrace is your friend here. Basically, if a robot tries to > execute too many lines between yields (i.e. per turn), remove it from > the list of valid robots and show an error. Forgot to add: http://www.doughellmann.com/PyMOTW/sys/tracing.html - Jeff From m.schaber at 3s-software.com Wed Jul 25 09:06:34 2012 From: m.schaber at 3s-software.com (Markus Schaber) Date: Wed, 25 Jul 2012 07:06:34 +0000 Subject: [Ironpython-users] Gradually executing a python script In-Reply-To: References: <4C554C3A47C5024ABDE00E94DA17BC4D0F8FD491@SN2PRD0710MB396.namprd07.prod.outlook.com> <727D8E16AE957149B447FE368139F2B50D8182AD@SERVER10> Message-ID: <727D8E16AE957149B447FE368139F2B50D81842E@SERVER10> Hi, Jeff, Von: Jeff Hardy [mailto:jdhardy at gmail.com] > > On Tue, Jul 24, 2012 at 11:22 AM, Jeff Hardy wrote: > > > > sys.settrace is your friend here. Basically, if a robot tries to > > execute too many lines between yields (i.e. per turn), remove it from > > the list of valid robots and show an error. > > Forgot to add: > > http://www.doughellmann.com/PyMOTW/sys/tracing.html I always found it a deficiency of IronPython settrace that it does not offer events for calls to non-IronPython .NET methods (either statically compiled from C#/VB/F#... or from other dynamic languages). cPython has c_call, c_return and c_exception for this. Maybe IronPython could be extended to support those, or maybe dotnet_call, dotnet_return and dotnet_exception. Gr??e, Markus From no_reply at codeplex.com Wed Jul 25 11:33:24 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 25 Jul 2012 02:33:24 -0700 Subject: [Ironpython-users] IronPython, Daily Digest 7/24/2012 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New comment] Creating a low-permission version of PythonEngine fails post 2.0.0 ---------------------------------------------- ISSUES 1. [New comment] Creating a low-permission version of PythonEngine fails post 2.0.0 http://ironpython.codeplex.com/workitem/24475 User kerryjiang has commented on the issue: "I also get this exception, but it was in Mono. It's ok in .NET." ---------------------------------------------- ---------------------------------------------- You are receiving this email because you subscribed to notifications on CodePlex. To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdhardy at gmail.com Wed Jul 25 16:55:40 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Wed, 25 Jul 2012 07:55:40 -0700 Subject: [Ironpython-users] Gradually executing a python script In-Reply-To: <727D8E16AE957149B447FE368139F2B50D81842E@SERVER10> References: <4C554C3A47C5024ABDE00E94DA17BC4D0F8FD491@SN2PRD0710MB396.namprd07.prod.outlook.com> <727D8E16AE957149B447FE368139F2B50D8182AD@SERVER10> <727D8E16AE957149B447FE368139F2B50D81842E@SERVER10> Message-ID: On Wed, Jul 25, 2012 at 12:06 AM, Markus Schaber wrote: > Hi, Jeff, > > Von: Jeff Hardy [mailto:jdhardy at gmail.com] >> >> On Tue, Jul 24, 2012 at 11:22 AM, Jeff Hardy wrote: >> > >> > sys.settrace is your friend here. Basically, if a robot tries to >> > execute too many lines between yields (i.e. per turn), remove it from >> > the list of valid robots and show an error. >> >> Forgot to add: >> >> http://www.doughellmann.com/PyMOTW/sys/tracing.html > > I always found it a deficiency of IronPython settrace that it does not offer events for calls to non-IronPython .NET methods (either statically compiled from C#/VB/F#... or from other dynamic languages). > > cPython has c_call, c_return and c_exception for this. Maybe IronPython could be extended to support those, or maybe dotnet_call, dotnet_return and dotnet_exception. Good idea. Open an issue (http://ironpython.codeplex.com/WorkItem/Create) so it doesn't get (completely) forgotten, and, as always, patches are welcome. :) - Jeff From dinov at microsoft.com Wed Jul 25 23:09:54 2012 From: dinov at microsoft.com (Dino Viehland) Date: Wed, 25 Jul 2012 21:09:54 +0000 Subject: [Ironpython-users] Gradually executing a python script In-Reply-To: <727D8E16AE957149B447FE368139F2B50D81842E@SERVER10> References: <4C554C3A47C5024ABDE00E94DA17BC4D0F8FD491@SN2PRD0710MB396.namprd07.prod.outlook.com> <727D8E16AE957149B447FE368139F2B50D8182AD@SERVER10> <727D8E16AE957149B447FE368139F2B50D81842E@SERVER10> Message-ID: <6757ED2748BC0A43B9F3E4DA32D65AB00B87419C@CH1PRD0310MB357.namprd03.prod.outlook.com> Markus wrote: > I always found it a deficiency of IronPython settrace that it does not offer > events for calls to non-IronPython .NET methods (either statically compiled > from C#/VB/F#... or from other dynamic languages). > > cPython has c_call, c_return and c_exception for this. Maybe IronPython > could be extended to support those, or maybe dotnet_call, dotnet_return > and dotnet_exception. Those are only available for sys.setprofile though, not sys.settrace. IronPython does have clr.EnableProfiler and clr.GetProfilerData() which I think gives you similar data (but is less flexible in that you don't get the callbacks). If someone wanted to implement this they could look at how those are implemented and probably do something pretty similar but w/ a callback. From no_reply at codeplex.com Fri Jul 27 15:41:55 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 27 Jul 2012 06:41:55 -0700 Subject: [Ironpython-users] IronPython, Daily Digest 7/26/2012 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New issue] sys.settrace: Provide events for calls to non-IronPython code 2. [New comment] Visual Studio Tools 2.7: Can't edit Python code in WPF app 3. [New issue] Ebedded: Can't import extension DLLs like ipy does 4. [New comment] Ebedded: Can't import extension DLLs like ipy does 5. [New comment] Ebedded: Can't import extension DLLs like ipy does 6. [New comment] Could not get dependencies for project reference 'PythonLibrary1' 7. [New comment] console mode "exit()" command does not work. ---------------------------------------------- ISSUES 1. [New issue] sys.settrace: Provide events for calls to non-IronPython code http://ironpython.codeplex.com/workitem/32971 User MarkusSchaber has proposed the issue: "I always found it a deficiency of IronPython settrace that it does not offer events for calls to non-IronPython .NET methods (either statically compiled from C#/VB/F#... or from other dynamic languages). cPython has c_call, c_return and c_exception for this. Maybe IronPython could be extended to support those, or maybe dotnet_call, dotnet_return and dotnet_exception. (This issue is filed in consent with Jeff Hardy)."----------------- 2. [New comment] Visual Studio Tools 2.7: Can't edit Python code in WPF app http://ironpython.codeplex.com/workitem/28630 User AlexFor1987 has commented on the issue: "i can't debugger it ... what's the matter ?"----------------- 3. [New issue] Ebedded: Can't import extension DLLs like ipy does http://ironpython.codeplex.com/workitem/32973 User tibel has proposed the issue: "ipy imports all extension dlls (in DLLs) folder on startup (see InitializeExtensionDLLs() in PythonCommandLine.cs). When I embed IronPython in C#, i have to do this manually. Problem is here that the code from PythonCommandLine.cs does not work because it uses internal classes: ClrModule.AddReference(PythonContext.SharedContext, new FileInfo(file).Name); At the moment I load them like this: var assembly = Assembly.LoadFile(file); runtime.LoadAssembly(assembly); But this way I can only load .NET assemblies and not CPython extensions."----------------- 4. [New comment] Ebedded: Can't import extension DLLs like ipy does http://ironpython.codeplex.com/workitem/32973 User slide_o_mix has commented on the issue: "You can't load CPython extensions, they are native code and this is not supported."----------------- 5. [New comment] Ebedded: Can't import extension DLLs like ipy does http://ironpython.codeplex.com/workitem/32973 User tibel has commented on the issue: "Is there a difference between loading with ClrModule.AddReference() and runtime.LoadAssembly() ?"----------------- 6. [New comment] Could not get dependencies for project reference 'PythonLibrary1' http://ironpython.codeplex.com/workitem/10245 User yYHernan has commented on the issue: "Can someone give an example of what's a filesystem website? Is this just an html file not hosted by http server?"----------------- 7. [New comment] console mode "exit()" command does not work. http://ironpython.codeplex.com/workitem/31419 User yYHernan has commented on the issue: "This is working in IPY 2.7.2.1, see below for console dump: Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved. C:\Users\Y>ipy IronPython 2.7.2.1 (2.7.0.40) on .NET 4.0.30319.17626 (32-bit) Type "help", "copyright", "credits" or "license" for more information. >>> exit Use exit() or Ctrl-Z plus Return to exit >>> exit() C:\Users\Y>" ---------------------------------------------- ---------------------------------------------- You are receiving this email because you subscribed to notifications on CodePlex. To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From bruno.gallart at orange.fr Fri Jul 27 19:13:47 2012 From: bruno.gallart at orange.fr (bruno gallart) Date: Fri, 27 Jul 2012 19:13:47 +0200 Subject: [Ironpython-users] Build an application with VisualStudio and IronPython Message-ID: <5012CC4B.9090004@orange.fr> Hi all, I try to understand the development with IronPython in VisualStudio 2010 and I think that i have not understand the build's method. I make one little application with IronPython and WinForms but i don't know the way how to do binaries like VisualBasic . With VisualBasic inVisualStudio I choose "Build" and I do binaries and when I look the " configuration Manager " I see that the choice " build " is checked. With IronPython in "Configuration Manager" i can't check the choice "build". Is it normal ? I think to do wrong manipulation but what ? Somebody can give me some help ? Thanks a lot, Bruno From slide.o.mix at gmail.com Fri Jul 27 21:16:31 2012 From: slide.o.mix at gmail.com (Slide) Date: Fri, 27 Jul 2012 12:16:31 -0700 Subject: [Ironpython-users] Build an application with VisualStudio and IronPython In-Reply-To: <5012CC4B.9090004@orange.fr> References: <5012CC4B.9090004@orange.fr> Message-ID: Bruno, IronPython (and Python in general) is not a compiled language. You don't BUILD an IronPython application as you would for VB.NET or C#. You CAN pre-interpret your application into an executable using pyc.py, but that is the extent of building as it pertains to IronPython. slide On Fri, Jul 27, 2012 at 10:13 AM, bruno gallart wrote: > Hi all, > > I try to understand the development with IronPython in VisualStudio 2010 and > I think that i have not understand the build's method. > > I make one little application with IronPython and WinForms but i don't know > the way how to do binaries like VisualBasic . With VisualBasic > inVisualStudio I choose "Build" and I do binaries and when I look the " > configuration Manager " I see that the choice " build " is checked. With > IronPython in "Configuration Manager" i can't check the choice "build". Is > it normal ? I think to do wrong manipulation but what ? > > Somebody can give me some help ? > > Thanks a lot, > > Bruno > > _______________________________________________ > Ironpython-users mailing list > Ironpython-users at python.org > http://mail.python.org/mailman/listinfo/ironpython-users -- Website: http://earl-of-code.com From no_reply at codeplex.com Sat Jul 28 17:14:08 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 28 Jul 2012 08:14:08 -0700 Subject: [Ironpython-users] IronPython, Daily Digest 7/27/2012 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New comment] Could not get dependencies for project reference 'PythonLibrary1' 2. [New comment] console mode "exit()" command does not work. ---------------------------------------------- ISSUES 1. [New comment] Could not get dependencies for project reference 'PythonLibrary1' http://ironpython.codeplex.com/workitem/10245 User slide_o_mix has commented on the issue: "No, its the project type in VS that creates a web application on the file system."----------------- 2. [New comment] console mode "exit()" command does not work. http://ironpython.codeplex.com/workitem/31419 User yYHernan has commented on the issue: "Below are the results on Ubuntu 12.04: yy at yy-Latitude-D610:~/apps/ipy$ mono ipy.exe IronPython 2.7.3 (2.7.0.40) on Mono 4.0.30319.1 (32-bit) Type "help", "copyright", "credits" or "license" for more information. >>> exit Use exit() or Ctrl-D (i.e. EOF) to exit >>> exit() yy at yy-Latitude-D610:~/apps/ipy$ mono --version Mono JIT compiler version 2.10.8.1 (Debian 2.10.8.1-1ubuntu2.2) Copyright (C) 2002-2011 Novell, Inc, Xamarin, Inc and Contributors. www.mono-project.com TLS: __thread SIGSEGV: altstack Notifications: epoll Architecture: x86 Disabled: none Misc: softdebug LLVM: supported, not enabled. GC: Included Boehm (with typed GC and Parallel Mark) yy at yy-Latitude-D610:~$ uname -a Linux yy-Latitude-D610 3.2.0-27-generic-pae #43-Ubuntu SMP Fri Jul 6 15:06:05 UTC 2012 i686 i686 i386 GNU/Linux I think we can safely close this one as fixed in the later versions." ---------------------------------------------- ---------------------------------------------- You are receiving this email because you subscribed to notifications on CodePlex. To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From no_reply at codeplex.com Sun Jul 29 17:05:56 2012 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 29 Jul 2012 08:05:56 -0700 Subject: [Ironpython-users] IronPython, Daily Digest 7/28/2012 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New issue] Restricted AppDomain / GCHandle / SecurityException 2. [Status update] console mode "exit()" command does not work. ---------------------------------------------- ISSUES 1. [New issue] Restricted AppDomain / GCHandle / SecurityException http://ironpython.codeplex.com/workitem/32977 User FrankSch1 has proposed the issue: "Any module or source requiring WeakRef support fails to work in a restricted AppDomain. The issue was discussed here: http://mail.python.org/pipermail/ironpython-users/2012-March/015758.html but it seams it is not yet fixed - or maybe I'm missing something here? Actually I'm not using decimal.py, but uuid.py in my restricted AppDomain. As there is already a proposal for a fix from Dino (To fix Ipy we probably want Microsoft.Dynamic's WeakHandle class to handle the SecurityException and fallback to its Silverlight version of the code (or simply use the Silverlight version and not have quite as good compatibility, or figure out some other way to get that compatibility), could this please be implemented? This is required to make the whole embedding / restricted script execution thing useful - and it is very useful, if working."----------------- 2. [Status update] console mode "exit()" command does not work. http://ironpython.codeplex.com/workitem/31419 User jdhardy has updated the issue: Status has changed from Proposed to Closed with the following comment, "Fixed in previous releases." ---------------------------------------------- ---------------------------------------------- You are receiving this email because you subscribed to notifications on CodePlex. To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: