Lua voices

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

Re: Lua voices

Thijs Schreijer


> On 5 Jul 2018, at 02:27, Andrew Starks <[hidden email]> wrote:
>
> I think it’s a great sign that we see the same few tired issues get trotted out ad nauseam. It means that there are very few real problems left to solve at the language level and people are left battling their own preconceived notion of what perfection looks like, convinced that if only their proposal for globals or lists or case statements or... would be adopted, some nebulous goal would be achieved Lua would finally be... what?
>
> We are all the hero of whatever narrative we’re creating and it’s easy to be convinced of our own brilliance. And fortunes have been built on Lua as it is. So come with data and a real problem to solve or know that your just venting a bunch of noise.
>
> Voices are fine, if they start with a good story about a problem that’s hard to solve the way Lua is. I think it’s ignorant to start off with statements like, “global by default is bad...” Better to come with your hat in your hand and ask, “Why?” first.
>
> -Andrew

I completely agree. Jean-Luc Dehaene (former Belgium prime minister) once said that politicians should not be doing whatever the people want them to, but instead they should show the people the right way. I think this equally applies to language designers. And as far as I’m concerned the Lua team has done a great job at this.

Thijs

Reply | Threaded
Open this post in threaded view
|

Re: Lua voices

Viacheslav Usov
In reply to this post by Andrew Starks-2
On Thu, Jul 5, 2018 at 2:28 AM Andrew Starks <[hidden email]> wrote:

> I think it’s ignorant to start off with statements like, “global by default is bad...” Better to come with your hat in your hand and ask, “Why?” first. 

That sounds as if this discussion had started just yesterday.

Well, it did not, and even the designers of the language admit that "global-by-default" might be a problem.

Roberto, 3 Oct 2006:

Local by default is wrong. Maybe global by default is also wrong (as
David just wrote), but the solution is not local by default.


Roberto, 11 Jul 2010:

For me this issue has been settled a long time ago. The problem
in "anything-by-default" is not the choice of "anything", but the
"by-default".

[...]

I still think the main problem is non-intended assignment to globals,
which creates hard-to-find bugs. The simple policy of requiring a global
declaration to assign to globals would force programmers to consider
whether they really want a global variable.


I am not even quoting much older messages from Roberto which discuss that a "next version" of Lua would have the global keyword. Clearly the problem of "global-by-default" is a problem that has a long history.

Cheers,
V.
Reply | Threaded
Open this post in threaded view
|

Re: Lua voices

Axel Kittenberger
I still think the main problem is non-intended assignment to globals,
which creates hard-to-find bugs. 

And I fully agree with that, and this applies to config files as well. Missspelling of variables cause silent missconfigurations.

As posted, one can fix that with a metatable to _G. 

The one "issue" (under quotes) I see is a more general terms, the dialectic of Lua of wanting to be a simple and newcomer friendly language on the one hand, denying convenience operators like ++, ?:, etc. that some think look scary, indexing by 1 and the hard to get/understand semantics to fix globals via a metatable to _G on the other hand (or metatables in general, goto statements, etc.). And no I have no idea how to "fix" this, it's just a result of the way Lua grew over the decades with diffferent foci.

Or to say it differently: personally I'm all fine the way globals are handled or how I can fix it with a metatable to _G. IMO it just should be simpler for people that don't want to embrace the shenanigans of metatables which is a hugh requirement for someone who is supposed to feel 0-indexing too unnatural and can't handle the ?: operator.
Reply | Threaded
Open this post in threaded view
|

Re: Lua voices

Dirk Laurie-2
2018-07-05 11:54 GMT+02:00 Axel Kittenberger <[hidden email]>:
>> I still think the main problem is non-intended assignment to globals,
>> which creates hard-to-find bugs.
>
> And I fully agree with that, and this applies to config files as well.
> Missspelling of variables cause silent missconfigurations.
>
> As posted, one can fix that with a metatable to _G.

Please put comments like these on the "Say no to global by default"
thread.

Reply | Threaded
Open this post in threaded view
|

Re: Lua voices

Dirk Laurie-2
In reply to this post by Viacheslav Usov
2018-07-05 11:28 GMT+02:00 Viacheslav Usov <[hidden email]>:

> On Thu, Jul 5, 2018 at 2:28 AM Andrew Starks <[hidden email]> wrote:
>
>> I think it’s ignorant to start off with statements like, “global by
>> default is bad...” Better to come with your hat in your hand and ask, “Why?”
>> first.
>
> That sounds as if this discussion had started just yesterday.
>
> Well, it did not, and even the designers of the language admit that
> "global-by-default" might be a problem.

Please put comments like these on the "Say no to global by default"
thread.

Reply | Threaded
Open this post in threaded view
|

Re: Lua voices

Dirk Laurie-2
In reply to this post by Andrew Starks-2
2018-07-05 2:27 GMT+02:00 Andrew Starks <[hidden email]>:

> I think it’s a great sign that we see the same few tired issues get trotted
> out ad nauseam. It means that there are very few real problems left to solve
> at the language level and people are left battling their own preconceived
> notion of what perfection looks like

I'll take this comment as agreement with what I was trying to convey
in starting the "Lua has reached a local optimum" thread. :-)

Reply | Threaded
Open this post in threaded view
|

Re: Lua voices

Andrew Starks-2


On Thu, Jul 5, 2018 at 05:26 Dirk Laurie <[hidden email]> wrote:
2018-07-05 2:27 GMT+02:00 Andrew Starks <[hidden email]>:

> I think it’s a great sign that we see the same few tired issues get trotted
> out ad nauseam. It means that there are very few real problems left to solve
> at the language level and people are left battling their own preconceived
> notion of what perfection looks like

I'll take this comment as agreement with what I was trying to convey
in starting the "Lua has reached a local optimum" thread. :-)

I think you and I and others have been saying that for a while.  :)

-Andrew

12