[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: why not use more functionality from the posix std libc ?
- From: Jim <djvaios@...>
- Date: Thu, 9 May 2019 03:19:54 +0200
On 10/3/18, Sean Conner <sean@conman.org> wrote:
>> sure, that's what we will do. how about directly using squirrel that has
>> that already available ?
it was not about using in the first place. it was just an example of what other
small embedding languages can do/provide. the point here was that such
functionality could be added to Lua aswell without too much work
(in that case it was Squirrel's builtin regex lib wich provides
pattern alternatives
using the '|' OR regex operator).
> What is it about the Lua C API that sucks?
> Or why is the squirrel one better?
more on this in other posts to come.
> In some respects yes. In other respects no. On Linux you need to link
> with pthreads of you use that; not so on other systems. On Solaris you need
> to link with nt if you want to use the network API (socket(), bind(),
> accept(), etc) but no so with other Unix systems. On Windows, POSIX isn't
> part of the C library (although I could be wrong, but I would find it surprising).
> Okay, round two. If I have a program that makes use of pthreads, on
> Solaris it comes "for free" (your terms) in libc. On Linux, the pthreads
> API is NOT in libc, so it's not "for free" in that reguard---you have to
> link with libpthread.
> if I have a program that uses socket(), bind(), accept(), listen(), etc.
> (the Berkeley sockets API), those calls come "for free" on Linux---they're
> part of libc. On Solaris, they are not "for free"---they are not part of
> libc and you are required to link against libnt.
> On Windows, you don't even get get*id(), umask(), fork() or wait() AT ALL!
> Windows does not natively support POSIX.
>>> I don't know which Unix you are using, but the ones I've had
>>> experience with never came with regex "for free" (as part of libc).
>> well posix requires regex to be found in <regex.h>, so every unix has
>> them, from aix to the bsds, its in the libc that one has to use anyway.
>> so its there for FREE on all relevant unix platforms.
> Again, not always so in my exerience.