Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Aug 2010 20:35:59 +0200
From:      "C. P. Ghost" <cpghost@cordula.ws>
To:        Bakul Shah <bakul@bitblocks.com>
Cc:        Doug Barton <dougb@freebsd.org>, Ivan Voras <ivoras@freebsd.org>, Andrew Reilly <areilly@bigpond.net.au>, freebsd-current@freebsd.org
Subject:   Re: Interpreted language(s) in the base
Message-ID:  <AANLkTi=z7Z2emB2tzxj73nJYLSSwUy4GSg8=h37Sb8gT@mail.gmail.com>
In-Reply-To: <20100819172227.1AAE25B89@mail.bitblocks.com>
References:  <4C6505A4.9060203@FreeBSD.org> <4C650B75.3020800@FreeBSD.org> <4C651192.9020403@FreeBSD.org> <i477eo$i4d$1@dough.gmane.org> <4C673898.2080609@FreeBSD.org> <AANLkTim_prShRiHkLnFbhek9%2Beaa-KaJ5oZtNo%2BLd0K1@mail.gmail.com> <alpine.BSF.2.00.1008152240370.66595@qbhto.arg> <20100818134341.GA88861@johnny.reilly.home> <AANLkTinHtzt=ELPvQBaaRBUzN-U88EXDMenZwrRsY3NL@mail.gmail.com> <20100819172227.1AAE25B89@mail.bitblocks.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Aug 19, 2010 at 7:22 PM, Bakul Shah <bakul@bitblocks.com> 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/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTi=z7Z2emB2tzxj73nJYLSSwUy4GSg8=h37Sb8gT>