Re: GDB and scripting languages - which

Jim Blandy
2007-02-13T19:00:46Z

Eli Zaretskii <eliz@gnu.org> writes:
>> From: Jim Blandy <jimb@codesourcery.com>
>> Date: Mon, 12 Feb 2007 09:25:09 -0800
>>
>> There's a lot about Lua I like. However, it doesn't have exceptions.
>
> I think you are mistaken: Lua does have exceptions, it just calls them
> ``fallbacks''.

When I search the manual at http://www.lua.org/manual/5.1/, I don't
see any references to 'fallbacks'. The Lua HISTORY file mentions
them, but they seem to be an operator overloading mechanism, not an
exception-handling mechanism. Where can I find documentation on
these?

>> My personal three language essentials are:
>>
>> - type-safety (programs get errors, not segfaults)
>> - automatic storage management (I don't need to call 'free'), and
>> - exception handling (I don't need to check for an error return code
>> if my response will be to simply report it up to my caller)
>
> By type-safety, do you mean that variables can hold different types of
> objects, and programs that apply operators to operands of wrong types
> are treated gracefully, then I think Lua qualifies.

The second clause: "programs that apply operators to operands of wrong
types are treated gracefully". Lua does qualify as a type-safe
language, and it does provide automatic storage management. (All the
scripting languages I've seen do.)

> Anyway, two advantages of Lua are:
>
> . It was designed from ground up to be primarily an extension
> language, not a general-purpose language that just happens to have
> C bindings for its interpreter; therefore it is small and
> efficient (by a large factor compared to Tcl, for example).
>
> . It's typeless and generally lacks the clutter that more
> ``complete'' programming languages require: type declarations,
> memory allocations, initialization before use, etc.

I agree with both of these.

Even if the exception issue is worked out, though, I'm still concerned
that Lua doesn't have as much momentum as Python. Python's wealth of
other libraries available (gui; graphing; networking) brings a lot of
potential with it. And there are a lot of programmers out there who
could just start scripting GDB the day Python support is committed.