Return-Path: X-Original-To: apmail-incubator-lucy-dev-archive@www.apache.org Delivered-To: apmail-incubator-lucy-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 967FDB45A for ; Sat, 14 Jan 2012 04:17:42 +0000 (UTC) Received: (qmail 93662 invoked by uid 500); 14 Jan 2012 04:17:42 -0000 Delivered-To: apmail-incubator-lucy-dev-archive@incubator.apache.org Received: (qmail 93515 invoked by uid 500); 14 Jan 2012 04:17:33 -0000 Mailing-List: contact lucy-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: lucy-dev@incubator.apache.org Delivered-To: mailing list lucy-dev@incubator.apache.org Received: (qmail 93507 invoked by uid 99); 14 Jan 2012 04:17:28 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 14 Jan 2012 04:17:28 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [68.116.39.62] (HELO rectangular.com) (68.116.39.62) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 14 Jan 2012 04:17:20 +0000 Received: from marvin by rectangular.com with local (Exim 4.69) (envelope-from ) id 1Rluu2-0000F5-U8 for lucy-dev@incubator.apache.org; Fri, 13 Jan 2012 20:07:38 -0800 Date: Fri, 13 Jan 2012 20:07:38 -0800 From: Marvin Humphrey To: lucy-dev@incubator.apache.org Message-ID: <20120114040738.GA904@rectangular.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) X-Virus-Checked: Checked by ClamAV on apache.org Subject: [lucy-dev] Clownfish::CFC::Binding::* implementation language Greets, While working on LUCY-142 (Port Clownfish compiler to C), I went a fair distance towards porting the code under Clownfish::CFC::Binding::Perl* to C. But then during December, I reverted those modules to their pure Perl implementations under the rationale that it was never going to be important to generate Perl bindings from Ruby, Ruby bindings from Python, etc. Logan and I have come up with a new reason why Clownfish::CFC::Binding::* should be implemented in C after all, rather than in the target host language. If we write Clownfish::CFC::Binding::Ruby in Ruby, then we need to create Ruby bindings for the bulk of CFC -- basically, we'd need to port clownfish/perl/lib/Clownfish/CFC.xs, which is a couple thousand lines of XS code (plus some support code in CFC.pm). SWIG is an option because it's OK if the bindings for CFC present a lousy interface, but SWIG brings its own inconveniences and would still require a certain amount of customization. This would have to be repeated for each target host language -- overall, a significant chunk of code and effort. The other possibility is to implement Clownfish::CFC::Binding::Ruby in C, allowing that code to interface with the rest of CFC's C implementation directly and removing the need for an elaborate translation layer. Then we only need to write enough glue code to make it possible to specify bindings from Ruby. Additionally, if we go that route it will be easier to take an existing CFC host language binding implementation and adapt it for a new host language. We can start off by finishing the porting of Clownfish::CFC::Binding::Perl* and then using the resulting C source files as a basis for Clownfish::CFC::Binding::Ruby. Later, once we port CFC's tests to C, most of the code in CFC.xs will become obsolete, allowing us to chop it down to a couple hundred lines. If there are no objections, this is how Logan and I presently plan to proceed. Marvin Humphrey