"Lua, a misunderstood language"

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

"Lua, a misunderstood language"

Phil Leblanc
Reply | Threaded
Open this post in threaded view
|

Re: "Lua, a misunderstood language"

Timm S. Mueller
On Sat, 16 Jan 2021 00:20:53 +0000
Phil Leblanc <[hidden email]> wrote:

> A nice point of view about Lua
> https://andregarzia.com/2021/01/lua-a-misunderstood-language.html

Lua always did about everything right, at least for me. I'm following
it only since about version 4. I came to Lua precisely for its C
interface. It turned out to be also a very useful scripting language,
very similar to, but still more powerful than Javascript. All this in a
runtime system that can be compiled to down to ~100k... that's what
matters for me.

Regarding the 1-based indexing - You can always initialize with
{ [0]=... }, and whoops, it's 0-based. This was a minor annoyance when
we wrote a raymarcher in Lua (ported from GL, ported also to
Javascript, but Lua looked better than JS).

- Timm

--
Timm S. Mueller <[hidden email]>
Tel. 030 85610000, http://www.schulze-mueller.de/
Reply | Threaded
Open this post in threaded view
|

Re: "Lua, a misunderstood language"

Ulrich Schmidt
In reply to this post by Phil Leblanc
Am 16.01.2021 um 01:20 schrieb Phil Leblanc:
> A nice point of view about Lua
> https://andregarzia.com/2021/01/lua-a-misunderstood-language.html
>

 From my point of view, Lua's main advantage is its scalability:
As a beginner i wrote simple scripts. Then i wanted to create simple
apps and oop. I started with 33log and middleclass and finaly did my own
oop thing.
I wrote number crunching command line apps. Lpeg was and is the ultimate
and unbeaten swiss army knive.
And if i need a simple UI, i use iup.

Shure, i can use other languages. But why?.
Reply | Threaded
Open this post in threaded view
|

Re: "Lua, a misunderstood language"

Petite Abeille
In reply to this post by Timm S. Mueller


> On Jan 16, 2021, at 03:32, Timm S. Mueller <[hidden email]> wrote:
>
> Lua always did about everything right, at least for me.

Except the module debacle :P

But yes, otherwise a gem of a language in my daily toolkit.

“there are zero ways to do it”

+1
Reply | Threaded
Open this post in threaded view
|

Re: "Lua, a misunderstood language"

Timm S. Mueller
On Sat, 16 Jan 2021 10:21:46 +0100
Petite Abeille <[hidden email]> wrote:

> > On Jan 16, 2021, at 03:32, Timm S. Mueller <[hidden email]> wrote:
> >
> > Lua always did about everything right, at least for me.
>
> Except the module debacle :P

I'm not always following the mailing list closely. What was "the"
module debacle?

--
Timm S. Mueller <[hidden email]>
Tel. 030 85610000, http://www.schulze-mueller.de/
Reply | Threaded
Open this post in threaded view
|

Re: "Lua, a misunderstood language"

Petite Abeille


> On Jan 16, 2021, at 10:31, Timm S. Mueller <[hidden email]> wrote:
>
> I'm not always following the mailing list closely. What was "the"
> module debacle?

Bah... it's long gone. Water under the bridge.

See "The old way of creating modules":
http://lua-users.org/wiki/ModulesTutorial

Reply | Threaded
Open this post in threaded view
|

Re: "Lua, a misunderstood language"

Sean Conner
In reply to this post by Timm S. Mueller
It was thus said that the Great Timm S. Mueller once stated:

> On Sat, 16 Jan 2021 10:21:46 +0100
> Petite Abeille <[hidden email]> wrote:
>
> > > On Jan 16, 2021, at 03:32, Timm S. Mueller <[hidden email]> wrote:
> > >
> > > Lua always did about everything right, at least for me.
> >
> > Except the module debacle :P
>
> I'm not always following the mailing list closely. What was "the"
> module debacle?

  I think it was the difference in how modules were written between Lua 5.1
and 5.2.  It was quite a change and I think it's what lead to the split
between Lua and LuaJIT.

  -spc
Reply | Threaded
Open this post in threaded view
|

Re: "Lua, a misunderstood language"

Timm S. Mueller
In reply to this post by Petite Abeille
On Sat, 16 Jan 2021 10:36:11 +0100
Petite Abeille <[hidden email]> wrote:

>
>
> > On Jan 16, 2021, at 10:31, Timm S. Mueller <[hidden email]> wrote:
> >
> > I'm not always following the mailing list closely. What was "the"
> > module debacle?
>
> Bah... it's long gone. Water under the bridge.
>
> See "The old way of creating modules":
> http://lua-users.org/wiki/ModulesTutorial

OK, I remember :-)

--
Timm S. Mueller <[hidden email]>
Tel. 030 85610000, http://www.schulze-mueller.de/
Reply | Threaded
Open this post in threaded view
|

Re: "Lua, a misunderstood language"

DarkWiiPlayer
In reply to this post by Petite Abeille
This, along with the move from `setfenv()` to `_ENV` also shows that
when the language evolves, it does in the right direction (i.e. unifying
concepts that don't need to be singled out), which is one of the things
I most appreciate. Meanwhile, Ruby just introduced a third (I almost
want to say fourth) type of "thread", and JavaScript introduced special
syntax for classes not too long ago with ES6.

This is probably one of the things that gets misunderstood though:
people often ask for "features" that really just end up being special
syntax for something that's already possible¹.

The move to lua files returning the "module" so they exist purely as
locals where they're required is exemplary of one of the biggest
differences in design philosophy between Lua and Ruby (the other
language I (am forced to) use), where you require something and it just
dumps all of its constants and classes into your global environment
(usually they are at least namespaced into a single module, but still, ugh).

On 16/01/2021 10:36, Petite Abeille wrote:
>> On Jan 16, 2021, at 10:31, Timm S. Mueller <[hidden email]> wrote:
>>
>> I'm not always following the mailing list closely. What was "the"
>> module debacle?
> Bah... it's long gone. Water under the bridge.
>
> See "The old way of creating modules":
> http://lua-users.org/wiki/ModulesTutorial

PS:

¹ I still get downvotes on that StackOverflow answer explaining why Lua
doesn't have and doesn't need a `continue` statement and, while I can't
be sure of course, I do believe that most of those downvotes are from
python developers 😏



signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: "Lua, a misunderstood language"

Robert Burke
On Sun, Jan 17, 2021 at 1:33 AM DarkWiiPlayer <[hidden email]> wrote:
The move to lua files returning the "module" so they exist purely as
locals where they're required is exemplary of one of the biggest
differences in design philosophy between Lua and Ruby (the other
language I (am forced to) use), where you require something and it just
dumps all of its constants and classes into your global environment
(usually they are at least namespaced into a single module, but still, ugh).

In Lua I cannot require luasocket or lpeg without any globals being set :( 
Reply | Threaded
Open this post in threaded view
|

Re: "Lua, a misunderstood language"

Spar
Just looked at the source code of luasocket, it doesn't set any global, make sure you do local luasocket = require("luasocket").
On 16 Jan 2021, 19:40 +0300, Robert Burke <[hidden email]>, wrote:
On Sun, Jan 17, 2021 at 1:33 AM DarkWiiPlayer <[hidden email]> wrote:
The move to lua files returning the "module" so they exist purely as
locals where they're required is exemplary of one of the biggest
differences in design philosophy between Lua and Ruby (the other
language I (am forced to) use), where you require something and it just
dumps all of its constants and classes into your global environment
(usually they are at least namespaced into a single module, but still, ugh).

In Lua I cannot require luasocket or lpeg without any globals being set :( 
Reply | Threaded
Open this post in threaded view
|

Re: "Lua, a misunderstood language"

Robert Burke
On Sun, Jan 17, 2021 at 1:48 AM Spar <[hidden email]> wrote:
>
> Just looked at the source code of luasocket, it doesn't set any global, make sure you do local luasocket = require("luasocket").

Ah, I see that I mean only in lua 5.1 I cannot do this.
Reply | Threaded
Open this post in threaded view
|

Re: "Lua, a misunderstood language"

Sam Putman
In reply to this post by Sean Conner


On Fri, Jan 15, 2021 at 11:40 PM Sean Conner <[hidden email]> wrote:
It was thus said that the Great Timm S. Mueller once stated:
> On Sat, 16 Jan 2021 10:21:46 +0100
> Petite Abeille <[hidden email]> wrote:
>
> > > On Jan 16, 2021, at 03:32, Timm S. Mueller <[hidden email]> wrote:
> > >
> > > Lua always did about everything right, at least for me.
> >
> > Except the module debacle :P
>
> I'm not always following the mailing list closely. What was "the"
> module debacle?

  I think it was the difference in how modules were written between Lua 5.1
and 5.2.  It was quite a change and I think it's what lead to the split
between Lua and LuaJIT.


It wasn't, LuaJIT supports the new style of module and most of the rest of 5.2

The split was due to _ENV, rather than get/setfenv.  This would have necessitated changes to LuaJIT's ABI,
which Mike Pall was unwilling to do, for what I believe were contractual reasons.

cheers,
-Sam.