Theiling Online    Sitemap    Conlang Mailing List HQ   

Re: CHAT: proramming langs, was Re: CHAT: OS pain

From:Brook Conner <nellardo@...>
Date:Tuesday, November 16, 1999, 0:18
Charles writes:
 > Brook Conner wrote:

 > >  > Most programming languages imitate algebra.
 > >
 > > Hardly.
 >
 > In a sense.

What sense? "function" and "variable" do not mean the same thing in a
PL as they do in algebra. Not by a long shot. Some of the earliest PL
developers (Wirth, maybe) might have cited algebra as an inspiration,
but contemporary researchers in PLs certainly don't - I think that
inspiration died by the time of C.

Sure, most PLs support some form of mathematical expressions, but even
those have little to do with *algebra* - you can't have the PL solve
them, for instance (for damn good reasons I might add), much less do
more interesting things to them, like re-arrange terms, take
derivates, etc. You have to switch to a special-purpose package like
Mathematica to get that much "algebra."

[...]

 >
 > >  > On another hand,
 > >  > Perl was designed by some one with linguistic training.
 > >
 > > the syntax and semantics of Perl is still
 > > horrendous. Don't get me wrong - it is clearly a useful tool,
 >
 > Right. Unfortunately, there's nothing better at present
 > for what I like to do. At least there was some awareness
 > of linguistics, getting away from the algebraic model.

What kind of awareness of linguistics are you referring to? String
processing?  Regular expressions?

We must have different ideas about what constitutes "linguistic" in a
PL.  I mean a language that has some of the facilities of human
language in the areas of discourse, flexibility, and error tolerance.
You *seem/* (but I'm just inferring here) to consider linguistic
support in languages to be sophisticated string processing.

If that's the case, then Emacs Lisp would be very
"linguistic". Haskell would be as well, perhaps more so (despite the
lack of as broad a library for Haskell as there is for emacs).

For example, the filling algorithm in Haskell:

tabWidth = 5 -- or whatever -- parametrize this if you want

fillText :: Int -> String -> String
fillText width text = fillTextTail width text 0

fillTextTail width ch:rest counter
   | counter > width = '\n' : fillTextTail width ch:rest 0
   | ch = '\n'       = fillTextTail width rest counter
   | ch = '\t'       = ch : fillTextTail width rest counter + tabWidth
   | otherwise       = ch : fillTextTail width rest counter + 1

That's it. Look at each character. If the counter is over the width,
stick in a new line and continue. If the character is a new line, eat
it, and continue, if a tab, leave it, but add more to the counter. If
it is anything else, leave it, and continue, adding one to the counter.

 > My degree's in math, but IMO programming languages ought
 > to be more linguistic than algebraic.

So does the Haskell example move towards the "linguistic" as you mean
it?  Or is it something else?

 > >  > But the shell script command langs are more "linguistic" than
 > >  > those.
 > >
 > > Um, barely.....
 >
 > Lots. I use bash or plain Bourne shell, never C-shell anymore.

Again, I think we have a different conception of what "linguistic"
means - shell scripts usually have some sort of regular expression
mechanism built in, but very few spoken languages are amenable to
regular expressions (lojban is the only one I know offhand).

 > >  > Basically, verb-objects with some adverbial-prepositional elements.
 > >  > The subject is always "you" and elided. Weird punctuation and anaphora!
 > >
 > > Yeah, if you conceptualize the shell as "you", which, at least IME,
 > > programmers do not do (I *certainly* don't).
 >
 > Then, what's the subject? "Computer, you must now list the directory."
 > ... "Aaaaah! not that way!"

What's the subject when you use a hammer?  There isn't one that isn't
yourself. The hammer is a tool, not an agent. Shells are not agents
(in the linguistic sense) - they are tools.  IME, power users don't
talk to shells. More, they push the buttons, only the buttons are
infinite, because they are defined by a shell language. Just because
we call it a "language" doesn't mean we think we're speaking to the
computer.

 > >  > GUIs have taken the field temporarily, but I expect a return
 > >  > of the old command-line, in the form of speech-based interfaces.
 > >
 > > Erm. Try doing a spreadsheet that way....
 >
 > Who needs spreadsheets?

Your accountant. Every MBA on the planet. All businesses. Banks. You
name it.

Speech isn't going to supplant guis for the tasks that guis are doing
today - you aren't going to do much in desktop publishing with a
speech interface - it would be clumsy, and whether or not it actually
was slower, users would feel it was slower (odd factoid - keyboard
shortcuts take *more* time than mousing to a menu - people jsut
*think* they're shorter because their mind is busy with the keyboard,
but idle with the mouse).

 > > And if you want Microsoft software driving your car, you must have a
 > > death wish :-)
 >
 > Linux only. Maybe even Java connected to an external control system.
 > Microsoft is synonomous with "crash" or "blue screen of death".

I might use Java to control the stereo or the air conditioner.  But
not the brakes :-)

 > >  > > e) easy to learn
 > >  >
 > >  > Really-easy-to-learn implies pidgin, somewhat verbose.
 > >  > No morphology; SVO; all CV or CSV syllables, no diacritics.
 > >  > That's my guess.
 > >
 > > Okee-day, my give up. "CSV"?
 >
 > A semi-vowel "y" / "w", and maybe "r" / "l".
 > Relatively easy to pronounce, larger syllable inventory.

Ah. S for semi-vowel. Duh.


Brook

---------
THE TOP 15 BIBLICAL WAYS TO ACQUIRE A WIFE

8. Cut 200 foreskins off of your future father-in-law's enemies and
   get his daughter for a wife.
   - David (I Samuel 18:27)

---------
Fancy. Myth. Magic.
http://www.concentric.net/~nellardo/