Some more Ruby observations (Re: Comparison between Python and "Ruby")

Greg Ewing greg.ewing at compaq.com
Thu Nov 4 10:38:08 EST 1999


Here are some random observations from studying the Ruby
source code:

* It seems to have a notion of "tainted" strings, and can
  be run in various security modes where certain operations
  using tainted strings are disallowed.

* It doesn't use bytecode. The evaluator seems to operate
  directly on a parse tree. I don't know what implications
  this has for execution speed.

* Here is an interesting little diagram I came across. Note
  that Ruby appears to have metaclasses of some flavour or
  other.

    /*
     * Ruby's Class Hierarchy Chart
     *
     *                           +------------------+
     *                           |                  |
     *             Object---->(Object)              |
     *              ^  ^        ^  ^                |
     *              |  |        |  |                |
     *              |  |  +-----+  +---------+      |
     *              |  |  |                  |      |
     *              |  +-----------+         |      |
     *              |     |        |         |      |
     *       +------+     |     Module--->(Module)  |
     *       |            |        ^         ^      |
     *  OtherClass-->(OtherClass)  |         |      |
     *                             |         |      |
     *                           Class---->(Class)  |
     *                             ^                |
     *                             |                |
     *                             +----------------+
     *
     *   + All metaclasses are instances of the class `Class'.
     */

Greg




More information about the Python-list mailing list