From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,a3446063322b22cb X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news4.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsmm00.sul.t-online.de!t-online.de!news.t-online.com!not-for-mail From: Martin Krischik Newsgroups: comp.lang.ada Subject: Re: Thick vs. Thin bindings Date: Sat, 27 Nov 2004 08:25:21 +0100 Organization: None Message-ID: <1277697.NJH4qpXlWW@linux1.krischik.com> References: <41a746a0@x-privat.org> Reply-To: martin@krischik.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: news.t-online.com 1101544320 03 16940 wZK3XmNvhULdUg2 041127 08:32:00 X-Complaints-To: usenet-abuse@t-online.de X-ID: SS7bqrZ6oe6C47t97Cq5PCmPkZust5vVI3p-12+WL5xc3Apl1gbSUc User-Agent: KNode/0.8.0 Xref: g2news1.google.com comp.lang.ada:6542 Date: 2004-11-27T08:25:21+01:00 List-Id: Jeff Houck wrote: > As I continue to evaluate Ada in the role of a gamephilosophyge, I've > run across references to "thick" and "thin" bindings and I'm a bit > confused. > My initial design goals are to keep the number of external dependancies > to a minimum with most of the support code written in Ada. I would like > the code interfaces to be as simple as possible to implement for a > designer. I believe this would necessitate a "thick" binding. Is that > correct? Would anyone like to elaborate on the pros and cons of these > two binding methodologies? Further reading material? Tutorials? Thx! A thin binding just translates the C calls into Ada calls but the C'ish philosophy is still visible. One examle of C'ish philosophy is the '\0' at the end of strings. Example for a thin binding to memset: procedure memset ( S : in Interfaces.C.void_ptr; C : in Interfaces.C.int; N : in Interfaces.C.size_t); pragma Import ( Convention => C, Entity => memset, External_Name => "memset"); A think binding translates the philosophy of the original language to Ada as well. A think binding to memset could be a generic procedure (template in C++ talk): generic type A_Type is private; type A_Access is access all A_Type; procedure Mem_Set Value : in A_Access ; Fill : in Short_Short_Integer); I usualy suggest to build a think binding on top of a thin bindung. With Regards Martin -- mailto://krischik@users.sourceforge.net http://www.ada.krischik.com