[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: balsa build help



On Thu, Jan 24, 2002 at 11:00:19AM +0000, Jules Bean wrote:
> > Indeed. Looking at the pspell headers it seems libpspell is a mixed
> > C/C++ library. That is bad practice anyway, but especially since
> > it isn't linked against libstc++.
> 
> pspell is written in C++, but exports a C interface, I believe.
> 
> Is that bad practice?

There's nothing wrong with that.  It's *far* better than writing an
entire library in C.

> AIUI, the only reason that this is considered bad practice is the
> instability (and non-uniformity) of the C++ ABI.

I don't think that effects the portion of the API exported to C.

> > I would suggest reporting a bug against libpspell, demanding a split
> > in, say libpspell and libpspell++, or similiar.

That's completely unnecessary.  (And, er, "demanding" it would be a
quick way to find myself ignored ...)  It would certainly do nothing to
solve this problem.

> How could the split sensibly be performed, given that pspell is
> written in C++?

Often, libraries are written in C++, then a C wrapper is written around
them to give a C interface; but that wrapper itself has to be in C++, to
be able to use the C++ library.  There's nothing wrong with that.

Other times, libraries will be written with a C API but in C++; I don't
believe this is the case with pspell.  (I much prefer this to writing
completely in C; very often, the only reason people write libraries in C
is to "let people who only want to use C use the library", and that's 
uninformed reasoning.)

-- 
Glenn Maynard



Reply to: