comp.lang.ada
 help / color / mirror / Atom feed
From: Brian Drummond <brian@shapes.demon.co.uk>
Subject: Re: Ada  "library only" compiler ?
Date: Sat, 21 Jul 2012 22:53:40 +0000 (UTC)
Date: 2012-07-21T22:53:40+00:00	[thread overview]
Message-ID: <jufbtk$aro$1@dont-email.me> (raw)
In-Reply-To: d787ae2b-d0fa-440b-9edb-bafa19597e4d@googlegroups.com

On Sat, 21 Jul 2012 10:47:26 -0700, Patrick wrote:


> The Lua team does not
> bless more then a tiny set of libraries(just a few thousand lines) and
> there is no official way to do many things such as serializing data.
> 
> My Lua experience has left me shell-shocked and worried about using a
> lot of the Ada libraries. It took a lot of time to learn various Lua
> libraries and after finding two or three crappy ones in a row, it got
> frustrating. I am not saying that the same thing will be true for Ada
> but it might be nice if all the Ada binding code was in a certain place.

If the language developers do not (much) endorse Lua libraries, then the 
available libraries are likely to be poor!

Ada is strongly intended to support code re-use. Its package facilities 
encourage design for re-use, and re-using already-proven code is one good 
way to reduce the defect rate in a program.

So I would expect your experience with Ada libraries to be better.

(Perfection is not guaranteed however. There don't seem to be many uses 
of the AVR-Ada libraries supporting the AVR processors yet. So I am 
finding missing or incorrect features in some of these, but so far they 
are easy to find or fix)

> I like Lua still but if I am going to use it again, I am going to mix C
> libraries and Lua and pretty much forego the Lua libraries. It's easy
> enough to do this as Lua and it's tiny libraries are easy to keep
> separate.

Rather than writing a C library, it's probably easy to write an Ada 
library, exporting its functionality via "convention C", and then access 
it in Lua... 

I have not done this, but I have imported C into Ada, and exported Ada 
functionality into a (C++) program. It's reasonably easy (the C/C++ main 
needs to call adainit and adafinal functions) but some messing with 
makefiles is involved to tie them together.

You would probably need a minimal C wrapper to call adainit and adafinal 
functions, accessible from Lua. (Or if you can start the Lua code from a 
C main, it may be as easy to start it from Ada instead). But no messing 
about inside the compiler should be needed.

> If GNAT had a clearer separation of concerns between C and Ada, I could
> do the same with Ada or use Ada libraries when I want to but right now a
> lot seems to be bundled together and it is hard to tell what is binding
> and what is not.

I think the lack of separation may work FOR you in the above case...

- Brian



  parent reply	other threads:[~2012-07-26 14:49 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-20 20:05 Ada "library only" compiler ? Patrick
2012-07-20 21:11 ` Niklas Holsti
2012-07-20 21:47   ` Ludovic Brenta
2012-07-20 22:25   ` Peter C. Chapin
2012-07-20 22:51     ` Ludovic Brenta
2012-07-21  0:32       ` Randy Brukardt
2012-07-21 12:39         ` Pascal Obry
2012-07-22  4:59           ` Shark8
2012-07-22  7:04             ` Pascal Obry
2012-07-22 10:17           ` Florian Weimer
2012-07-24  1:54           ` Randy Brukardt
2012-07-24 16:50             ` Pascal Obry
2012-07-24 18:01               ` Vasiliy Molostov
2012-07-24 21:30                 ` Pascal Obry
2012-07-25  6:33                   ` Vasiliy Molostov
2012-07-25 23:44                   ` sbelmont700
2012-07-25 23:34               ` Randy Brukardt
2012-07-21 11:05     ` Niklas Holsti
2012-07-20 23:30   ` Patrick
2012-07-21 16:47     ` Niklas Holsti
2012-07-21 17:47       ` Patrick
2012-07-21 19:22         ` Simon Wright
2012-07-21 19:38           ` Patrick
2012-07-21 22:53         ` Brian Drummond [this message]
2012-07-22  3:25           ` Patrick
2012-07-22 17:54             ` Brian Drummond
2012-07-22 17:59               ` Brian Drummond
2012-07-22 18:44                 ` Patrick
2012-07-22 21:03                   ` Brian Drummond
2012-07-25 19:10                   ` J-P. Rosen
     [not found]               ` <m2a9yrsbf5.fsf@nidhoggr.home>
     [not found]                 ` <jui36a$hs0$1@dont-email.me>
2012-07-23 10:10                   ` Simon Wright
2012-07-24 10:55                     ` Brian Drummond
2012-07-22 21:25             ` Niklas Holsti
2012-07-22 22:00               ` Patrick
2012-07-22 21:18         ` Niklas Holsti
     [not found]   ` <olpj085ii9fpifpligh6jerghoaieiim1d@invalid.netcom.com>
2012-07-20 23:38     ` Patrick
2012-07-21 13:12     ` Niklas Holsti
2012-07-21  0:27   ` Randy Brukardt
2012-07-21  7:36     ` Dmitry A. Kazakov
2012-07-21 13:31     ` Niklas Holsti
2012-07-23  5:02 ` Miles Bader
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox