Has the Joy homepage moved, also BNF for Joy?
Shae Matijs Erisson — 2003-03-07 01:15:44
Hello, the subject says most of it.
I can't reach the Joy homepage, have the latrobe servers been rearranged?
Also, is there a BNF grammar for Joy available?
Thanks,
--
Shae Matijs Erisson - 2 days older than RFC0226
#haskell on irc.freenode.net - We Put the Funk in Funktion
10 PRINT "HELLO" 20 GOTO 10 ; mapM_ putStrLn $ fix ("hello":)
phimvt@lurac.latrobe.edu.au — 2003-03-07 01:23:57
On Fri, 7 Mar 2003, Shae Matijs Erisson wrote:
> Hello, the subject says most of it.
>
> I can't reach the Joy homepage, have the latrobe servers been rearranged?
Nothing has moved. But our system administrators are doing something
big and weird which I don't understand. I'm told "it won't take long".
> Also, is there a BNF grammar for Joy available?
Yes. It is in the "Implementation" paper (which should really be
called the manual). Unfortunately that paper is very much out
of date - revising it is my next job. The grammar for Joy is of
course quite trivial.
- Manfred
John Carter — 2003-03-14 06:41:21
On Fri, 7 Mar 2003
phimvt@... wrote:
> Yes. It is in the "Implementation" paper (which should really be
> called the manual). Unfortunately that paper is very much out
> of date - revising it is my next job. The grammar for Joy is of
> course quite trivial.
It's always been a source of irritation to me that the grammar is (mostly)
trivial but the lexer isn't. That is partly due to the strange nature of
the arabic numerals. 42 is actually 4 10 * 2 +. Whoops, but what is this
10 thing I write... And then if we get into 42.2 we have a infix '.'
operator 4 10 * 2 + 2 10 / +
Not to mention exponents 42.3e4
4 10 * 2 3 10 / + + 10 4 pow *
And then there are these [] list things. Very convenient, but breaks the
paradigm somewhat.
Sigh.
I would do something about it, but I have a mountain or twenty to climb...
John Carter Phone : (64)(3) 358 6639
Tait Electronics Fax : (64)(3) 359 4632
PO Box 1645 Christchurch Email :
john.carter@...
New Zealand
John's law :-
All advances in computing have arisen through the creation of an
additional level of indirection, the trick is to work out which
indirection is actually useful.
phimvt@lurac.latrobe.edu.au — 2003-04-01 03:11:17
On Fri, 14 Mar 2003, John Carter wrote:
[..a propos Joy syntax..]
> It's always been a source of irritation to me that the grammar is (mostly)
> trivial but the lexer isn't. That is partly due to the strange nature of
> the arabic numerals. 42 is actually 4 10 * 2 +. Whoops, but what is this
> 10 thing I write...
Joy is in fact the first language which extends the concatenative
notation for positional numerals to the rest of the language. For
example, the numeral "1234" is of course a concatenation of four
single digit numerals. Each of these single digit numerals denotes
a unary function from a stack of size one to a stack of the same size.
Initially the single element at the top of the stack is the number
zero. Each of the functions (four in this case) inspects the top
element of the stack and replaces it with something else. In particular,
the four single digit numerals denote the following four unary
functions from stacks (of size one) to stacks (of size one):
digit function denoted by he numeral
"1" "multiply top element of stack by ten and then add one"
"2" "multiply top element of stack by ten and then add two"
"3" "multiply top element of stack by ten and then add three"
"4" "multiply top element of stack by ten and then add four"
Since the stack starts with just one element, the number zero,
after the concatenation "1234" has been executed (by the composition
of the four component functions) the element on the element on top of
the stack will be the number one-thousand-two-hundred-thirty-four
(or in Roman notation: MCCXXXIV - I have to avoid positional notation).
The proof that indeed the composition of those four functions produce
that result is left an exercise for the mathematically gifted.
> Not to mention exponents 42.3e4
> 4 10 * 2 3 10 / + + 10 4 pow *
This is incorrect. The leading single digit "4" does not denote
the composition of the four functions denoted by "4" "10" "*"
(otherwise there would be a regress: "4" "10" "*" "10" "*" ...).
Instead the single digit "4" denotes the function defined sixteen
lines up.
- Manfred
Please note the date of this mail. (I could not resists it.)