lua-users home
lua-l archive

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




On Tue, Oct 2, 2018 at 4:44 PM Sean Conner <sean@conman.org> wrote:
It was thus said that the Great Jim once stated:
> On 10/2/18, Sean Conner <sean@conman.org> wrote:
> > It was thus said that the Great Jim once stated:
>                                        ^^^^^^^ why are you trying to
> ridicule me ?

  I've been using that opening line in email since the early 90s (and you
can check other messages I've sent on this list to see it in use, and this
is the first time it has received a negative repsonse to it.

I was devastated when I realized you answered everyone like that. I thought someone had finally recognized my brilliance. ;)

Russ

> >   Well, one could wrap those regex functions into a Lua module so it's
> > available for you to use.
>
> sure, that's what we will do. how about directly using squirrel that has
> that already available ?

  Because this is the *Lua* mailing list, not the *Squirrel* mailing list?

> >   Why was Lua picked in the first place if you now regret it?  Is is the
> > fact that Lua doesn't have real regex that makes it suck?  Or are there
> > other factors that make you regret the choice of Lua?
>
> we thougt it could be used as a scripting language, akin to perl, python,
> ruby and all the others.
>
> we failed to recognize that it was only designed for authors that use it
> as a config language for their c program to avoid inventing one of their
> own. Lua is obviously not designed to run scripts that do any real work.

  That's news to me, since I use Lua to process SIP messages for Verizon
Wireless.  It currently handles around 60,000,000 messages per day without
issue (and we expect that level to rise 10-fold over the next year).

> it's just a toy, a study of how a config language could look, it's not
> made for scripting like say perl or other scripting languages, it simply
> was not made for this and thus obviously is not up for the task. we
> thought having an interpreter around was for interpreting scripts as the
> perl interpreter for instance does.

  That would also be news to wireshark users, as Lua is used there.  It's
also used in multiple online games as a scripting language.  Oh, and Redis
also uses Lua for scripting.  Guess we're all deluding ourselves into
thinking Lua is a programing language.

> it's a really poor design that changes with every release because something
> is broken again or poorly thought out.
> for instance: how dumb and clueless must one be to release a language that
> has only floating point arithmetic in a time were 386, 486SX and other cpus
> without an fpu were in wide usage ?

  Netscape did the exact same thing with _javascript_ back in the 90s, and it
still only supports floating point.  It's not neccessarily a *bad* design
choice, given at the time systems were 32-bit and one can easily do 52-bit
integer arithmatic with IEEE-754 floating point (I know there are systems
with non-IEEE-754 floating point but they tend to be rare, or were designed
prior to 1985 when IEEE-754 standard was released).  Doing that means you
only have one numeric type to support.  It's only with the rise in 64-bit
CPUs that such a design becomes problematic and why it was changed for Lua
5.3.

> >   Is this the language described by squirrel-lang.org?
> well, obvously, mr. genius, that's why i mentioned it.

  I wanted to make sure I had the right references.

> > Because if so, the
> > API seems very close to the Lua API (it downright seems Lua influenced the
> > design from what I can tell).  What is it about the Lua C API that sucks?
> > Or why is the squirrel one better?
>
> squirrel was based on Lua, the author tried to fix some of the main problems.
> a brief look on its api is not enough, read and compare it point by point with
> lua's api, then use it in some code and you will understand what i am about.
>
> >   Because from my brief look, they seem very similar.
> from a brief look lua might also look like a scripting language, but a
> brief look
> is not enough. use the squirrel api and you will see what i mean.
>
> >   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).
>
> #include <unistd.h>
>
> static int Sgetuid ( lua_State * const L )
> {
>    /* getuid() always succeeds, as required by posix */
>    lua_pushinteger ( L, getuid () ) ;
>    return 1 ;
> }
>
> thats the same on linux, solaris, aix, all of the bsds, and even crap
> like macos X.
> same for geteuid(), get(g)id(), get(p)pid(), umask(), fork() to name
> a few. how does that complicate anything, how exactly does that
> bring in pthreads, i missed the point, could you make this more clear
> and enlighten us a bit ?

  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.

> >   There are Lua modules that provide such functionality but I'm guessing
> and dont work for any recent lua version ? like the regex module ?
> > you want those built into the base Lua distribution.
> exactly.
>
> > different priorities; if you agree with them, use Lua.  If you don't, don't
> > use Lua.
> exactly,.

  -spc