From owner-freebsd-current@FreeBSD.ORG Thu Aug 19 18:36:00 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC2491065693; Thu, 19 Aug 2010 18:36:00 +0000 (UTC) (envelope-from cpghost@cordula.ws) Received: from mail-yx0-f182.google.com (mail-yx0-f182.google.com [209.85.213.182]) by mx1.freebsd.org (Postfix) with ESMTP id 32DCE8FC28; Thu, 19 Aug 2010 18:35:59 +0000 (UTC) Received: by yxe42 with SMTP id 42so1029497yxe.13 for ; Thu, 19 Aug 2010 11:35:59 -0700 (PDT) MIME-Version: 1.0 Received: by 10.100.80.6 with SMTP id d6mr309115anb.64.1282242959149; Thu, 19 Aug 2010 11:35:59 -0700 (PDT) Received: by 10.101.7.36 with HTTP; Thu, 19 Aug 2010 11:35:59 -0700 (PDT) X-Originating-IP: [93.203.58.222] In-Reply-To: <20100819172227.1AAE25B89@mail.bitblocks.com> References: <4C6505A4.9060203@FreeBSD.org> <4C650B75.3020800@FreeBSD.org> <4C651192.9020403@FreeBSD.org> <4C673898.2080609@FreeBSD.org> <20100818134341.GA88861@johnny.reilly.home> <20100819172227.1AAE25B89@mail.bitblocks.com> Date: Thu, 19 Aug 2010 20:35:59 +0200 Message-ID: From: "C. P. Ghost" To: Bakul Shah Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Doug Barton , Ivan Voras , Andrew Reilly , freebsd-current@freebsd.org Subject: Re: Interpreted language(s) in the base X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2010 18:36:00 -0000 On Thu, Aug 19, 2010 at 7:22 PM, Bakul Shah wrote: > +1 for Scheme! It has a lot in its favor (see below). > > But this is an abstract discussion. Until there are plenty of > useful system scripts (in one of these languages) that people > really want, nothing is going to change. Yes, it's abstract: I want my bikeshed named Gauche (lang/gauche): ;-) http://practical-scheme.net/gauche/ But seriously, the point isn't so much which specific interpreter we use (if we go down this road), it's about libraries: most sysadmin tasks require some basic networking and I/O, and a FFI to seamlessly call out C functions from .so libs. Ideally a shell with a REPL loop, but even that isn't strictly necessary for the scripts. And, of course, instead of writing 1,001 sysadmin scripts with endless code duplication and reinventing of the wheel, common sysadmin tasks should also be made into reusable functions, grouped into modules. We're talking about a major task here, and no matter if it will be in the base or as a port, it's something that will take some time to emerge, so it's not a realistic option in the short (or even middle) term. > There is no reason to wait until something is in the base. > And we don't have to argue about which language. I would > suggest setting up a wiki page to list all the system scripts > people want to write and get cracking in your favorite > language! May the best effort win :-) At the very least we > will get some useful tools out of this effort. =A0I will > certainly help out with Scheme. Funny idea. I only hope we won't end up with a typical post-dot-com young developer distribution, a la: 60% PHP (yuck!) 25% Java (and XML-everywhere) 15% ${OTHERS} ;-) > Scheme has many interpreters & compilers so you can write > Scheme scripts to be interpreted and at some point compile > them for better performance if necessary. Scheme has some > excellent text books, a precise definition for a given > standard, it changes slowly, has IDEs and so on. If you stick > to the R4RS subset, almost every scheme interprpter/compiler > will handle it. =A0It has a very powerful macro facility. =A0Its > interpreters can be very small. s9fes and tinyscheme for > example are about 5K lines of C code each. =A0"Stalin" compiles > Scheme to some extremely tight C code by doing global program > analysis. =A0And there are many other systems in between. =A0slib > is a library of a lot of useful packages that can be used > with most Schemes. =A0Many of these interpreters can be used > from C/C++. =A0Many provide a C-FFI to call C functions. > Tinyscheme packages all of Scheme state in a single structure > so one can easily create a separate Scheme interpreter per > thread. =A0There is even a vi clone written in 4K lines s9fes > Scheme! =A0Still beta but already useful. > > These many choices can be very confusing but we can pick one > and stick to writing R4RS portable Scheme code. Yes, but see above w.r.t. the needed library. And, again, it's an academic discussion, as much as I'd love to do sysadmin scripts in Scheme myself. -cpghost. --=20 Cordula's Web. http://www.cordula.ws/