We are auditing other languages against Ruby to port the best of the best and attract more people to ruby. This is a quick first draft. Polish and results to follow.
Python
Syntax/Semantics
The following would require changes to the language/interpreter:
- Real traceback objects.
- Much better object and runtime reflection:
- Code Objects (name, argcount, nlocals, varnames, code, consts, names, filename, firstlineno, stacksize, flags
- Frame Objects (back, code, locals, globals, builtins, restricted, lineno, lasti, trace, exc_type, exc_value, exc_traceback)
- Traceback Objects (next, frame, line, listi)
- Doc strings available at runtime
- keyword arguments (**keys)
- selective import (include in ruby)
The following can be implemented entirely in ruby:
- Complex Numbers
- tuples - immutable arrays - good for hash keys
- Slices ([i:j:n], [i:j,m:n], […, i:j])
- Unicode
- xrange (effecient ranges)
- zip (a, b) => ((a[0], b[0]), (a[1], b[1]), …)
- assert is built in!
- apply(func, *args, **kwargs)
- reduce
Core Libraries
- array w/ a single type
- struct class w/ pack, unpack and calcsize.
- getpass - gets a password from the user.
- GzipFile (IO::GzipFile)
- os - name, path, linesep, getegid, geteuid, getgid, getpgrp, getpid, getppid, getuid, setgid, setpgrp, setpgid, setsid, setuid, strerror(errno), umask, uname, , dup, dup2, fdopen, fstatvfs, ftruncate, lseek, pipe, popen, tcgetpgrp, ttyname, mkfifo, sync, times(user, system, cuser, csystem, clock)
- os.path - abspath, basename, commonprefix, dirname, exists, expanduser (~ryand), expandvars, getatime, getmtime, getsize, isabs, asfile, isdir, islink, ismount, join, normcase, samefile, sameopenfile, samestat, split, splitdrive, splitext, walk
- resource (rlimit, ulimit, etc)
- shutil
- sending signals
- termios
-
tty
- networking
- asyncore - abstraction of a async network protocol
- http file server
- http cgi server
- nntp client
- uriopen
Popular Third Party
Misc
Annoyances
WHY IN THE HELL does ParseDate.parsedate not output it’s result in the same order as needed by Time.new??? EG:
myTime = Time.new(* ParseDate.parsedate(theTime))
Should work as-is!