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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,43d910f082521047 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.180.98.234 with SMTP id el10mr379386wib.3.1343919711327; Thu, 02 Aug 2012 08:01:51 -0700 (PDT) Path: n2ni6265859win.0!nntp.google.com!goblin1!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed-00.mathworks.com!nntp.TheWorld.com!.POSTED!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: questions on Ada openGL binding in the GLOBE3D packages Date: Thu, 02 Aug 2012 11:01:50 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 X-Trace: pcls6.std.com 1343919710 20343 192.74.137.71 (2 Aug 2012 15:01:50 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Thu, 2 Aug 2012 15:01:50 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:iKRQ/NGSk7Tn/Rr7WoUxu2V1j2s= Content-Type: text/plain; charset=us-ascii Date: 2012-08-02T11:01:50-04:00 List-Id: Brian Drummond writes: > "Making code look the same as C" is ... not unambiguously better! True. But sticking closely to the C does have the advantage that the binding doesn't need a whole lot of documentation (which must be maintained) -- you can just refer to the C docs. A thick binding requires a lot of documentation. IMHO, the name changes are so systematic in this case, that it's close enough -- you can still refer to the C docs, and do the trivial translation in your head. And the Ada names really are more readable. I think it's the right choice, especially since the standard actually suggests doing it this way in languages that have a proper module system. What if you had a system originally written in Ada (with appropriate use of overloading), and you wanted to make a C binding? In that case it would be impossible to make the names the same. I once wrote an Ada binding to some C code where every C function returned an 'int' as an error code, with 0 meaning "success". I did it in two layers. A thin binding that worked the same way, returning Interfaces.C.int. Then a layer on top of that that turned the error codes into raising an exception. The second layer is such a systematic change that I think it can still be considered "thin" -- thin enough that the C documentation still makes sense. - Bob