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,FREEMAIL_FROM, INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1014db,af2a2eba862de485 X-Google-Attributes: gid1014db,public X-Google-Thread: f9437,af2a2eba862de485 X-Google-Attributes: gidf9437,public X-Google-Thread: 103376,ee3a575a8acb318d X-Google-Attributes: gid103376,public From: Juergen.Pfeifer@t-online.de (Juergen Pfeifer) Subject: Re: RFD: comp.windows.curses (Ada) Date: 1997/06/12 Message-ID: <5npao2$op5$1@news02.btx.dtag.de>#1/1 X-Deja-AN: 248350026 References: <864986194.12186@isc.org> <5mn26e$nfg$1@henson.cc.kzoo.edu> <5nlui1$f97$1@narses.hrz.tu-chemnitz.de> <866127932.6765@dejanews.com> X-Sender: 06162912249-0001@t-online.de (Juergen u. Inga Pfeifer) X-Priority: 3 (Normal) Organization: Telekom Online Internet Gateway Newsgroups: news.groups,comp.lang.c,comp.lang.ada Date: 1997-06-12T00:00:00+00:00 List-Id: dg@poboxes.com wrote: > My understanding is that ncurses is a C library. > > My understanding is that what Russ Allbery is referring to is > an "Ada binding", and that this is a set of headers and interface > routines to allow the use of ncurses FROM an Ada application, but that > > ncurses is still a C library. > > 1) Could someone verify, clarify, or correct what an Ada binding is, > by a posting to "news.groups" or "comp.lang.c"? I have not personally > > used the Ada binding, just read about it. > > 2) If ncurses is not just a C library, what would Russ think about > "comp.programming.libraries.curses"? Ada has a standardized mechanism how to talk to routines that are written in another language. This mechanism allows you to formulate a prototype of a function or a datastrcuture in Ada systax, but then you tell the Ada compiler that the function is implemented in another language. Let me give an example: function Sleep_A_Little_Bit( How_Long : Integer) returns Integer; pragma Import (C, Sleep_A_Little_Bit, "sleep"); This little (not quite correct) sequence shows you how you write a Ada prototype for the function Sleep_A_Little_Bit and how you tell the compiler, that it is actually written in C and its real name is "sleep". In theory an Ada binding to a C library is nothing else than a set of Ada "headers" that defines such prototypes and mappings. In practice there exist tools that read C header files and generate corresponding Ada "headers" for it. Thats what the Ada community calls "thin bindings". The ncurses binding is not quite thin in the sense that it implements small wrapper routines around the C routines to do exception handling. In addition it provides Ada like mechanisms to deal with constructs in (n)curses that are to "C-ish", i.e. have constructs like vararg functions that are not easily portable across different language runtime models. So there is some Ada code involved in the binding, but this code doesn't implement any real ncurses functionality, it is only there to make the interface more Ada friendly. ncurses itself is of course implemented in C. But that doesn't mean that it is only of use for C programmers (that would be a bad idea for a good library). Cheers Juergen