Quote:
|
Originally Posted by coldhead
|
Ruby is beautiful! Thank you for pointing me to it. I look forward to getting to know it better in the coming weeks.
In an attempt to reciprocate, let me present my personal favorite “joy and less code” language,
M (AKA
MUMPS, ANSI X-11.1-1995, Cache). Although there’re
several open source implementations of M available, I recommend
this free, unlimited-use single-user version of a commercial implementation. This one will run quietly on your desktop or a server on your network, and can be accessed by any telnet terminal emulator (a simple one slightly nicer than the one that come with Windows comes bundled with the download).
- Ruby is public domain via Yukihiro Matsumoto’s GPL, ca. 1995. M is public domain because it was developed by Octo Barnett and friends under a US federal grant in the ca. 1970.
- Ruby is interpreted and terminal-based, commonly in an interactive, “direct” mode. So is M.
- Ruby is intrinsically weakly (no true multiple inheritance) object-oriented. M is not even weakly OO, despite some implementer’s tacked-on extensions.
- Ruby’s arithmetic is arbitrary-precision. M’s is limited (typically 16-18 decimal digits). If you like to use M to mess with big numbers, you’ll need to write or acquire and use better math functions.
- Ruby’s pretty terse. M, which supports and encourages abbreviation of its keywords, is more terse. It’s arguably nearly as terse as a procedural language can be. Example:
Code:
# recursive factoral function in Ruby
def fact(n)
if n == 0
1
else
n * fact(n-1)
end
end
; recursive factoral function in M
fact(n) q:n=0 1 q $$fact(n-1)
- Named functions/subroutines in Ruby must be defined. M programs can modify themselves dynamically (though one is to be cautioned that this can lead pretty far down the rabbit hole!)