Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!multikabel.net!newsfeed20.multikabel.net!newsfeeder.ewetel.de!border3.nntp.ams.giganews.com!Xl.tags.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!local2.nntp.ams.giganews.com!nntp.lyse.net!news.lyse.net.POSTED!not-for-mail NNTP-Posting-Date: Mon, 10 Jun 2013 02:29:58 -0500 Message-ID: <51B58076.7030005@westcontrol.removethisbit.com> Date: Mon, 10 Jun 2013 09:29:58 +0200 From: David Brown User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130515 Thunderbird/17.0.6 MIME-Version: 1.0 Newsgroups: alt.comp.lang.lua,comp.lang.c To: Ivan Shmakov Subject: Re: [OT] Lua References: <21ee45ab-771f-436b-a6df-f48a5939ae13@googlegroups.com> <87obbgpkzw.fsf_-_@violet.siamics.net> In-Reply-To: <87obbgpkzw.fsf_-_@violet.siamics.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Lines: 44 X-Usenet-Provider: http://www.giganews.com X-AuthenticatedUsername: NoAuthUser X-Trace: sv3-C6JiN08a7BxY1gI6JRzRI07e65fhAhuBd4gs9C/Umsn5k59rLJ6O2vm3SjB0R1Ju+bJsNYFr13gAWbV!ISMzCySe0Lh64Psy6Hl4p3Tg2D/RGgtIXx56ibVSpUPw2MbdGktweFX464237KDNtl0hpIEafo6s!UtWBcP/F8H8= X-Complaints-To: abuse@altibox.no X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 3369 Xref: csiph.com comp.lang.c:33508 On 08/06/13 19:31, Ivan Shmakov wrote: >>>>>> Seebs writes: >>>>>> On 2013-06-06, Jorgen Grahn wrote: > > [Cross-posting to news:alt.comp.lang.lua, just to make keeping > the track of it easier.] > > >> That /is/ a good idea (the general one: learning C by using it for > >> extensions to your favorite scripting language). We should remember > >> to suggest that the next time someone asks. > > > It is. And I quite like Lua, too. :) > > I wonder, what's so good in Lua specifically? > > Indeed, it seems to be one of the first "embeddable" languages > to appear, but now that a number of them (including a variety of > Lisp derivatives, Python, and of course Tcl) has reached the > "mature" state, I don't quite understand, -- why Lua? > > And personally, I tend to like Tcl for the purpose, mainly for > its well-designed FFI, its support for Unicode, and that it > looks like a mature language for years now. > > (... But more than that, I like to embed C into HLL software, > such as that written in Perl, -- and not the other way around.) > > PS. I hadn't yet the chance to say I'm glad to see you're back to > Usenet. So I do it now. > Lua is much smaller than Python (in terms of the language, the libraries and the implementation). If you need a powerful and flexible language with all the bells, whistles and libraries you could imagine, go for Python. But if you need something small, fast (for an interpreted language) and simple, then Lua is probably a better choice. And while it is possible to mix C and Python using things like swig or ctypes, or writing python extensions in C, it is usually much simpler (and much more efficient at run-time) to integrate C code with Lua. Personally, I write most desktop/server code in Python, but when I want to add scripting to microcontroller code in C, I use Lua.