From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 79444 invoked by alias); 18 Sep 2015 01:08:05 -0000 Mailing-List: contact jit-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Subscribe: Sender: jit-owner@gcc.gnu.org Received: (qmail 79427 invoked by uid 89); 18 Sep 2015 01:08:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.98.7 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.4 required=5.0 tests=AWL,BAYES_40,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-Spam-Status: No, score=-0.4 required=5.0 tests=AWL,BAYES_40,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: mx1.redhat.com Message-ID: <1442538481.30732.20.camel@surprise> Subject: Re: [Announce] Perl bindings From: David Malcolm To: Vickenty Fesunov Cc: gccjit Date: Thu, 01 Jan 2015 00:00:00 -0000 Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-SW-Source: 2015-q3/txt/msg00156.txt.bz2 On Sat, 12 Sep 2015 at 20:57:28 +0200, Vickenty Fesunov wrote: (sorry for the belated response; I somehow missed your mail) > Hello everyone. Hi! > I have started working on Perl bindings to GCCJIT: > https://github.com/vickenty/gccjit-perl Excellent - thanks for working on this! I've taken the liberty of adding a link to your project to the wiki page (https://gcc.gnu.org/wiki/JIT ). > The package currently provides only bare bones bindings, > without much improvement over the C interface (yet). > Suggestions, bug reports and patches are most welcome. If you're looking to improve over the raw C interface, you might want to use namespacing/modules/methods/classes/inheritance or whatnot to shorten the API: all those gcc_jit_ prefixes are arguably redundant if you're in an language that has namespaces, and a lot of things could become calls on objects. Compare the C API with the C++ bindings, for instance; rather than: gcc_jit_block_add_assignment $b{loop}, undef, gcc_jit_param_as_lvalue($v), $r; how about something like: $b{loop}->add_assignment ($v, $r); and: my $ctx = GCCJIT::Context->acquire (); ... my $res = $ctx->compile (); etc with the big caveat that my Perl skills are non-existent ;) So take the above with a big pinch of salt; do whatever's idiomatic in the language, I guess. Dave