[Announce] Perl bindings

David Malcolm dmalcolm@redhat.com
Thu Jan 1 00:00:00 GMT 2015


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



More information about the Jit mailing list