From: Ken W. <kwa...@gm...> - 2010-07-27 04:23:26
|
So in my short time using SWIG, I've run across a few problems where simply dropping in a replacement .swg or .i file to override default behaviors isn't quite enough - I'd need to modify the language module itself to get the desired effect without externally postprocessing the generated files or abusing the code generator. I don't like doing those things, but also I don't particularly like the idea of part of my build instructions being "Acquire a source release of SWIG and apply this patch queue" either. But if SWIG itself was wrapped in such a way that language modules could be implemented in Python (or whatever you like), modified language modules could be included along with a project to grant more control over the code generation process. I'm sure I'm not the first person to think of this, but I couldn't figure out an appropriate set of search terms that would locate a previous discussion. Has anyone attempted this in the past? |
From: Matthias <ni...@dr...> - 2010-07-27 10:53:13
|
Am 27.07.2010, 03:30 Uhr, schrieb Ken Watford <kwa...@gm...>: > So in my short time using SWIG, I've run across a few problems where > simply dropping in a replacement .swg or .i file to override default > behaviors isn't quite enough - I'd need to modify the language module > itself to get the desired effect without externally postprocessing the > generated files or abusing the code generator. I don't like doing > those things, but also I don't particularly like the idea of part of > my build instructions being "Acquire a source release of SWIG and > apply this patch queue" either. But if SWIG itself was wrapped in such > a way that language modules could be implemented in Python (or > whatever you like), modified language modules could be included along > with a project to grant more control over the code generation process. > > I'm sure I'm not the first person to think of this, but I couldn't > figure out an appropriate set of search terms that would locate a > previous discussion. Has anyone attempted this in the past? Yes, this has been proposed this in the past. See here for a few references: http://tinyurl.com/3227sau (read the whole thread, many people posted a lot of good ideas there imo). http://tinyurl.com/38cxo2y http://tinyurl.com/36h79y7 -Matthias |
From: Matthias <ni...@dr...> - 2010-07-27 11:05:01
|
Am 27.07.2010, 12:52 Uhr, schrieb Matthias <ni...@dr...>: > Am 27.07.2010, 03:30 Uhr, schrieb Ken Watford <kwa...@gm...>: > >> So in my short time using SWIG, I've run across a few problems where >> simply dropping in a replacement .swg or .i file to override default >> behaviors isn't quite enough - I'd need to modify the language module >> itself to get the desired effect without externally postprocessing the >> generated files or abusing the code generator. I don't like doing >> those things, but also I don't particularly like the idea of part of >> my build instructions being "Acquire a source release of SWIG and >> apply this patch queue" either. But if SWIG itself was wrapped in such >> a way that language modules could be implemented in Python (or >> whatever you like), modified language modules could be included along >> with a project to grant more control over the code generation process. >> >> I'm sure I'm not the first person to think of this, but I couldn't >> figure out an appropriate set of search terms that would locate a >> previous discussion. Has anyone attempted this in the past? > > Yes, this has been proposed this in the past. See here for a few > references: > > http://tinyurl.com/3227sau (read the whole thread, many people posted a > lot of good ideas there imo). > http://tinyurl.com/38cxo2y > http://tinyurl.com/36h79y7 One thing I have to add here. I've followed the regexp support thread. Things like this would be a lot easier to implement if SWIG provided better hooks for this. You wouldn't have to worry about choosing and deploying the right regexp library as many scripting languages have them built in. And things like regexps could be used in typemaps and other features as well, not just in %rename. -Matthias |