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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3ee47b1a6f7a07ac X-Google-Attributes: gid103376,public From: tmoran@bix.com (Tom Moran) Subject: Re: [question] Ada and DataBase Date: 1999/04/24 Message-ID: <3721434b.19630891@news.pacbell.net>#1/1 X-Deja-AN: 470245446 References: <7fq1bi$gq5@news.u-strasbg.fr> <3720E1D0.E0EF7B58@Botton.com> X-Complaints-To: abuse@pacbell.net X-Trace: typhoon-sf.snfc21.pbi.net 924928624 207.214.211.55 (Fri, 23 Apr 1999 21:37:04 PDT) Organization: SBC Internet Services NNTP-Posting-Date: Fri, 23 Apr 1999 21:37:04 PDT Newsgroups: comp.lang.ada Date: 1999-04-24T00:00:00+00:00 List-Id: > I am wondering what is the meaning of thin >or thick binding. I appreciate any explanation. A thin binding has the underlying (C or whatever) functions rewritten in Ada syntax, with appropriate pragma Imports. Usually the names have also been changed as little as possible from the original. The advantages include: little documentation (you can just go read the C docs) and ease and speed of creation - in fact a substantial amount of the work can be automated. The disadvantages include: you are forced to program in C with Ada syntax, ie at a very low abstraction level. Usually it uses C idoms - pointers, 'address, no "out" parameters, etc. A thick(er) binding is more Ada-like. It usually utilizes Ada capabilities like strong typing, tasking, protected records, etc etc. You are using your Ada skills and getting help from the Ada compiler, instead of using your C skills, and it feels like it. Typically the abstraction level is much higher, and a lot of memory allocation/deallocation, task safeness, etc stuff has already been done for you by the author of the binding. Last but not least, said author has already discovered many of the things the C docs left out, since he had to learn how things actually work. The disadvantage is that it isn't C so it needs to be documented itself rather than just refering you to the C books, and of course it takes a lot more work to create. Thickness varies of course. A very thick binding often obscures the differences between OSes, which can be good for portability, but bad when you really need "that Windows look and feel" or some capability that is so specific to one OS that the thick binding doesn't even try to support it. OTOH, a good thick binding should allow ways to get at the underlying system and mix abstraction levels when necessary without too much pain. I once suggested that thickness be measured in R values, like house insulation. Really thin is R1, near complete separation from the external environment is, say, R50. Someone counterproposed that thickness could be measured by the ratio of sizes of the specs to the bodies. A thin binding has hardly any body, of course. I coauthored a paper on Claw, a thick Ada binding to Windows, at the TriAda '97. It discusses some of the issues and is available online at www.rrsoftware.com (I'd describe Claw as about R15-20, and its package bodies total just under twice the specs.)