Groups | Search | Server Info | Login | Register


Groups > comp.lang.forth > #23706

Re: C interface

From anton@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups comp.lang.forth
Subject Re: C interface
Date 2013-06-17 16:44 +0000
Organization Institut fuer Computersprachen, Technische Universitaet Wien
Message-ID <2013Jun17.184439@mips.complang.tuwien.ac.at> (permalink)
References (5 earlier) <jvGdnWyR26uR7yXMnZ2dnUVZ_j2XnZ2d@supernews.com> <2013Jun12.163859@mips.complang.tuwien.ac.at> <6fmdnQYWQ6kfICXMnZ2dnUVZ_iydnZ2d@supernews.com> <2013Jun14.145121@mips.complang.tuwien.ac.at> <rridnT8gFIVSfibMnZ2dnUVZ_gWdnZ2d@supernews.com>

Show all headers | View raw


Andrew Haley <andrew29@littlepinkcloud.invalid> writes:
>I don't quite sollow this discussion.  libffi is not a complete
>solution to the problem of calling native functions and back, but a
>useful part of such a solution.  You can't do without it, or something
>that performs the same function.

It turns out that neither libffi nor ffcall are a useful part of such
a solution: libcc.fs uses neither.  What it does is to generate a
wrapper function (that accesses the Forth stacks) for every C function
we want to call, then compile these functions using the C compiler
(which knows about the types and macros and stuff), and then
dynamically link them; the wrapper functions all have the same
prototype, so they can be called through an indirect function call, no
libffi needed.

For the limited problem of calling JNI functions libffi is apparently
useful, but JNI cannot call arbitrary C functions.

- anton
-- 
M. Anton Ertl  http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
     New standard: http://www.forth200x.org/forth200x.html
   EuroForth 2013: http://www.euroforth.org/ef13/

Back to comp.lang.forth | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Re: On the importance of standards Bernd Paysan <bernd.paysan@gmx.de> - 2013-06-06 04:20 +0200
  Re: On the importance of standards m.a.m.hendrix@tue.nl - 2013-06-06 00:06 -0700
    Re: On the importance of standards Bernd Paysan <bernd.paysan@gmx.de> - 2013-06-06 15:32 +0200
      Re: On the importance of standards mhx@iae.nl (Marcel Hendrix) - 2013-06-06 17:09 +0200
        Re: On the importance of standards Bernd Paysan <bernd.paysan@gmx.de> - 2013-06-06 22:44 +0200
        Re: On the importance of standards Roelf Toxopeus <rt4all@notthis.hetnet.nl> - 2013-06-07 10:16 +0200
  Re: On the importance of standards Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-06-06 21:31 -0500
    Re: On the importance of standards Bernd Paysan <bernd.paysan@gmx.de> - 2013-06-08 00:58 +0200
      Re: On the importance of standards Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-06-07 22:02 -0500
        Re: On the importance of standards Bernd Paysan <bernd.paysan@gmx.de> - 2013-06-09 00:55 +0200
    C interface (was: On the importance of standards) anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-06-11 15:41 +0000
      Re: C interface (was: On the importance of standards) Bernd Paysan <bernd.paysan@gmx.de> - 2013-06-11 18:45 +0200
      Re: C interface Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-06-12 08:05 -0500
        Re: C interface anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-06-12 14:38 +0000
          Re: C interface Bernd Paysan <bernd.paysan@gmx.de> - 2013-06-12 20:15 +0200
            Re: C interface Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-06-14 22:52 -0500
          Re: C interface Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-06-12 13:27 -0500
            Re: C interface anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-06-14 12:51 +0000
              Re: C interface Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-06-14 22:47 -0500
                Re: C interface anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-06-17 16:44 +0000
                Re: C interface Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-06-17 12:46 -0500
                Re: C interface anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-06-18 07:23 +0000
                Re: C interface Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-06-18 04:06 -0500
                Re: C interface m.a.m.hendrix@tue.nl - 2013-06-18 03:51 -0700
                Re: C interface anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-06-18 16:10 +0000
                Re: C interface Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-06-18 13:24 -0500

csiph-web