Re: Binding or not binding



Ali Bendriss wrote:
Hello,

Could you please first excuse me if my past and maybe future posting in this group were (will be) sometimes awkward. But I will really like to be more active using and promoting Ada.

I was really interested by the thread about "How come Ada isn't more popular?"

I would like to have your opinion about the best way to go in the future, and in particular if binding a C library is really the way to go.
When we talk about reuse does it mean reusing the libraries done in an other language ? Re-implementing zlib in Ada for example. Is it a waist of time ?
How to choose ? where to start writing in Ada ?
If I need some compression lib like jpeg2k for example which way to go ?
I would love to be able to manipulate some DICOM image format in Ada for example. Most of the actual project implementing the DICOM standard are in C++ and java. Is it only a question of money (project funding) ?

Thanks for your feedback in the professional and the hobbyist side.


It depends on your goals. In general, the conventional wisdom is that you should simply bind to existing libraries and as a general rule, this usually makes sense. However, having said that, the net is full of libraries in a variety of languages implemented natively in that language and the existence of these native libraries is sometimes what makes people call those languages "good".

So, if my goal is to just get some work done, and I need the functionality of some library, and the functionality is non-trivial, I'll usually go the binding route.

If I want functionality and existing libraries don't provide it and/or provide it in a manner that is not really what I want, I start to consider writing a native version.

Sometimes dealing with either the build process, license terms, compiler requirements of an existing library is nearly as much work as just writing and maintaining a native version. Finding this tipping point will depend on a lot of factors but certainly for functionality <~ 100 lines of code, the intellectual overhead of a binding and another language is usually not worth it.

Having something like SWIG working and well understood for Ada would certainly help bring bindings along.

Work is progressing in that area but I have not really looked at progress recently.

http://gnuada.svn.sourceforge.net/viewvc/gnuada/trunk/projects/swig-1.3.29/
.



Relevant Pages

  • Re: client-side Ruby on iPad/iPhone?
    ... Not the standard library, but rather core types. ... before it's a useful Web development language. ... What functionality? ... JQuery and Prototype are huge libraries. ...
    (comp.lang.ruby)
  • Re: Heartbleed
    ... with the functionality done in a type safe way. ... of the vast range of systems these libraries run on and because of the ... Will these new compilers be easy to port to a new environment or will ... the size and functionality of the Ada language make porting a major task? ...
    (comp.lang.ada)
  • Re: Feasibility of using Ada in new development
    ... - The language has lots of unsafe features that are very closely ... I don't think Ada has any of these flaws, and GNAT is stable at the ... - There are bindings to many C libraries, ...
    (comp.lang.ada)
  • Re: How come Ada isnt more popular?
    ... if you want to have C API for reasons of useability. ... with C as a main development language for reasons which I don't really ... I doubt a Ada library could. ... binding Ada to C libraries that use non-Ada runtime internally? ...
    (comp.lang.ada)
  • Re: Graphic GUI C
    ... features in C99) is also a feature of C++. ... expect the C language and the C standard library to do everything; ... nothing is more commonplace than the need for one or more libraries in ... The same is true inside of WSH where all of the functionality ...
    (comp.lang.c)