Re: New GCC plugin: gcc-python-plugin

2012-01-14 Thread David Malcolm
On Wed, 2011-06-22 at 08:19 +0200, Jakub Jelinek wrote: > Hi! > > On Tue, Jun 21, 2011 at 07:52:27PM -0400, David Malcolm wrote: > > I'm not yet familiar with the details of the gcc GC, but it appears that > > GTY() annotations are preprocessed to generate traversal code used by a > > mark-and-swe

Re: New GCC plugin: gcc-python-plugin

2011-06-22 Thread Basile Starynkevitch
On Wed, 22 Jun 2011 08:19:17 +0200 Jakub Jelinek wrote: > You could just: > #include "ggc.h" > > static void my_walker (void *arg ATTRIBUTE_UNUSED) > { > /* Ignore argument, as it is dummy */ > /* Walk all the still live python objects here and if they reference > GCC GC objects, call >

Re: New GCC plugin: gcc-python-plugin

2011-06-22 Thread Richard Guenther
On Tue, Jun 21, 2011 at 8:33 PM, David Malcolm wrote: > I've been working on a new plugin for GCC, which supports embedding > Python within GCC, exposing GCC's internal data structures as Python > objects and classes. > > The plugin links against libpython, and (I hope) allows you to invoke > arbi

Re: New GCC plugin: gcc-python-plugin

2011-06-21 Thread Basile Starynkevitch
On Tue, 21 Jun 2011 17:51:52 -0400 David Malcolm wrote: > > FWIW, I think I disagree with some of the above. For me, one of the > core "ideas" behind python is that syntax matters a great deal - code is > read more times than it's written, so the readability of code to humans > is important. Wh

Re: New GCC plugin: gcc-python-plugin

2011-06-21 Thread David Malcolm
On Tue, 2011-06-21 at 22:31 +0200, Basile Starynkevitch wrote: > On Tue, 21 Jun 2011 15:34:51 -0400 > David Malcolm wrote: > > When I mentioned the garbage collector, I was merely trying to convey > > the early, buggy nature of my code. This is a bug that I need to fix, > > but not a fundamental

Re: New GCC plugin: gcc-python-plugin

2011-06-21 Thread David Malcolm
On Tue, 2011-06-21 at 22:30 +0200, Basile Starynkevitch wrote: > On Tue, 21 Jun 2011 15:34:51 -0400 > David Malcolm wrote: > > I'm aware of MELT - as I understand it, it's a Lisp variant. > > Yes. However, I do have in the works an infix syntax of MELT called > MILT. But it would just be an infix

Re: New GCC plugin: gcc-python-plugin

2011-06-21 Thread Basile Starynkevitch
On Tue, 21 Jun 2011 15:34:51 -0400 David Malcolm wrote: > When I mentioned the garbage collector, I was merely trying to convey > the early, buggy nature of my code. This is a bug that I need to fix, > but not a fundamental design flaw (I hope!) I would be very interested in understanding in de

Re: New GCC plugin: gcc-python-plugin

2011-06-21 Thread Basile Starynkevitch
On Tue, 21 Jun 2011 15:34:51 -0400 David Malcolm wrote: > I'm aware of MELT - as I understand it, it's a Lisp variant. Yes. However, I do have in the works an infix syntax of MELT called MILT. But it would just be an infix/prefix syntax of exactly the same language (more precisely, of a large sub

Re: New GCC plugin: gcc-python-plugin

2011-06-21 Thread David Malcolm
On Tue, 2011-06-21 at 21:02 +0200, Basile Starynkevitch wrote: > On Tue, 21 Jun 2011 14:33:20 -0400 > David Malcolm wrote: > > It's still at the "experimental proof-of-concept stage"; expect crashes > > and tracebacks (I'm new to the insides of GCC, and I may have > > misunderstood things. I'm en

Re: New GCC plugin: gcc-python-plugin

2011-06-21 Thread Basile Starynkevitch
On Tue, 21 Jun 2011 14:33:20 -0400 David Malcolm wrote: > It's still at the "experimental proof-of-concept stage"; expect crashes > and tracebacks (I'm new to the insides of GCC, and I may have > misunderstood things. I'm entirely ignoring the garbage collector, and > I've also used a few entrypo

New GCC plugin: gcc-python-plugin

2011-06-21 Thread David Malcolm
I've been working on a new plugin for GCC, which supports embedding Python within GCC, exposing GCC's internal data structures as Python objects and classes. The plugin links against libpython, and (I hope) allows you to invoke arbitrary Python scripts from inside a compile. My aim is to allow pe