unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Matt Wette <matt.wette@gmail.com>
To: Matt Wette <matt.wette@gmail.com>
Cc: Guile User <guile-user@gnu.org>,
	guile-user <guile-user-bounces+amirouche=hypermove.net@gnu.org>
Subject: Re: ffi-helper: looking for C libraries to try
Date: Sat, 15 Jul 2017 05:42:33 -0700	[thread overview]
Message-ID: <9F8AEA02-4BA6-4DD2-B05B-A528344FD1BC@gmail.com> (raw)
In-Reply-To: <1D616E65-2FEE-495C-B990-4A5A2283B8EC@gmail.com>


> On Jul 15, 2017, at 5:37 AM, Matt Wette <matt.wette@gmail.com> wrote:
> 
> 
>> On Jul 15, 2017, at 1:24 AM, Amirouche <amirouche@hypermove.net> wrote:
>> 
>> 
>> 
>> Le 15/07/2017 à 06:35, Matt Wette a écrit :
>>>> On Jul 14, 2017, at 5:44 PM, Amirouche Boubekki <amirouche@hypermove.net> wrote:
>>>> 
>>>> On 2017-07-15 01:17, Matt Wette wrote:
>>>>>  I tried git2 but those headers are too
>>>>> broken.
>>>> What do you mean by "too broken"? Maybe it will be easier in the long run to maintain our own version of the headers than manually bind everything. Even if it requires to create a shim layer in scheme to have a proper set of bindings that schemer will enjoy. Also, git is a good candidate since there are some tests already in guile-git [1].
>>> Maybe another bug in my CPP.
>>> 
>>> (define-ffi-module (libgit2)
>>>  #:include '("git2.h")
>>>  #:inc-dirs '("/opt/local/include")
>>>  #:library '("git2")
>>>  )
>>> 
>>> mwette$ guild compile-ffi libgit2.ffi
>>> (unknown):1: not found: “common.h"
>>> 
>>> 
>> With the following .ffi file:
>> 
>> (define-ffi-module (libgit2)
>> #:include '("git2.h")
>> #:inc-dirs '("/usr/include" "/usr/include/git2" "/usr/include/x86_64-linux-gnu/"  "/usr/include/linux/")
>> #:library '("git2")
>> )
>> 
>> I now have the following output:
>> 
>> $ guild compile-ffi libgit2/libgit2.ffi
>> TODO: compile-ffi args, arrays, extern variables
>> (unknown):1: parse failed at state 59, on input "__attribute__"
>> (unknown):1: C99 parse error
>> 
> 
> No surprise that it doesn’t work right now on non-Mac.  Add  #:inc-help ‘((“__builtin” “__attribute__(X)=“))
> 
> My goal is release something that works in October 2017.  That may be an ambitious goal.
> 
> Matt

When I created the C parser, I tried to put in hooks that would help avoid the highly system-dependent, compiler-dependent rat’s nest under /usr/include.  With the FFI I will probably not be able to avoid /usr/include.  So, I will likely have to deal with passing flags from guild down to the translator in order to deal with these things.  In addition, the Mac has non-standard features like int foo() adm(“foo”);

Matt




  reply	other threads:[~2017-07-15 12:42 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-14 23:17 ffi-helper: looking for C libraries to try Matt Wette
2017-07-15  0:04 ` Mike Gran
2017-07-15  0:44 ` Amirouche Boubekki
2017-07-15  4:35   ` Matt Wette
2017-07-15  8:24     ` Amirouche
2017-07-15 12:37       ` Matt Wette
2017-07-15 12:42         ` Matt Wette [this message]
2017-07-15 13:15     ` Matt Wette
2017-08-01 16:20       ` Matt Wette
2017-07-15  0:55 ` Amirouche
2017-07-15  3:01   ` Matt Wette
2017-08-08 10:00 ` Catonano
2017-08-12 19:55   ` Matt Wette

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9F8AEA02-4BA6-4DD2-B05B-A528344FD1BC@gmail.com \
    --to=matt.wette@gmail.com \
    --cc=guile-user-bounces+amirouche=hypermove.net@gnu.org \
    --cc=guile-user@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).