Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
The Rubylution - tag language
[go: Go Back, main page]

Rail On Rails

Posted by flori Wed, 06 Jun 2007 23:47:00 GMT

I just found this link to the rail programming language in matz' blog. It has a rather beautiful layout as you can see in the following implementation of the Ackermann function:

$ 'main' (--)
 \  Read m and n as input. Just one number each for now
  \  Input is in the form "m\rn" where \r is a return character
   \-[Enter m: ]oi(!m!)[\n\]o-[Enter n: ]oii(!n!)[\n\]o-----(n)-(m)-{ackermann}-[): ](n)[,](m)[A(]oooooo--#


$ 'ackermann' (n m -- A(m,n))  A(m,n) = n+1             if m=0
 \                                    = A(m-1,1)        if m>0 and n=0
  \                                   = A(m-1,A(m,n-1)) if m>0 and n>0
   \-(!m!)-(!n!)-\
                 | 
                 /
      /---q(m)0--     
      |
     t^f        f/-(n)1s-(m)-{ackermann}-(m)1s-{ackermann}-#  
     / \-(n)0q--<
     |          t\-1-(m)1s-{ackermann}-#
     \-(n)1a-#

Yeah, it's an esoteric language. Matz sure doesn't joke when he says, that he's a programming language geek. I wonder when the rail hackers will start to code a web framework and call it Rail On Rails?

Tags , , ,  | no comments