lua-users home
lua-l archive

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


On Mon, Mar 12, 2012 at 4:14 AM, Miles Bader <miles@gnu.org> wrote:
> "Patrick Mc(avery" <patrick@spellingbeewinnars.org> writes:
>> Python is so much easier to learn then Lua
>
> In a fanboi's dream, perhaps...

Well, just like Lua is fantasy JavaScript with all the bugs fixed and
cut down to the essential core, what's the analogous fantasy Python?

Python takes the (LISP2-like) route of putting attributes and
subscripting in different namespaces. (There is no t.f -> t['f']
transformation.) In general Python prefers common forms to show up in
syntax rather than building them out of function application. Keeping
Python the Language means keeping all of the abstractions implied by
things like array slice syntax. So the batteries-not-included form of
Python the Distribution will still be significantly larger than Lua
since it needs the classes to back those abstractions.

Whether it is more ergonomic to have to remember syntax, or to
remember how to fit function application and metatables together for
common patterns is...a good question.

Bare Lua arguably is in a worse position for this for beginners since
the functions for common patterns are not all there either; _G is a
bit scattershot. Everybody has to rewrite stuff like keys() (aka
invert) which is a double-burden for beginners: they have to build
their own light saber, and they have to recognize these patterns in
other people's code and figure out what it's called there.

There's also a cost to answer "how do I do an HTTP POST"--something
every other language ships with--by pointing at a separate package
which must be compiled and installed. (As a separate matter, I find
LuaSocket to be somewhat beginner-unfriendly in wanting me to use
sources and sinks all the time. It was not obvious to me how to do an
HTTP POST with arbitrary headers and an arbitrary body and I'm not
new.) Beginner-friendly doesn't mean everybody has to use the same
stuff, but the efforts to get "best current extensions" together in
one distro are a significant aid to learning how to use the language
to Get Things Done. Scheme had[1] this problem too, but it was
exacerbated by the number of implementations.

Jay

[1]: I'll just leave it ambiguous whether I'm implying Scheme no
longer has this problem or that Scheme itself deserves the past tense.