public inbox for jit@gcc.gnu.org
 help / color / mirror / Atom feed
* [Announce] Perl bindings
@ 2015-01-01  0:00 Vickenty Fesunov
  0 siblings, 0 replies; 2+ messages in thread
From: Vickenty Fesunov @ 2015-01-01  0:00 UTC (permalink / raw)
  To: gccjit

Hello everyone.

I have started working on Perl bindings to GCCJIT: https://github.com/vickenty/gccjit-perl

The package currently provides only bare bones bindings, without much improvement over the C interface (yet).

Suggestions, bug reports and patches are most welcome.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Announce] Perl bindings
@ 2015-01-01  0:00 David Malcolm
  0 siblings, 0 replies; 2+ messages in thread
From: David Malcolm @ 2015-01-01  0:00 UTC (permalink / raw)
  To: Vickenty Fesunov; +Cc: gccjit

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-09-18  1:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-01  0:00 [Announce] Perl bindings Vickenty Fesunov
2015-01-01  0:00 David Malcolm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).