lua-users home
lua-l archive

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





On Sat, Jul 5, 2014 at 10:46 PM, William Ahern <william@25thandclement.com> wrote:
On Sun, Jul 06, 2014 at 12:15:16AM -0300, Carlos Pita wrote:
> If you do a lot of work with tables you will dislike the syntax:
>
> table{ ....}end
>
> and certainly won't consider {} syntax sugar.
>
> Similarly, if your coding style relies a lot on higher order functions
> you may find:
>
> function()....end
>
> too noisy in contexts like:
>
> seq:foreach(....) or
>
> seq:map(....) or, worst:
>
> switch(
>    ...., ....,
>    ...., ....,
>    ...
> )
>
> Lua semantics doesn't preclude this coding style at all (which, btw,
> is not just about toy dsls). But it syntax discourages it.
>
> I really can't see the ton of effort for a little return here.
>

What's the #1 excuse for not using a language like Lua: popularity.

It's a valid excuse, because using an unpopular language means more time and
expense training your engineers, or finding engineers comfortable in that
language, compounded by the the looonngggg maintenance curve. Plus, it makes
it more difficult to integrate or reuse modules and libraries. (Even if your
syntax change doesn't hinder using third-party modules, it does hinder your
ability to reuse your code elsewhere.)

Now, as niche of a language Lua is, any DSL based on Lua is infinitely more
so.

That's a _huge_ cost.

Python can't hold a candle to the power and capability of PUC Lua, yet when
a corporation chooses a language like Lua over Python, it's a very serious
decision because there are immense costs involved, immediate and
prospective.

The same considerations apply regarding a DSL, and as nice as some of these
enhancements to Lua are, are they really the same order of difference as
between Lua and Python? IMO they should be to justify the costs.



I think that many people pick Lua because their use case has no alternative. There is not another language implementation that can provide scripting or a dynamic language that will work as fast as Lua. If we liked Python or _javascript_, we couldn't have used it for our task.

Also, many companies use Lua to provide scripting (or what have you) to their users. They may also use Lua for application code, but that might be separate. Many use cases operate out of the assumption that their users don't know any programming, so why bother bending to a familiar language when your users are familiar with nothing?

Finally, some companies will futz with out of ego or out of a desire to make it special to them. Maybe they want lock-in or maybe there is a legitimate domain problem that is better served by a slightly different language than PUC Lua.

More than any other niche or dynamic language, Lua has opportunities that make it ripe for modifying.