Re: Languages From Hell -- your favorite one could walk again!

peter@Starbase.NeoSoft.COM (Peter da Silva)
Mon, 19 Sep 1994 13:44:49 GMT

          From comp.compilers

Related articles
Languages From Hell -- your favorite one could walk again! esr@Netaxs.com (1994-09-18)
Re: Languages From Hell -- your favorite one could walk again! korpela@albert.ssl.berkeley.edu (1994-09-18)
Re: Languages From Hell -- your favorite one could walk again! peter@Starbase.NeoSoft.COM (1994-09-19)
Re: Languages From Hell -- your favorite one could walk again! peter@Starbase.NeoSoft.COM (Peter da Silva) (1994-09-20)
Re: Languages From Hell -- your favorite one could walk again! ok@cs.rmit.oz.au (1994-09-21)
Re: Languages From Hell -- your favorite one could walk again! esr@netaxs.com (1994-09-21)
Re: Languages From Hell -- your favorite one could walk again! sasghm@unx.sas.com (1994-09-22)
Re: Languages From Hell -- your favorite one could walk again! adam@tucson.princeton.edu (1994-09-26)
Re: Languages From Hell -- your favorite one could walk again! adrian@platon.cs.rhbnc.ac.uk (1994-09-23)
[6 later articles]
| List of all articles for this month |
Newsgroups: comp.compilers,alt.folklore.computers,comp.lang.forth
From: peter@Starbase.NeoSoft.COM (Peter da Silva)
Keywords: history, comment
Organization: NeoSoft Internet Services +1 713 684 5969
References: 94-09-076 94-09-097
X-Provider: NeoSoft, Inc.: Internet Service Provider (713) 684-5969
Date: Mon, 19 Sep 1994 13:44:49 GMT

Ratforth: a rational infix forth compiler, with an escape to postfix:


define fib {
arg n;
if(n<=1) 1;
else fib(n-1)+fib(n-2);
}


Straightforward enough, right? But it was strict forth underneath and you
had to excersize stack discipline. It generated forth and fed THAT to the
forth compiler:


: fib 1 vars
    0 var @ n > not if
        1
    else
        0 var @ 1 - fib 0 var @ 2 - fib +
    then
    1 endvars ;


With "vars...var...endvars" managing its own stack.


And you could treat a chunk of Forth as a variable/constant/subroutine:


define nonsense {
    [count type]("The answer is ");
    [.](42);
    cr;
}


Becomes:


: nonsense " The answer is " count type 42 . cr ;


Finally, multi-return stuff was amusing because the compiler didn't track the
stack managment of functions:


define lesssense {
    type(count("The answer is "))
    [42 . cr];
}


produces the same code...


I perpetrated this language in the early '80s in response to a challenge, and
actually used it on occasion. I think I have code somewhere...


It's in Forth, if course.
--
Har du kramat din varg idag?
[Gee, sounds not altogether like bc, the C-ish front end to the RPN dc. -John]
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.