From: Simon Cozens Date: 2002-10-29T08:10:24+09:00 Subject: Re: NODE tree introspection ptkwt@shell1.aracnet.com (Phil Tomson) writes: > I wonder if we could do this a lot faster by using swig to wrap the > Ruby C parser? Swig Ruby itself to make an extension for Ruby. First, SWIG is there when your own language's extension mechanism is a pain in the ass; Ruby's extension system is just fine, (much more sensible than Perl's or Python's) and so I don't think SWIG is the answer. (to anything) And, to be blunt, I prefered Perl's XS to SWIG. Your milage, of course, is sure to vary. Second, SWIG is particularly useful when you're trying to do cross-language library extensions. But we're only trying to export Ruby's AST to Ruby, so cross-langage concerns are irrelevant. We dealt with SWIG in Extending and Embedding Perl (http://www.amazon.com/exec/obidos/ASIN/1930110820/) and, to be frank, I really don't want to deal with it again. Ruby's extension API, although I've beaten it up in the past (http://www-6.ibm.com/jp/developerworks/linux/001027/ruby_qa.html) kicks seven shades of shite out of Perl's. -- WILLIAM: Just incidentally -- why are you wearing that? SPIKE: Ahm -- combination of factors really. No clean clothes... W: There never will be, you know, unless you actually clean your clothes. S: Right. Vicious circle.