why not use more functionality from the posix std libc ?

classic Classic list List threaded Threaded
2 messages Options
Jim
Reply | Threaded
Open this post in threaded view
|

why not use more functionality from the posix std libc ?

Jim
On 10/3/18, Sean Conner <[hidden email]> 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.

Reply | Threaded
Open this post in threaded view
|

Re: why not use more functionality from the posix std libc ?

Sean Conner
It was thus said that the Great Jim once stated:

> On 10/3/18, Sean Conner <[hidden email]> 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).

  There are at least three modules providing regex in Lua available via
LuaRocks: Lrexlib-POSIX, Lrexlib-PCRE (most popular) and Lrexlib-PCRE2.
There's also at least two POSIX modules: lposix and luaposix (most popular).
There *is* a solution, it's just not a built-in one.

  -spc (Surprised at the age of this thread ... )