Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ancestry of perl features

15 views
Skip to first unread message

Uri Guttman

unread,
Jan 20, 1999, 3:00:00 AM1/20/99
to

i have been pondering perl's ancestry and for curiosity's sake i have
been thinking about which languages (if any) influenced various perl
feature. some are borrowed from one language which borrowed from an
earlier one. some are pure perl from the head of larry and his cohorts.

some are very obvious (or not). here is a starting list. feel free to
add, comment or flame.

math infix ops (+, *, /, etc) C
exponentiation (**) PL/I (others too)
math comparison ops (==, >, ) C (others used = for ==)
assignment ops (+=) C
short circuit ops (||, &&) C (text versions are perl)
bit ops ( |, &, ^, <<, >> ) C
auto-increment/decrement C (magic ++ is perl)
dereference (->) C (from PL/I)
scalar range (..) awk (list .. is perl)
bind (=~) awk
scalars as string or number sh
arrays of scalars csh? (the $a[0] syntax is similar)

tr/// tr, sed y (does anyone use y?)
s/// sed
m// many unix programs (awk,sed,more,etc.)

-p option sed
-n option awk

varying lenghth strings (no \0 needed) sh, PL/I
substr PL/I

grep unix
map lisp
lists lisp, apl
slices apl
hashes awk

flow control (for, while, etc) C
foreach perl
statement modifiers perl?

eval string sh
eval block perl

file test ops sh (perl added many)
file functions C, unix

system call functions C, unix

networking functions C, unix

get*by* functions (gethostbyname) C, unix

glob (<*>) csh


that's enough for me for now. all i can say is that larry is a high
quality thief! :-)

uri

--
Uri Guttman Hacking Perl for Ironbridge Networks
u...@sysarch.com u...@ironbridgenetworks.com

Larry Rosler

unread,
Jan 20, 1999, 3:00:00 AM1/20/99
to
In article <393e553...@ibnets.com> on 20 Jan 1999 19:27:32 -0500,
Uri Guttman <u...@ibnets.com> says...

>
> i have been pondering perl's ancestry and for curiosity's sake i have
> been thinking about which languages (if any) influenced various perl
> feature. some are borrowed from one language which borrowed from an
> earlier one. some are pure perl from the head of larry and his cohorts.
>
> some are very obvious (or not). here is a starting list. feel free to
> add, comment or flame.
>
> math infix ops (+, *, /, etc) C

(from B, from BCPL, from Algol60, from Fortran, from time immemorial?)

> exponentiation (**) PL/I (others too)

(from Fortran)

> math comparison ops (==, >, ) C (others used = for ==)

(from B, at least)

> assignment ops (+=) C

(from B, at least)

> short circuit ops (||, &&) C (text versions are perl)

(from B, at least. C's ops yield Booleans, which is much less useful
than Perl's yielding the values of the expressions. But the syntax is
the same.)

> bit ops ( |, &, ^, <<, >> ) C

(from B, at least)

> auto-increment/decrement C (magic ++ is perl)

(from B, at least)

> dereference (->) C (from PL/I)
> scalar range (..) awk (list .. is perl)
> bind (=~) awk
> scalars as string or number sh
> arrays of scalars csh? (the $a[0] syntax is similar)
>
> tr/// tr, sed y (does anyone use y?)

I do -- it's one character fewer, and I learned awk first :-)

> s/// sed
> m// many unix programs (awk,sed,more,etc.)
>
> -p option sed
> -n option awk
>
> varying lenghth strings (no \0 needed) sh, PL/I
> substr PL/I
>
> grep unix
> map lisp
> lists lisp, apl
> slices apl
> hashes awk
>
> flow control (for, while, etc) C

(from B, at least)

> foreach perl
> statement modifiers perl?

I believe Snobol, but it's been SOOOO long!

> eval string sh
> eval block perl
>
> file test ops sh (perl added many)
> file functions C, unix
>
> system call functions C, unix
>
> networking functions C, unix
>
> get*by* functions (gethostbyname) C, unix
>
> glob (<*>) csh
>
>
> that's enough for me for now. all i can say is that larry is a high
> quality thief! :-)

statement terminator ; from C, from B, ...

compund statements {...} from C, from B, ...

unary ops + - ~ ! from C, from B...

ternary ?: from C, from B...

What happened to function definitions and invocations, and to classes
and various OOP stuff?

This should turn out to be an instructive thread!

--
(Just Another high-quality thief!) Larry Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
l...@hpl.hp.com

Cameron Kaiser

unread,
Jan 20, 1999, 3:00:00 AM1/20/99
to
mca...@waits.facilities.med.umich.edu (Sean McAfee) writes:

>More specifically, in at least one variety of BASIC, you could set up a
>hook to an assembly-language routine, and then call the routine from BASIC
>using a syntax like &FOO, &BAR, etc. The routine could determine the name
>that was used to call it, and process the rest of the tokens accordingly.
>Anyone else remember keying in long hexadecimal listings from Nibble
>Magazine into your Apple II, and then magically being able to do things
>like this in BASIC?

Oh yeah, the Applesoft ampersand vector. All kinds of programs wedged their
way into there. The Beagle Bros. products particularly abused it. :-)

--
Cameron Kaiser * cdkaiser.cris@com * powered by eight bits * operating on faith
-- supporting the Commodore 64/128: http://www.armory.com/~spectre/cwi/ --
head moderator comp.binaries.cbm * cbm special forces unit $ea31 (tincsf)
personal page http://calvin.ptloma.edu/~spectre/ * "when in doubt, take a pawn"

Sean McAfee

unread,
Jan 21, 1999, 3:00:00 AM1/21/99
to
In article <393e553...@ibnets.com>, Uri Guttman <u...@ibnets.com> wrote:
>i have been pondering perl's ancestry and for curiosity's sake i have
>been thinking about which languages (if any) influenced various perl
>feature. some are borrowed from one language which borrowed from an
>earlier one. some are pure perl from the head of larry and his cohorts.

>some are very obvious (or not). here is a starting list. feel free to
>add, comment or flame.

[snip]

ampersand function call syntax -- BASIC (specific variety unknown to me
personally, although the perl man page refers to a "BASIC-PLUS")

More specifically, in at least one variety of BASIC, you could set up a
hook to an assembly-language routine, and then call the routine from BASIC
using a syntax like &FOO, &BAR, etc. The routine could determine the name
that was used to call it, and process the rest of the tokens accordingly.
Anyone else remember keying in long hexadecimal listings from Nibble
Magazine into your Apple II, and then magically being able to do things
like this in BASIC?

10 PRINT "TESTING"
20 &HGR : REM TURN ON SUPER-HI-RES GRAPHICS MODE
30 &HCOLOR=7
40 &HPLOT 0,0 TO 100,100
50 END

--
Sean McAfee | GS d->-- s+++: a26 C++ US+++$ P+++ L++ E- W+ N++ |
| K w--- O? M V-- PS+ PE Y+ PGP?>++ t+() 5++ X+ R+ | mcafee@
| tv+ b++ DI++ D+ G e++>++++ h- r y+>++** | umich.edu

Roman Stawski

unread,
Jan 21, 1999, 3:00:00 AM1/21/99
to

Sean McAfee wrote:
>
> In article <393e553...@ibnets.com>, Uri Guttman <u...@ibnets.com> wrote:
>
> [snip]
>
> ampersand function call syntax -- BASIC (specific variety unknown to me
> personally, although the perl man page refers to a "BASIC-PLUS")
>
Try Digital's Basic+ and Basic+2 that used to run on PDP (RSTS and RSX)
and early VAXes.

I believe that this is where the statement qualifier
[expr] if|unless [condition]
syntax came from too

--
Roman....@Synersoft.fr

dr...@copyright.com

unread,
Jan 21, 1999, 3:00:00 AM1/21/99
to
In article <36A7223B...@synersoft.fr>,

Roman Stawski <roman....@synersoft.fr> wrote:
>
> Sean McAfee wrote:
> >
> > In article <393e553...@ibnets.com>, Uri Guttman <u...@ibnets.com> wrote:
> >
> > [snip]
> >
> > ampersand function call syntax -- BASIC (specific variety unknown to me
> > personally, although the perl man page refers to a "BASIC-PLUS")
> >
> Try Digital's Basic+ and Basic+2 that used to run on PDP (RSTS and RSX)
> and early VAXes.
>

RSTS/E was written in Basic+ ;-)

I think Basic+2 came out about the same time as Vax/VMS, and was
approximately a porting of Vax Basic to the PDP-11. They ported DCL to
RSTS/E at about the same time.

> I believe that this is where the statement qualifier
> [expr] if|unless [condition]
> syntax came from too
>

I'm not sure (it's been a long time...) but I think these were introduced in
Vax Basic and Basic+2. I'm pretty sure they weren't there in Basic+. I'm
not sure it even had while and until in their other usage.

Whether this was their first appearance may be another thing.


-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own

dr...@copyright.com

unread,
Jan 21, 1999, 3:00:00 AM1/21/99
to
In article <MPG.111027517...@nntp.hpl.hp.com>,

l...@hpl.hp.com (Larry Rosler) wrote:
> >
> > math infix ops (+, *, /, etc) C
>
> (from B, from BCPL, from Algol60, from Fortran, from time immemorial?)
>

Yes. Fortran is time immemorial. 1954 or so...

> >
> > flow control (for, while, etc) C
>
> (from B, at least)
>

It was around in Algol in pretty similar form. Some of the syntax changed of
course.

>
> compund statements {...} from C, from B, ...
>

The compound statement as a concept I think started with Algol. Of course,
they used BEGIN ... END instead of {...}. I don't know whether it was in
Algol-60 or arrived in 68.


> What happened to function definitions and invocations, and to classes
> and various OOP stuff?
>

Now you're getting into RECENT history ;-)

Pardon me, I just realized I'm older than Fortran.

Sob.

--
Don Roby

Uri Guttman

unread,
Jan 21, 1999, 3:00:00 AM1/21/99
to Larry Rosler
>>>>> "LR" == Larry Rosler <l...@hpl.hp.com> writes:

LR> In article <393e553...@ibnets.com> on 20 Jan 1999 19:27:32 -0500,
LR> Uri Guttman <u...@ibnets.com> says...


>>
>> tr/// tr, sed y (does anyone use y?)

LR> I do -- it's one character fewer, and I learned awk first :-)

you are one lazy bastard! :-)

i like tr because it maps to tr (the unix program) and to translate (the
pl/1 function). what does y map to? i used sed but not enough to think
of y as translate.

LR> statement terminator ; from C, from B, ...

pl/1, algol had it. b is from early 70's IIR and is later.

LR> What happened to function definitions and invocations, and to classes
LR> and various OOP stuff?

and i was thinking about those and i didn't come up with any direct
ancestors. i don't know enough OO languages to see where larry borrowed
from. the syntax and semantics of functions and OO in perl don't seem
similar to any others that i know about.

also i didn't have the time or energy to type in the camel. i used a
desktop reference and just entered as many as i felt like. i assumed you
and others would fill in the blanks.

LR> This should turn out to be an instructive thread!

that was my intent.

Daniel Grisinger

unread,
Jan 21, 1999, 3:00:00 AM1/21/99
to
dr...@copyright.com writes:

> Pardon me, I just realized I'm older than Fortran.

Wow! I'm younger than unix. :-)

dgris
- thinks age is mostly irrelevant
--
Daniel Grisinger dg...@moiraine.dimensional.com
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'

Tom Christiansen

unread,
Jan 22, 1999, 3:00:00 AM1/22/99
to

In comp.lang.perl.misc, Uri Guttman <u...@ibnets.com> writes:
:some are very obvious (or not). here is a starting list. feel free to
:add, comment or flame.
:
:math infix ops (+, *, /, etc) C
:exponentiation (**) PL/I (others too)

No, FORTRAN, and thence I believe to BASIC. All your PL/I notions are
false, because Larry wasn't a PL/I guy. He was a BASIC-PLUS guy.
Keep that in mind.

And most of the awk stuff (string hacking, hashes) actually
should be more properly traced to awk's ancestor, Snobol.

:scalar range (..) awk (list .. is perl)

Editors. Sed and Awk.

:bind (=~) awk

No, csh.

:scalars as string or number sh

And awk. And lisp. And many, many other things. I wouldn't blame this
on shells.

:arrays of scalars csh? (the $a[0] syntax is similar)

Not really. csh has a strange notion of this. But try anything else.

:varying lenghth strings (no \0 needed) sh, PL/I

Gosh, no. Think BASIC and awk.

:substr PL/I

Nope, awk.

:lists lisp, apl

and shell.

:slices apl

Um, doesn't Ada have this, and later versions of Fortran?
I'm trying to remember whether BASIC-PLUS did.

:statement modifiers perl?

No, BASIC-PLUS from RSTS/E.

:glob (<*>) csh

You mean /etc/glob. :-) Or shells in general.

But you're really forgetting a bunch.

blocks Algol
# comments shells
system functions Unix libc
$ for variables shells
' " ` shells
pick your own quotes m//, s/// sed; other editors
sort function libc's qsort()
// repeat last match sed; other editors
nesting brace quoting tcl
control flow:
do{}, if(), while(), for C
foreach shell (csh foreach, sh for i in)
labelled loops lots of languages, but not C
unless and until BASIC-PLUS
all functions variadic in their lisp, shell
calling and returning lists
OO set-up (hashes, classes) python
universal base class smalltalk(?)
require lisp
importing Ada, somewhat
open syntax gated to fopen/popen shell
[] and {} dyna structs python, somewhat
(actually, python fails a bit here compared to perl)
formats:
keywords Fortran
wysiwiggery COBOL pictures
syntax @<< etc BASIC's PRINT USING
$0 as program name shells
regex syntax Thompson's ed(1) etc
$0 mutable for ps sendmail
$. assemblers, editors
$?, $$ shells
$! C's errno
closures lisp
/i flag grep -i
grep and map lisp really (grep misnomer)
BEGIN and END awk
\u \U \l \L vi
\w \s emacs
\e $% troff
-e -f -d /bin/test
pack u format uuencode, of course
chr ord Pascal
interpreted systems programming BASIC-PLUS on RSTS/E
$pack'var syntax Ada
tied arrays BASIC-PLUS
next awk
"and" "or" "not" REXX conference Larry attentded
print default args awk
autoloading lisp

It's more interesting to figure out what *IS* original,
unique unto Perl. There are quite a few mysteries yet.
I'll let you start that list yourself. :-)

--tom
--
"If you think Emacs is such a great editor, just look what it did for
Richard Stallman's typing skills!"

Tony Curtis

unread,
Jan 22, 1999, 3:00:00 AM1/22/99
to
Re: ancestry of perl features, Tom
<tch...@mox.perl.com> said:

Tom> ...
Tom> args awk
Tom> autoloading lisp

And of course

recursion perl

:-)

tony
--
Tony Curtis, Systems Manager, VCPC, | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien. | <URI:http://www.vcpc.univie.ac.at/>
"You see? You see? Your stupid minds! | private email:
Stupid! Stupid!" ~ Eros, Plan9 fOS.| <URI:mailto:tony_c...@hotmail.com>

Uri Guttman

unread,
Jan 22, 1999, 3:00:00 AM1/22/99
to
>>>>> "TC" == Tom Christiansen <tch...@mox.perl.com> writes:
>>>>> "TC" == Tom Christiansen <tch...@mox.perl.com> writes:

TC> In comp.lang.perl.misc, Uri Guttman <u...@ibnets.com> writes:

TC> No, FORTRAN, and thence I believe to BASIC. All your PL/I notions are
TC> false, because Larry wasn't a PL/I guy. He was a BASIC-PLUS guy.
TC> Keep that in mind.

but i believe pl/i precedes basic for many of the string ideas. pl/i had
a substr function by the same name. early basics i used (pdp-8) had only
single letter and 1 digit names and not much else! also see MJD's take
on perl and PL/I at http://www.plover.com/~mjd/perl/#perl67

TC> :scalar range (..) awk (list .. is perl)

TC> Editors. Sed and Awk.

i said (sed?) awk. is the list .. from perl only?

TC> :bind (=~) awk

TC> :substr PL/I

TC> Nope, awk.

PL/I had is first. it precede awk by several years.

TC> :lists lisp, apl

TC> and shell.

TC> :slices apl

TC> Um, doesn't Ada have this, and later versions of Fortran?
TC> I'm trying to remember whether BASIC-PLUS did.

and perl probably precedes (or around the same time) as ada. i seem tot
gather that larry knew about apl when he did perl. which version of perl
first supported slices? was it as early as the first version with arrays?

TC> But you're really forgetting a bunch.

i said add stuff. i wasn't trying to be complete but to start a thread
on this topic.

TC> blocks Algol
TC> # comments shells

TC> system functions Unix libc
i had this one.

TC> control flow:
TC> do{}, if(), while(), for C
and this.

TC> It's more interesting to figure out what *IS* original,
TC> unique unto Perl. There are quite a few mysteries yet.
TC> I'll let you start that list yourself. :-)

well i started the inverse list.

TC> "If you think Emacs is such a great editor, just look what it did for
TC> Richard Stallman's typing skills!"

he just had bad body mechanics and had a keyboard chained to his
wrists. if he had taken better care of himself (wristpads, ergonomic
furniture, proper and early treatment, etc.) he would have to have a
typist. i don't think associating emacs and carpal tunnel syndrome is
going to win you any converts to vi.

uri

--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire ---------------------- Perl, Internet, UNIX Consulting
u...@sysarch.com ------------------------------------ http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com

David Formosa (aka ? the Platypus)

unread,
Jan 22, 1999, 3:00:00 AM1/22/99
to
In article <36a8b024@csnews>, Tom Christiansen wrote:
>

[...]

>:varying lenghth strings (no \0 needed) sh, PL/I
>
>Gosh, no. Think BASIC and awk.

Are this type of strings called "pascal style"?

[...]

> OO set-up (hashes, classes) python

I thourt that perl predates python.

[...tom's list cut...]

Addtions

eval lisp
dynamic scope (via local) lisp

>It's more interesting to figure out what *IS* original,

>unique unto Perl. There are quite a few mysteries yet.

>I'll let you start that list yourself. :-)

die eval used for excptions
tied objects
glob verrables.

--
Please excuse my spelling as I suffer from agraphia. See
http://www.zeta.org.au/~dformosa/Spelling.html to find out more.
How to win arguments on usenet http://www.zeta.org.au/~dformosa/usenet.html


Abigail

unread,
Jan 23, 1999, 3:00:00 AM1/23/99
to
David Formosa (aka ? the Platypus) (dfor...@zeta.org.au) wrote on MCMLXX
September MCMXCIII in <URL:news:slrn7ahuah....@godzilla.zeta.org.au>:
__ In article <36a8b024@csnews>, Tom Christiansen wrote:
__
__ > OO set-up (hashes, classes) python
__
__ I thourt that perl predates python.

Perl did, but perl5 didn't.

Abigail
--
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'

Andrew M. Langmead

unread,
Jan 25, 1999, 3:00:00 AM1/25/99
to
dfor...@zeta.org.au (David Formosa (aka ? the Platypus)) writes:

>tied objects

These were in TCL long before the got added to Perl 5, but I'm really
unusre of the path they took (if any) before that.
--
Andrew Langmead

Joel Finkle

unread,
Feb 1, 1999, 3:00:00 AM2/1/99
to

Larry Rosler <l...@hpl.hp.com> wrote in article
<MPG.111027517...@nntp.hpl.hp.com>...


> In article <393e553...@ibnets.com> on 20 Jan 1999 19:27:32 -0500,

> Uri Guttman <u...@ibnets.com> says...


> >
> > i have been pondering perl's ancestry and for curiosity's sake i have
> > been thinking about which languages (if any) influenced various perl
> > feature.

...


> > statement modifiers perl?
>
> I believe Snobol, but it's been SOOOO long!

Various flavors of BASIC have used statement modifiers for many years,
especially those created by Digital (DEC).

dr...@copyright.com

unread,
Feb 2, 1999, 3:00:00 AM2/2/99
to
In article <01be4dfd$29034f60$1232...@Joel.monsanto.com>,

I think Snobol's probably older than Basic. It might be older than Digital.

However, I don't think it had anything resembling Perl's statement modifiers.
In fact, it didn't have IF/THEN, WHILE, FOR, .... Lots of GOTOs.

It did however have a builtin EVAL().

Larry Rosler

unread,
Feb 2, 1999, 3:00:00 AM2/2/99
to
In article <797j8e$kdu$1...@nnrp1.dejanews.com> on Tue, 02 Feb 1999
19:22:02 GMT, dr...@copyright.com <dr...@copyright.com> says...

> > Larry Rosler <l...@hpl.hp.com> wrote in article
> > <MPG.111027517...@nntp.hpl.hp.com>...
> > > In article <393e553...@ibnets.com> on 20 Jan 1999 19:27:32 -0500,
> > > Uri Guttman <u...@ibnets.com> says...
> > > > i have been pondering perl's ancestry and for curiosity's sake i have
> > > > been thinking about which languages (if any) influenced various perl
> > > > feature.
> > ...
> > > > statement modifiers perl?
> > >
> > LR> I believe Snobol, but it's been SOOOO long!

I've looked back at a bit of Snobol. What I remembered as postfixed
statement modifiers (do something if condition) are actually post-
statement transfer decisions (do something, and on success/failure, go
somewhere else).

So I still don't know where the postfixed statement modifiers come from.

--
(Just Another Larry) Rosler

0 new messages