From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joshua Jensen Subject: Re: Python extension commands in git - request for policy change Date: Tue, 11 Dec 2012 22:15:13 -0700 Message-ID: <50C812E1.4020108@workspacewhiz.com> References: <20121125024451.1ADD14065F@snark.thyrsus.com> <50B1F684.5020805@alum.mit.edu> <1355273635-ner-4863@calvin> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Nguyen Thai Ngoc Duy , Tomas Carnecky , Sitaram Chamarty , Michael Haggerty , Felipe Contreras , "Eric S. Raymond" , git@vger.kernel.org To: Patrick Donnelly X-From: git-owner@vger.kernel.org Wed Dec 12 06:15:38 2012 Return-path: Envelope-to: gcvg-git-2@plane.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TiefP-0007oW-9b for gcvg-git-2@plane.gmane.org; Wed, 12 Dec 2012 06:15:35 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750878Ab2LLFPP (ORCPT ); Wed, 12 Dec 2012 00:15:15 -0500 Received: from hsmail.qwknetllc.com ([208.71.137.138]:33749 "EHLO hsmail.qwknetllc.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750841Ab2LLFPO (ORCPT ); Wed, 12 Dec 2012 00:15:14 -0500 Received: (qmail 28052 invoked by uid 399); 11 Dec 2012 22:15:11 -0700 Received: from unknown (HELO SlamDunk) (jjensen@workspacewhiz.com@76.23.33.208) by hsmail.qwknetllc.com with ESMTPAM; 11 Dec 2012 22:15:11 -0700 X-Originating-IP: 76.23.33.208 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 In-Reply-To: X-Antivirus: avast! (VPS 121211-1, 12/11/2012), Outbound message X-Antivirus-Status: Clean Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: ----- Original Message ----- From: Patrick Donnelly Date: 12/11/2012 7:26 PM >> If we use lua for writing "builtin" commands, >> we'll need to export a lot of C functions and writing wrappers like >> this is boring and time consuming. Also, assume I export fn(char*,int) >> to Lua, then I change the prototype to fn(char*, char*), can Lua spot >> all the call sites at compile time (or something) so I can update >> them? > If the API calls are generic (don't require special handling), you can > use some preprocessor magic to save time/space. Since I mostly use C++, thanks to template metaprogramming, I get to register functions like so: void SomeExistingFunction(char* str, int num); luaState->GetGlobals().RegisterDirect("SomeExistingFunction", SomeExistingFunction); I certainly am not suggesting C++ be used within Git, but in this case, C++ has some nice compile-time advantages. :) -Josh