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,34bcb430c7809d79 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!news-in.ntli.net!newsrout1-win.ntli.net!ntli.net!newspeer1-win.ntli.net!newsfe5-win.ntli.net.POSTED!53ab2750!not-for-mail From: "Dr. Adrian Wrigley" Subject: Re: SWIG backend for Ada User-Agent: Pan/0.14.2 (This is not a psychotic episode. It's a cleansing moment of clarity.) Message-Id: Newsgroups: comp.lang.ada References: <87oeitbvsf.fsf@deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Date: Sat, 23 Oct 2004 13:37:28 GMT NNTP-Posting-Host: 81.100.88.147 X-Complaints-To: http://www.ntlworld.com/netreport X-Trace: newsfe5-win.ntli.net 1098538648 81.100.88.147 (Sat, 23 Oct 2004 14:37:28 BST) NNTP-Posting-Date: Sat, 23 Oct 2004 14:37:28 BST Organization: ntl Cablemodem News Service Xref: g2news1.google.com comp.lang.ada:5660 Date: 2004-10-23T13:37:28+00:00 List-Id: On Sat, 23 Oct 2004 11:58:40 +0200, Florian Weimer wrote: > Is anybody developing a SWIG backend which generates Ada code? I briefly looked at SWIG a couple of months ago, and thought it might be interesting. But then other things took precedence. Now I look at it again, I think this would be a really excellent project for Ada and Ada users! The project could replace cbind/c2ada, which I think is ageing somewhat, doesn't handle C++, and has some tricky dependencies (?) The great thing is that the Ada community can benefit from the open source work done by people on the frontend. As I see it, a lot of the hard work has already been done. The Ada language interfaces seem very good when you first learn about them, but when it comes to practical usage, it's a significant problem keeping packages synchronised with .h C source files. All the strong typing, error checking etc. goes out of the window when the .h file is changed and the Ada specification no longer matches. One day, I would like to see full integration of the Ada compiler (eg in gnatmake, building .ads files) with C header files so you can write something like: with G_Lib_Top; -- Provide Ada specification from system C header file: -- gets subprogram declarations and type from glibtop.h pragma Specification (C_Header, G_Lib_Top, "glibtop.h"); procedure Test is Var : glibtop; -- Gets record definition from C struct begin GLibTop_Init; -- Call C interface GLibTop_Close; end Test; If I have some spare time, I'll have a closer look at the SWIG distribution, and try to see how much work it would be. -- Adrian Wrigley, Cambridge, UK