Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Jul 2002 21:48:17 +0100 (BST)
From:      Mark Valentine <mark@thuvia.demon.co.uk>
To:        "Brian F. Feldman" <green@freebsd.org>
Cc:        naddy@mips.inka.de (Christian Weisgerber), freebsd-arch@freebsd.org
Subject:   Re: Scripting languages (was: Re: Package system flaws?)
Message-ID:  <200207232048.g6NKmHQe028433@dotar.thuvia.org>
In-Reply-To: <200207231916.g6NJGTj47459@green.bikeshed.org>

next in thread | previous in thread | raw e-mail | index | archive | help
> From: "Brian F. Feldman" <green@freebsd.org>
> Date: Tue 23 Jul, 2002
> Subject: Re: Scripting languages (was: Re: Package system flaws?)

> Mark Valentine <mark@thuvia.demon.co.uk> wrote:
> > If I could use sh for that middle stuff, my life would be that bit more
> > complete.  So far all we've identified that's truely missing are better
> > array/list handling and extensibility via dynamically loadable modules.
> 
> It's not just a question of if you could, though; the question is if 
> everyone else is willing to live with the rest of the shell's shortcomings 
> for it to be used as a secondary /systems/ programming language for anything 
> moderately _complex_.

We're not arguing about people's choice of scripting language for _complex_
tasks.  Install and use what you will.

All I'm talking about is the smallest possible enhancement to facilities in
the base system which reduces the number of people who feel they have to go
to a third party tool, and provides something which is quite good enough to
write, for example, packaging tools with, so that those tools can be in the
base system where they belong.

> > You didn't say why you considered it _BAD_.
> 
> I have lots of reasons.  There were the compromises made by inability/
> unwillingness to initially support any form of either built-ins or 
> syntactical constructs.

Are you talking about historical stuff here?

> It's not a lack of syntactic verbosity; it doesn't 
> have a normal syntax.

Define "normal"...

Sure, it could be nominally improved, but don't change what ain't broke (see
where that got csh...).

Since, by the time I started writing sh scripts, "|" was already preferred
over "^" for pipes, my old scripts will often run just fine under a "modern"
sh.

A scripting language should have a concise syntax; what's good for a compiled
language environment is not necessarily good for scripting.  One major value
of a concise syntax is for rapid prototyping.

> Cleanliness was compromised in order to have something 
> that was easy to implement as a bunch of external commands.

For some definition of "cleanliness"...

Considering the time frame, that design sure turned out to be a winner!

Wasn't the "cleaned up" design called rc...?

> Function call syntax is painful at best,

It's simple and functional.  What's painful about it?  (Myself, I find it
less painful than any other function syntax I've met.)

> as well as default global scoping for variables, 

Again, that's a good feature for scripting (I hate having to declare
globals all over the place in Tcl).

Besides, our sh has locals.

(In my portable code, I tend to use a an underscore prefix for local
variables, which doesn't fix the problem for nested function calls, but
does reduce it somewhat.)

> no ability to separate environment variable space from normal variable space.

They are separate (see "export").  You're probably disagreeing with the fact
that the shell imports all environment variables as shell variables by default.

> Like typing?  Typing could either possibly be implemented in your shell, in 
> any number of ways, or it could not be implemented and you'd have to find 
> some other way to define what a variable is...

Loose typing is good for scripting.

> There's room for a real language instead of just extending sh.

There are plenty to choose from, but there are currently no clear candidates
for the base system.

Considering the amount of code I've written in it, the Bourne shell seems
"real" enough for me.

And it's already installed.

		Cheers,

		Mark.

-- 
Mark Valentine, Thuvia Labs <mark@thuvia.co.uk>       <http://www.thuvia.co.uk>;
"Tigers will do ANYTHING for a tuna fish sandwich."       Mark Valentine uses
"We're kind of stupid that way."   *munch* *munch*        and endorses FreeBSD
  -- <http://www.calvinandhobbes.com>;                  <http://www.freebsd.org>;

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200207232048.g6NKmHQe028433>