Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Forth > C interface (wa...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 50 of 58 Topic 4000 of 4136
Post > Topic >>

C interface (was: Elegant code)

by anton@[EMAIL PROTECTED] (Anton Ertl) Apr 23, 2008 at 08:04 PM

Alex McDonald <blog@[EMAIL PROTECTED]
> writes:
>Then there is hope for "fat Forths" like Win32Forth. If there's one
>thing W32F encourages, it's getting leverage from existing libraries
>of code (DLLs primarily). The only downside at the moment is the
>automation of the interface, where MPE's VxForth has the neat ability
>to im****t C function headers directly. I've worked a little with SWIG
>(http://www.swig.org/)
and used XSLT on the XML output it generates,
>but it's far from automatic.
>
>Anton Ertl started some time back on a generalised C function
>interface (http://www.complang.tuwien.ac.at/papers/ertl06.ps.gz
and
>http://www.complang.tuwien.ac.at/papers/ertl07euroforth.ps.gz).
More
>please.

What has been described there is implemented in the current
development version (but it needs more poli****ng before we can release
it for use on machines that may have several Gforth processes).

This also processes C header files automatically.  However, in
addition to the C types, which are described in the C header file, we
need to know the Forth types of the function arguments.

One approach to this is to have a mapping from the basic C type to the
Forth type, but that's not ****table across platforms: on one platform
the C type of an argument can be a long long, which might be mapped to
a double-cell in Forth, and on another it can be a long, which may be
mapped to a single cell in Forth.

The current approach in development Gforth is to declare the Forth
types manually, but a student of mine works on a SWIG-based tool that
generates declarations automatically from C header files, based on a
mapping from the abstract C type to the Forth type (e.g., off_t would
always be a double, whether the basic type is long or long long an the
actual platform).  Moreover, the idea is that someone would use that
tool to generate the Forth declarations for a given API once (and
possibly apply manual corrections), and from then on we would use the
file containing the Forth declarations whenever we want to interface
with that API.

- 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 2008:
http://www.complang.tuwien.ac.at/anton/euroforth/ef08.html
 




 58 Posts in Topic:
what kind of non microconroller app are done in forth?
gavino <gavcomedy@[EMA  2008-04-16 15:31:12 
Re: what kind of non microconroller app are done in forth?
pablo reda <pabloreda@  2008-04-16 15:57:50 
Re: what kind of non microconroller app are done in forth?
gavino <gavcomedy@[EMA  2008-04-16 16:13:28 
Re: what kind of non microconroller app are done in forth?
stephenXXX@[EMAIL PROTECT  2008-04-17 09:26:43 
Re: what kind of non microconroller app are done in forth?
pablo reda <pabloreda@  2008-04-17 06:28:26 
Re: what kind of non microconroller app are done in forth?
gavino <gavcomedy@[EMA  2008-04-18 10:11:10 
Re: what kind of non microconroller app are done in forth?
gavino <gavcomedy@[EMA  2008-04-18 10:12:04 
Re: what kind of non microconroller app are done in forth?
Elizabeth D Rather <er  2008-04-18 08:49:22 
Re: what kind of non microconroller app are done in forth?
Helmar <helmwo@[EMAIL   2008-04-18 11:10:45 
Re: what kind of non microconroller app are done in forth?
pablo reda <pabloreda@  2008-04-18 12:04:14 
Re: what kind of non microconroller app are done in forth?
gavino <gavcomedy@[EMA  2008-04-18 16:22:53 
Re: what kind of non microconroller app are done in forth?
gavino <gavcomedy@[EMA  2008-04-18 16:24:09 
Re: what kind of non microconroller app are done in forth?
Elizabeth D Rather <er  2008-04-18 20:47:50 
Re: what kind of non microconroller app are done in forth?
jennifer.spykerman@[EMAIL  2008-04-19 04:15:42 
Re: what kind of non microconroller app are done in forth?
Duke Normandin <dukeof  2008-04-19 14:20:53 
Re: what kind of non microconroller app are done in forth?
Robert Spykerman <robe  2008-04-19 17:07:15 
Re: what kind of non microconroller app are done in forth?
Duke Normandin <dukeof  2008-04-20 02:50:54 
Re: what kind of non microconroller app are done in forth?
Elizabeth D Rather <er  2008-04-19 21:48:07 
Re: what kind of non microconroller app are done in forth?
Jonah Thomas <jethomas  2008-04-19 10:40:11 
Re: what kind of non microconroller app are done in forth?
Thomas Pornin <pornin@  2008-04-20 07:11:54 
Re: what kind of non microconroller app are done in forth?
Bruce McFarling <agila  2008-04-19 09:33:55 
Re: what kind of non microconroller app are done in forth?
Bruce McFarling <agila  2008-04-19 09:37:25 
Re: what kind of non microconroller app are done in forth?
Guy Macon <http://www.  2008-04-19 17:47:45 
Re: what kind of non microconroller app are done in forth?
Jonah Thomas <jethomas  2008-04-19 14:31:39 
Re: what kind of non microconroller app are done in forth?
Bruce McFarling <agila  2008-04-19 15:04:48 
Re: what kind of non microconroller app are done in forth?
Albert van der Horst <  2008-04-20 13:43:04 
Re: what kind of non microconroller app are done in forth?
Bruce McFarling <agila  2008-04-19 15:21:12 
Re: what kind of non microconroller app are done in forth?
Gerry <gerry@[EMAIL PR  2008-04-20 01:50:08 
Re: what kind of non microconroller app are done in forth?
Jonah Thomas <jethomas  2008-04-20 08:23:50 
Re: what kind of non microconroller app are done in forth?
Gerry <gerry@[EMAIL PR  2008-04-20 08:12:11 
Elegant code Was: Re: what kind of non microconroller app are d
Jonah Thomas <jethomas  2008-04-21 01:58:43 
Re: Elegant code
Josh Grams <josh@[EMAI  2008-04-21 11:56:34 
Re: Elegant code Was: Re: what kind of non microconroller app a
"David N. Williams&q  2008-04-21 12:12:22 
Re: Elegant code Was: Re: what kind of non microconroller app a
mhx@[EMAIL PROTECTED] (M  2008-04-21 19:57:21 
Re: Elegant code Was: Re: what kind of non microconroller app ar
Gerry <gerry@[EMAIL PR  2008-04-21 02:15:31 
Re: Elegant code Was: Re: what kind of non microconroller app ar
Gerry <gerry@[EMAIL PR  2008-04-21 03:53:49 
Re: Elegant code Was: Re: what kind of non microconroller app ar
Jonah Thomas <jethomas  2008-04-21 09:04:09 
Re: Elegant code Was: Re: what kind of non microconroller app ar
Elizabeth D Rather <er  2008-04-21 07:42:01 
Re: Elegant code Was: Re: what kind of non microconroller app ar
Jonah Thomas <jethomas  2008-04-21 10:33:13 
Re: Elegant code Was: Re: what kind of non microconroller app ar
Bruce McFarling <agila  2008-04-21 08:22:03 
Re: Elegant code Was: Re: what kind of non microconroller app ar
Gerry <gerry@[EMAIL PR  2008-04-21 09:45:27 
Re: Elegant code Was: Re: what kind of non microconroller app ar
Gerry <gerry@[EMAIL PR  2008-04-22 02:20:59 
Re: Elegant code Was: Re: what kind of non microconroller app ar
John Passaniti <nntp@[  2008-04-22 17:22:35 
Re: Elegant code Was: Re: what kind of non microconroller app ar
Elizabeth D Rather <er  2008-04-22 14:16:18 
Re: Elegant code Was: Re: what kind of non microconroller app ar
Ian Osgood <iano@[EMAI  2008-04-22 10:00:09 
Re: Elegant code Was: Re: what kind of non microconroller app ar
John Passaniti <nntp@[  2008-04-22 17:36:41 
Re: Elegant code Was: Re: what kind of non microconroller app ar
Gerry <gerry@[EMAIL PR  2008-04-22 22:59:42 
Re: Elegant code Was: Re: what kind of non microconroller app ar
Alex McDonald <blog@[E  2008-04-23 01:00:52 
Re: Elegant code Was: Re: what kind of non microconroller app ar
stephenXXX@[EMAIL PROTECT  2008-04-23 10:07:15 
C interface (was: Elegant code)
anton@[EMAIL PROTECTED]   2008-04-23 20:04:07 
Re: Elegant code Was: Re: what kind of non microconroller app ar
Gerry <gerry@[EMAIL PR  2008-04-23 03:20:05 
Re: Elegant code Was: Re: what kind of non microconroller app ar
Alex McDonald <blog@[E  2008-04-23 04:09:54 
Re: Elegant code Was: Re: what kind of non microconroller app ar
Alex McDonald <blog@[E  2008-04-23 04:14:57 
Re: Elegant code Was: Re: what kind of non microconroller app ar
Jonah Thomas <jethomas  2008-04-23 10:11:34 
Re: Elegant code Was: Re: what kind of non microconroller app ar
John Passaniti <nntp@[  2008-04-23 20:56:59 
Re: what kind of non microconroller app are done in forth?
gavino <gavcomedy@[EMA  2008-04-29 00:16:19 
Re: what kind of non microconroller app are done in forth?
Elizabeth D Rather <er  2008-04-28 21:47:07 
Re: what kind of non microconroller app are done in forth?
Robert Spykerman <robe  2008-04-29 04:32:49 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Jul 9 6:04:15 CDT 2008.