From owner-freebsd-hackers@FreeBSD.ORG Wed Mar 24 22:05:21 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D684106564A for ; Wed, 24 Mar 2010 22:05:21 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: from mail-ew0-f227.google.com (mail-ew0-f227.google.com [209.85.219.227]) by mx1.freebsd.org (Postfix) with ESMTP id 02B078FC14 for ; Wed, 24 Mar 2010 22:05:19 +0000 (UTC) Received: by ewy27 with SMTP id 27so2085913ewy.13 for ; Wed, 24 Mar 2010 15:05:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:from:date:x-google-sender-auth:message-id:subject:to:cc :content-type:content-transfer-encoding; bh=S8KaulY4c0TubqAu/KK5hW802fl+0R7QeL4elot6xHY=; b=Y0YbrGfFV+4HL7UEuLYJ0SGoip56uEeJr3SJM3PEVm1zzggDX0WsxC1BITjZtMXPcY DJXH3UXpz/5C53Em2DakYcCT0zjHXcoODe8tNb9QWVPNZUW5EphcaelX5UuXnjvBN5fc ETPPY8xeC16JbRQK96JIiN+2qH43dM3TGmAbg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; b=LjUbTjwE+QdaaQXdcuWDnSQhIbZWgAj15Zk3FSXPEexAmQ7Sg6hnUZ92qvKfZiNSQJ 40iodmupviLSNgaR6FOGPzjCVk1JmwIDKUpD+p1CSA3rL+DJ8xhLBBQMTUnM33idvCSu sGQLTOZ7UefAO/BGEJ06WPZIPsRDFPIASwwPI= MIME-Version: 1.0 Sender: ivoras@gmail.com Received: by 10.216.176.206 with SMTP id b56mr2517915wem.63.1269468318141; Wed, 24 Mar 2010 15:05:18 -0700 (PDT) In-Reply-To: <20100324190310.GC88991@server.vk2pj.dyndns.org> References: <201003231108.45102.jhb@freebsd.org> <20100324190310.GC88991@server.vk2pj.dyndns.org> From: Ivan Voras Date: Wed, 24 Mar 2010 23:04:58 +0100 X-Google-Sender-Auth: d78ea06b6dcd662e Message-ID: <9bbcef731003241504k105c0c3bh977ac4e78b350186@mail.gmail.com> To: Peter Jeremy Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org Subject: Re: Another tool for updating /etc -- lua||other script language bikeshed X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Mar 2010 22:05:21 -0000 On 24 March 2010 20:03, Peter Jeremy wrote: > On 2010-Mar-24 14:11:21 +0100, Ivan Voras wrote: > There's awk (though it's somewhat restricted in its abilities to do > anything more than text manipulation) but in principle, I agree. =C2=A0Th= e > requirements as I see them are (in no particular order): > - BSD-compatible license > - must be compatible with buildworld (primarily, it must be possible > =C2=A0to cross-build) > - contains a critical mass of users in the FreeBSD developer (and > =C2=A0ideally committer) community > - language must be reasonably stable - will a script written today still > =C2=A0work correctly in (say) 5 years. > - must be acceptable to the vast majority of the user base (no religious > =C2=A0wars allowed) > >>There was once Perl in base and even though I personally dislike Perl at >>least it was a standard of sorts and guaranteed to be there if needed. > > It was removed because it didn't support cross-building (buildworld is > always done as a cross-build) and was evolving at a rate incompatible > with the base system. > >>As a possible alternative, or at least to learn about others' opinion on >>the subject, I'd like to suggest Lua (http://www.lua.org/). > > As someone who has never used Lua, how well does it meet the > requirements above? I would also like to avoid holy wars so I really want this to be discussed. I'm more pushing in the direction of "give us something nicer than sh" than I'm specifically pushing Lua. To the best of my knowledge, the answers to your questions for Lua are: > - BSD-compatible license it's MIT-licensed. > - must be compatible with buildworld (primarily, it must be possible > to cross-build) I'm not sure what you mean by "cross-build". If you mean it needs to support some specific compiler magic, then I don't know. I do know this: its src directory is flat (32 .c files, 23 .h), its Makefile basically says "compile all these .c files into an executable or a library with CC options varying by platform", and it's ported to at lest these operating systems: aix ansi bsd freebsd generic linux macosx mingw posix solaris - the presence of solaris indicates 64-bit and big endian - aka the big portability test. I've just verified that a working executable can be compiled with "gcc -o lua -lm *.c" (if you remove the "luac.c" with duplicates a main() in addition to the interpreter "lua.c"). > - contains a critical mass of users in the FreeBSD developer (and > ideally committer) community > - must be acceptable to the vast majority of the user base (no religious > wars allowed) Have no idea. Possibly the biggest single obstacles unless they're modified to "has the biggest number of people not specifically objecting to it" > - language must be reasonably stable - will a script written today still > work correctly in (say) 5 years. The Wikipedia entry for it (http://en.wikipedia.org/wiki/Lua_%28programming_language%29) says it's been started in 1993. AFAIK it has always been backward compatible and the recent version is 5.3. One thing I remember it for is that many Windows games (including some classics like Baldur's Gate II... I'm sure some people remember it) were scripted by it. I'd like to summarize why I think Lua is a good idea here: * Small footprint (150-200k executable). Can be compiled with gcc -o lua -lm *.c. * Can be embedded into C apps for scripting, can use C for extending it (designed to make both directions trivially easy) * Is kind of like Python (supports OOP, partly functional, etc. styles) without the extensive libraries. (but has no "significant whitespace" issue).