Subject: "Rindolf" (fka P5TNG) random ideas and news

From: Shlomi Fish <[email-masked]>
Date: Tue, 12 Feb 2002 20:58:23 +0200 (IST)

First for the news:

1. I sent an E-mail message to Larry Wall and Damian Conway explaining the
situation. I received a reply from both of them. The end result is that I
am free to design my own language, and that I should present it to the
Perl 5 (and the Parrotized Perl 5) people who may incorporate my
suggestions there.

2. I came to a realization, and Damian confirmed it independently, that I
should use another name than Perl 5 TNG, assuming it ends up as a
separate language. I chose the name "Rindolf". So Rindolf is the
temporary name for the new Perl dialect, whose future is yet to be
told.[1]

And now for the ideas. In no particular order - comments and flames are
welcome:

* A command-line switch for proper tail recursion.

* Unlimited Post-line constructs:

@primes=(2);
push @primes, $a
    if (grep { $a % $_ == 0 } @primes)
        foreach $a (3..10000);

* Distiniction between for($a=0;$a<10;$a++) and foreach $a (@myarray). - ?

* map, sort etc. as class members of a tied array.

* Expressions that perform nothing to generate warnings or even errors:

I.e:
sub myfunc
{
    my $a = shift;
    my $b = shift;
    if ($a*2 < $b)
    {
        $a == $a*2; # Error - he meant $a = $a*2;
    }

    return 0;
}

Note: seems like the -w flag already does such checks.

* Factories: setting the default done using functions. A factory is an
object that preserves the scoping for a given scope. E.g:

<<<
my $f = Clover::Factory->new();
$f->set_line_delimiter("\n\n");

sub myfunc
{
    my $local_f = Clover::Factory->new();
    $local_f->set_line_delimiter("\n");

    my $fh = $local_fh->open("<myfile.txt");
    #
    # $fh will be read one line at a time.
    #

    # .
    # .
    # .

    # $local_f is destroyed. Has no effect on the system
}

&myfunc();

my $fh = $f->open("<myfile.txt");

# Now $fh reads an entire paragraph.
my $paragraph = $fh->readline();

* Multi-processing is at the moment a bit kludgy: There's open2, open3(),
` ` which makes writing commands harder. Re-design.

* Hashes will be able to have references as keys. - ?

* Locking hashes and making sure no new keys can be added.

* A default preprocessor -
    - Declaring new operators.
        Just saying #<< declare_operator expr '@+' expr >>
        or #<< declare_regex_operator expr '\@*\+' expr >>

        This may mean an on-the-fly Lexer and Yacc.
    - Etc.

* Unambigious "x" operator:
    "hello" x 5 ==> ("hello","hello","hello","hello","hello");
    (Like ("hello") x 5).

    To concatenate a string 5 times use:
        1. join("", "hello" x 5) # The horror...
        2. repeat_string("hello", 5)
        3. Maybe I'll assign an operator to it: "hello" r 5.

* General depreciation of list vs. scalar contexts.
    reverse() reverses a list. Always.
    To reverse a string use revstr().
    scalar(@a) will be replaced with count(@a). (I may keep scalar
        as a list counter  for backward compatibility)

[1] - I thought of calling the language "Picard" to commemorate for its
"TNG"ing. ;-) But it may have had the same side-effects as Guido von
Rossum calling Python after Monty Python (or renamed it to "Homer" as the
Segfault editorial goes.)

"Rindolf" is the name of an AD&D character I used to play, which was my
favourite character of all time. I also now use it as an IRC nickname.

----------------------------------------------------------------------
Shlomi Fish        [email-masked]
Home Page:         http://t2.technion.ac.il/~shlomif/
Home E-mail:       [email-masked]

"Let's suppose you have a table with 2^n cups..."
"Wait a second - is n a natural number?"

---

From: Shlomi Fish <[email-masked]>
Date: Wed, 13 Feb 2002 06:08:46 +0200 (IST)

Hi!

I set up a separate mailing list for discussing Rindolf on Yahoo Groups:

http://groups.yahoo.com/group/rindolf-discuss/

I'll move the rest of the discussions there, so this list won't be
bothered too much with it. Unless of course, someone wishes it to be so.

Regards,

	Shlomi Fish

---

From: "Nadav Har'El" <[email-masked]>
Date: Wed, 13 Feb 2002 12:00:03 +0200

> bothered too much with it. Unless of course, someone wishes it to be so.

I hope you'll get a lot of discussions there, but Shlomi, why don't you
just take the Perl 5 source code and start adding features yourself, one
small feature at a time (adding the first feature will probably be the
hardest); When you announce this "Rindolf" with an amazing new $%^@ operator,
people might be more interested in getting your Rindolf and joining these
discussions.

Let me tell you a small personal story about why you shouldn't care if other
people will use (or even care about) your Rindolf.

About 15 years ago I was reading the end of Kernighan and Pike's "The UNIX
Programming Environment". This book tries to teach almost everything about
UNIX (of 1984, when the book was published) and the second part of the
book teaches C programming on UNIX, and finally even Yacc. As an example
use of Yacc, Kernighan designed a small and simple interpreter, called "Hoc"
(High Order Calculator), which is an interpreted language looking a lot like
C and meant for casual calculations (but featuring variables, if, loops,
functions, and so on). I was a dedicated learner and typed in the entire
source code to try it out (took me several days of typing, if I remember
correctly ;) Nowadays you can just take the source from BWK's homepage).
I learned a lot from trying to understand how Yacc worked and Hoc in
particular (not many people get a chance to dabble in compiler theory
at the age of 12). But moreover, Hoc itself was exactly the "right language
at the right time" for me; Around that time I began being interested in
simple mathematics (e.g., how does one solve a quadratic equation?),
electronics, and later also physics, and Hoc was a very convenient platform
for experimenting with (very) simple numeric algorithms of that sort.
But soon Hoc began showing its limits as a simple tutorial language. So
over a period of about 6 years I continously added features to Hoc. First
simple stuff like a "++" increment operator and for(;;) loops, and later
more complicated stuff like short-circuited boolean operators, a ?: operator,
local variables, constants, functions with a variable number of arguments,
namespaces, and a lot of other stuff. I learned a lot from this "adventure":
on compiler theory, numerics (e.g., how does one implement a "log-gamma"
function?), debugging, portable programming (over they years, my Hoc ran
on Vax, Sun, AIX, System Vr[34] on PC, SystemVr3 on Motoralla CPU, MS-DOS,
Linux, Alpha, and more - later I even added autoconf to it), and so on.
But I never looked for anyone else to use (or discuss on a mailing list) Hoc.
It was very useful for me and about 2 other people I gave it to, and I
learned a lot from doing it. These two things were enough motivation for me
to work on it. Of course, the fact that in Israel school ends around
12:00-13:00 which leaves kids *tons* of free time, didn't hurt :)

So hack away at Perl :)

-- 
Nadav Har'El                        |      Wednesday, Feb 13 2002, 1 Adar 5762
[email-masked]             |-----------------------------------------
Phone: +972-53-245868, ICQ 13349191 |I want to be a human being, not a human
http://nadav.harel.org.il           |doing -- Scatman John

---

From: Shlomi Fish <[email-masked]>
Date: Wed, 13 Feb 2002 12:34:57 +0200 (IST)

Nadav Har'El wrote:
> [ Hoc and Yacc stuff snipped ]

I'd like to have a working and consistent specification of how Rindolf
behaves, before I start hacking on the Perl 5 source code. I'm not ruling
the possibility that I would, but I'd like to have an idea how Rindolf
will behave and operate.

At the moment the mailing list is dedicated to discussing how Rindolf
should differ from Perl 5 (and where it should be the same). When we have
a working specification I will present it to the world as Rindolf 1.0 and
announce that the hacking will begin.

Notice that nobody is still working on the Perl 6 interpreter, since every
one of Larry Wall's Apocalypses bring new things that have yet to be
realized. While I have a general idea what is going to be in Rindolf, I'd
like the following to happen:

1. That I write everything down.
2. That I get opinions on it from other people.
3. That the specification was "proven correct". (I.e: does not contain
ambigious elements, etc).
4. That some people (albeit not all) like it.

While too much planning is not a Good Thing<tm>, hacking without a general
idea what is going to be hacked is a dangerous practice. "Sof Ma'aseh
Bemah'shava T'hila". ;-)

If you'd like to join rindolf-discuss I'll be more than happy to have you
there. You seem to have unorthodox and innovative opinions on almost
everything (which many times contradict my own), and I can always use
people like you.

Naturally, everybody else on this list: Oleg, Chen, OmerM, OmerZ, AlexSh
(I don't hear much from him lately here), Gil'ad, Mulix, Adi, Arik,
Tzafrir, Gaal and everybody else I can't recall now, are welcome to join
too. I just think that:

1. Rindolf's scope is large enough to be a strain on this list.

2. Some of the discussions and flamewars will not interest hackers-il too
much.

3. It won't be practical to appoint hackers-il as the official Rindolf
mailing-list (assuming the project takes off).

Regards,

	Shlomi Fish

There is no IGLU Cabal! Their gradually converted the perl 5 source code
to run Python source, (just for the fun and challenge), and found out the
resultant code was identical with the original python code. It is unknown
what happened in the corresponding python->perl project.