lua-users home
lua-l archive

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


On Mon, Jan 20, at 02:41 Αγαθοκλής wrote:
> 
> And speaking for simplicity. Lua is simple. And when you are talking about Python,
> is that you turn things up!  Python is the one that should dream about Lua and not
> the other way around. If Python and Lua, as they are now (the core language i mean),
> started right now their career, who would you think that it would dominate the world?
> We all know that. So i guess there is a hope that if you got it right and fight for
> it, Lua can become mainstream. Note, that i believe that Lua already is mainstream.
> When people talking about embedded languages, the first one ALWAYS in the list, as
> a reference, is Lua. You have the machine. Be clever!

Please, let me allow to hopefully help a bit the situation.

Currently for non prime programmers (students, teachers, scientists, ...) there are
two main choises:

  - if you want beauty and expression, Ruby

  - if you want concise and without ambiguities syntax, and preferable "one way to do
    things", Python

I guess most choose Python because of its clean and easy to understand syntax. It is
also much easier to learn and it takes much less time to write your first code and
through any fear.

For programmers that are looking for a language that is efficient, fast and gently
with the resources there is a gap. Probably most of them heard and tried Lua once.

But what are these reasons that do not develop in Lua the killer applications?

Of course the first reason, is that they want their application to matters in the
market. A long time support for sure. Both those reasons are missing from Lua.

The first because is the feeling that get, which is the same feeling you got, that
nobody cares - this is not true, but it's true also as Lua looks too much like an
academic toy to them. The last condition is also the second reason.
There is no built in stone guarrantee. There is no foundation! And the only way to
change the bits in the code is by monkey-patching. This is great flexibility, if you
ask me but also a great diverse.

Speaking for the syntax and the core language, and taking as facts the current state
of programming languages and the programming evolution (it is important to see it
that way).
There are a couple of things that are all facing, that even they don't like at all,
or they need some time to see the light. You all know them but i'm gonna to repeat:

The prime and the only type in Lua are tables. It's an absolutelly genious piece of
code design, but at the same time a bit confusing. This adds overhead in their minds.

The second thing is this "local" stuff. I'm sorry to say that lessons learned.
The default scope for any declaration, and this is going to be forever and ever,
is local scope. In C, fortunatelly recent development fixed this, by given the
-fvisibility=hidden flag that turn things up/down. That every object, unless is
instructed specifically, has local scope to the compilation unit. Globals are evil
and should be avoided and only allow them explicitly.

The fourth is the lack of a standard library. For this allow me to disagree that such
a library should be blessed by Lua team. First because of the energy that they have
to spend, and secondly because, and i can bet for this, they don't use Rocks. So this
clearly is an omission of the community. Please, we all know that you can handle the
situation by yourselves. Perhaps this list has the highest average of expertize in
all the programming universe, because of the plularism in your knowledge in all the
other domains of programming, even if it is a specific and difficult for everyone to
grasp, or because you are fluent to many many other programming languages. But we'll
know, that besides C and the new (very promised) kid in town, zig, give a some kind
of disatisfaction. So you can't at the same time critisize or to wonder, why Lua is
not taking the world as it worths to take, and at this same time do nothing for it.
Simply the answer to this is because you don't do nothing for it.

That was the diagnosis. If you disagree, you don't go further.

So allow this uneducated ex-sepherd punk to take for a few minutes of his life the
responsibility of being a CEO in the Lua universe. I was joking but at the same time
perhaps is what you are missing. Last time, i took the courage to point to Dirk for
this role, but we missed him. So speaking as a CEO and with the usual disclaimer:
I do not write in Lua, my last two years i write in C and i need another eighteen to
be proficient and i do not know if i catch up in my 53 and with four kids to feed,
working in the fields, so if i get some things wrong or they are too optimistic, do
not hesitate to correct. But my mind is going to blow away by staring the posibilities.

So:
Around this company :-), there are some of the best living developers in the planet.

As far it conserns the syntax, i'm thinking of the following changes (some of them
are only cosmetics and some are enhancements, all of them might be quite intrusive):

  - replace local with var
  - use let for constants
  - use public for explicit global scope
  - split with clear semantics the table type (into array and dictionary types)
  - do not allow syntax ambiguities, possibly introduce by default the semicolon, or
    otherwise you go the Python way and use spaces to denote blocks, but avoid with
    any cost such syntax ambiguity. The code should be easy to parse for the human
    mind and without second thoughts. Speaking generally, nowhere in the code, should
    be spend on syntax thinking thing, only devote this energy to logic
  - introduce a blessed by the community an object oriented style (i know there are
    many people that do not like it, but the fact is that can be very usefull for
    large scale projects, but of course do it the Lua way)
  - use zero-based indexing as everyone in the world does, even if you got it right,
    which you didn't (in my humble opinion)
  - possible use optional static typing like ravi does, which is proved that provides
    performance boost

If you do that, possible one weak job for a dedicated developer (but lets say at the
end of this year), then make a big fuss with a short summary, like:

char promise[] = "I won't break any code again. This product is quite mature.\n"
"The community ended up on this, and any new code will be compatible from now and "
"it will be compatible for the next hundred of years.\n"
"Same promise for the C API.\n"
"We also incorporated jit technology.\n"
"It is also capable to compile your code in wasm.\n"
"With the distribution is bundled a native package manager which built in Rock.\n"
"The community has already over 2 thousands of packages to choose.\n"
"For your convenience we offer also a basic standard library, wwhich should be "
"enough to cover basic expectations, that can be used as starting point.\n"
"As you might know, We favor flexibility/mechanics and design instead of Policy.\n"
(thanks Rodrigo)

#ifdef WE_WORKED_A_LITTLE_BIT_HARDER
"It is also capable to export/import your code in/from any language you want.\n"
"It also offers a distribution ready to be used instantly in small devices.\n"
#endif

"We benchmark this and proved to be the faster interpreted language.\n"
"Our bencmarks shows that is quite efficient with memory resources.\n"
"And because we don't use globals at all, it should work perfectly in \n"
"multithreads applications.\";

for (int i = 0; i < zillion_of_times_in_the_biggest_forums; i++)
fprintf (stdout, "%s\n", promise);

When you are done with this, then we'll discuss for the next step, which is
to provide products (community based and with respects to the environment :)).

If you make any money (for the start you might want to give 1 euro per month
to be indepented), then do not forget me. If i won't be alive, give them to
my kids.

This thread it should die as it deserves, because it speaks about others and
not for what we can do. If we continue to complain, then it is because we
like to cry, possible because we didn't have too much attention in our life.

All the best to you all,
  Αγαθοκλής