From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27511 invoked by alias); 13 Feb 2007 19:00:46 -0000 Received: (qmail 27500 invoked by uid 22791); 13 Feb 2007 19:00:45 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 13 Feb 2007 19:00:41 +0000 Received: (qmail 22922 invoked from network); 13 Feb 2007 19:00:39 -0000 Received: from unknown (HELO localhost) (jimb@127.0.0.2) by mail.codesourcery.com with ESMTPA; 13 Feb 2007 19:00:39 -0000 To: Eli Zaretskii Cc: gdb@sourceware.org Subject: Re: GDB and scripting languages - which References: <20070108222005.GA27451@nevyn.them.org> <20070210203307.GA27502@nevyn.them.org> From: Jim Blandy Date: Wed, 14 Feb 2007 05:57:00 -0000 In-Reply-To: (Eli Zaretskii's message of "Mon, 12 Feb 2007 22:34:54 +0200") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2007-02/txt/msg00110.txt.bz2 Eli Zaretskii writes: >> From: Jim Blandy >> 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.