Ruby 0.49

Details

Version
0.49
Released
Command
ruby-0.49
Try
ruby-0.49 -e 'print("Hello from Ruby ", $VERSION, "\n")'
Samples
~/samples/0.49/
Source
ruby-0.49.tar.gz
SHA-256
4ad1b6c76b19a04231598ecdf6a1ecf4ff1a32da48f6889a77d7b62c0b7ebde2

Notes

The oldest Ruby in all-ruby, from 18 July 1994, 17 months before the first public release. It’s Ruby before most of what makes it look like Ruby: constants are spelt %name and true is %TRUE, the arguments are $ARGV, the version is $VERSION, exceptions are caught with protect ... resque ... end. There is no ext/ or lib/: sockets are built into the interpreter (as dbm would be, given <ndbm.h>), so the install is just bin/ruby.

Unlike the bugs left alone in 0.95 and 1.0, 0009 is patched because it takes down the interpreter on the most common mistake there is, a misspelt method name, including any method 0.49 doesn’t have yet (File.open, Integer()).

sample/test.rb only prints its arguments, so testSuite is false, and the samples are the only checks of the interpreter beyond -e. One bug matters for checks.http: TCPsocket.open stores a numeric port without htons(), so TCPsocket.open(host, 80) connects to port 20480 and hangs. A service name goes through getservbyname(), which returns it in network order, so the check opens "http" (which needs /etc/services, from the guest’s netbase). Ctrl-C kills it with SIGINT, as for 0.95.

Patches

0003-error-declare-error.patch

yyerror() calls Error() before its definition, which the conversion made variadic, so the implicit declaration no longer matches. It’s now declared first, as int.

In all-ruby: error-error2.

It declares Error() void, which still conflicts.

0006-io-glibc-read-pending.patch

io.c reads Linux libc 5’s _gptr and _egptr, which glibc calls _IO_read_ptr and _IO_read_end.

all-ruby renames them in its Rakefile.

0009-eval-undefined-method-id.patch

rb_undefined() converts the method’s ID with NUM2INT() as if it were a Fixnum, which dereferences most IDs as object pointers, so every call to an undefined method crashed with a segfault instead of raising an error. It now uses the ID as it is.