On Mon, Jan 25, 2016 at 3:08 PM, Michael Van Canneyt <[email protected] > wrote:
> On Mon, 25 Jan 2016, silvioprog wrote: > >> >> Many units in Free Pascal and Delphi uses C libraries... when aren't using >> a C library (an API system call, an third party library call, etc.), are >> using assembly, ie, mostly time Pascal is used as a high-level language to >> consume some low-level code written in C or assembly. >> > > There is a simple reason: Debugging and bugfixing is a lot easier if all > the code is in pascal. > Here's another reason - cross-platform availability. FPC is cross platform. To some extent (Java?) is more cross-platform that C is. When using an external library, there might be a risk that the library is not *easily* available for another platform that is targeted. It's common for open-source projects, not to provide any binary builds, requiring a library user to build the library themselves. Luckily, the most common projects do have some satellite projects that actually provide binaries. Building C (C++) library could be a real pain for some Pascal users. (Pascal spoils!) Building C/C++ library for a desired target platform, could be even more painful, specifically if some sort of cross-tools required or when building configuration needs to be changed. Thus a pure pascal library would be a number one choice for most users. With though it might be outdated and/or slower than its C-counterpart (i.e. paszlib vs zlib) thanks, Dmitry
-- _______________________________________________ Lazarus mailing list [email protected] http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
