Return-Path: X-Original-To: apmail-thrift-dev-archive@www.apache.org Delivered-To: apmail-thrift-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 5A4E36AB8 for ; Fri, 3 Jun 2011 08:01:33 +0000 (UTC) Received: (qmail 43034 invoked by uid 500); 3 Jun 2011 08:01:33 -0000 Delivered-To: apmail-thrift-dev-archive@thrift.apache.org Received: (qmail 42966 invoked by uid 500); 3 Jun 2011 08:01:33 -0000 Mailing-List: contact dev-help@thrift.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@thrift.apache.org Delivered-To: mailing list dev@thrift.apache.org Received: (qmail 42950 invoked by uid 99); 3 Jun 2011 08:01:32 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Jun 2011 08:01:32 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Jun 2011 08:01:29 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 64244F28C5 for ; Fri, 3 Jun 2011 08:00:48 +0000 (UTC) Date: Fri, 3 Jun 2011 08:00:48 +0000 (UTC) From: "alessandro rossi (JIRA)" To: dev@thrift.apache.org Message-ID: <730518484.65213.1307088048407.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1229341022.22083.1305719027699.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (THRIFT-1173) Using template system (for example: ctemplate) for code generation MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/THRIFT-1173?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13043246#comment-13043246 ] alessandro rossi commented on THRIFT-1173: ------------------------------------------ an update: -I used ctemplate, but this template engine is very poor (no "for"/"if") -I switched to (modificated) cpptempl (https://bitbucket.org/ginstrom/cpptemplate/overview). PRO: -for / if -easy parameter passing -only two file (cpptempl.cpp,cpptempl.h) -MIT license (is really good?) CONS: -no else/elif -no include -I'm investigating in order to use flex/bison (I used them about 15 years ago :P ) for a new simple-but-powerful template engine without lib dependancies (thrift already use flex/bison for its grammar). the new template engine MUST have: -for/if/else/elif/switch-case -function -include PS: I'm working to python generator using cpptempl and the code lines now are 2240 (original 2390). It's heavy to pass for embedded-code to template-code. > Using template system (for example: ctemplate) for code generation > ------------------------------------------------------------------ > > Key: THRIFT-1173 > URL: https://issues.apache.org/jira/browse/THRIFT-1173 > Project: Thrift > Issue Type: Improvement > Components: Compiler (General) > Affects Versions: 0.6.1 > Reporter: alessandro rossi > Priority: Minor > Labels: generation, template > > IMHO, the code generation embedded into generator's code is not a good solution. > With ctemplate (http://code.google.com/p/google-ctemplate/), for example, we can separate logic with generation code. > If you want I can implement an example for cpp generator. > Best Regards, > Alessandro -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira