[OT] Ruby vs REBOL

Hello!

I apologize if this is a little bit off topic.

As part of my master thesis I am about to develop some
scripts using Ruby. As I have never used it before and
using REBOL for six years I would like to ask if anyone
could give a brief summary of what's the difference
between Ruby and REBOL.

I have found plenty of information on the internet that
compares Ruby with other languages, but not with Rebol.

I realise that I'm on a list for Ruby, and the answers
might be a little biased, but what are the pros and cons
for these languages?

Best regards,
Peter Carlsson

Peter Carlsson a écrit :

Hello!

I apologize if this is a little bit off topic.

As part of my master thesis I am about to develop some
scripts using Ruby. As I have never used it before and
using REBOL for six years I would like to ask if anyone
could give a brief summary of what's the difference
between Ruby and REBOL.

I have found plenty of information on the internet that
compares Ruby with other languages, but not with Rebol.

I realise that I'm on a list for Ruby, and the answers
might be a little biased, but what are the pros and cons
for these languages?

Best regards,
Peter Carlsson

Ruby is fondamentally OO. For exemple, you never truly call any
function, you just send messages to objects. While Rebol is
fondamentally procedural with prototyped OO.

Rebol is a lot DSL based. Ruby may have DSLs but is not that much based
on them. (DSL == Domain Specific Language)

Block in Rebol is a fit-for-all construct which, among other things,
allow to manage non evaluated piece of code (in other words: quotation).
Block in ruby isn't a quotation, but it is still a piece of code which
works as a closure i.e. it binds local variables of its enclosing scope.
Ruby has a lot of facilities to manage blocks and use it almost everywhere.

Rebol is dynamically typed while Ruby has in fact only one type: the
object. It means ruby never checks types (but you still may explicitely
check an object's class), it relies on its method dispatching system,
alias the lookup, to tell you if a method call is valid or not.

I don't remember if rebol had an exception framework, but I'm sure ruby
has one. An invalid method call, for example, raises an exception.

···

--
Lionel Thiry

Personal web site: http://users.skynet.be/lthiry/

"Peter Carlsson" wrote

I apologize if this is a little bit off topic.

As part of my master thesis I am about to develop some
scripts using Ruby. As I have never used it before and
using REBOL for six years I would like to ask if anyone
could give a brief summary of what's the difference
between Ruby and REBOL.

The main diff is Ruby is open source which implies a whole
lot more than the mere fact that anyone can browse the source.

Not exactly what you're looking for but is sort of cute, it's
excerpt from a posting to comp.lang.python, October, 1998 when
the "amazing new language" was just released:
---- <begin excerpt> ----------------------------
Here's a REBOL session:

>> print 1+2

     ERROR discovered in function port_read:
     Invalid INTEGER on line 1: 1+2 (malformed or too long)
     Returning to top level.

(Note REBOL's human-friendliness compared to Python: Python burdens users
with 50% more ">" characters at the start of a prompt, and confusingly
treats "1+2" as three distinct tokens despite that there's nothing to
separate them save computer-centric convention.
Proper REBOL is apparently the human-centric):

>> print 1 + 2

     3

(So there! It's simple. Or at least simpler than the alternative)

>> print do [1 + 2]

    (which also works. OTOH):

>> print 1 + 2 * 3

     9

(The manual claims that this left-to-right evaluation is "for the
convenience
of users". It starts by saying "REBOL operators and functions have no
preferred ordering or precedence", later qualified by the warning "Ignoring
REBOL's preferred ordering can be a source of errors in your scripts.")

>> print 1/2

    (yields an "invalid DATE" error, while):

>> print 1 /2

    (yields "unimplemented functionality", while):

>> print 1 / 2

    (yields 0.5)

At higher levels, REBOL's semantics appear to be derived from Scheme's, with
first-class lexically scoped functions, closures, and even first-class
continuations. The syntax is friendlier ("more infix") but also quirkier.

REBOL has acollection of built-in datatypes with native syntax: dates,
URLs,
email addresses, currency, and even IP addresses are primitive notions.
This
could be very attractive for some users. E.g., at the REBOL prompt I typed:

send t...@email.msn.com "Did this work?"

and in response it dialed my modem, connected to my ISP, and then REBOL
crashed after provoking an invalid page fault in kernel32.dll. Then my
connection broke, and the modem dialed and connected again. Then it just
sat there until it timed out.

i think rebol has quirky syntax. you can't pick it up as quickly as
you can ruby. anybody who's been exposed to perl or python (or maybe
even java) will find ruby 'similar' eg:

either none? system/script/args [
       print ""
       print "usage: <path/to/binkd.log> <days>"
       print ""
       ask "hit enter:"
       quit
][

the brackets are not generally used for blocks. the refinements
designated by '/' are interesting, but i don't know what the
ubiquitous '.' couldn't be used.

any quirky syntax can endear you to the language.... :slight_smile:

i think the main difference you're going to find is the abundance of
documentation for ruby.

the docs for rebol are few and horrendous. the above example i wrote
when i first got into rebol but "system/script/args" took me four
hours to find. i had to comb through the rebol script library. before
i found the example. i've owned the official rebol guide for a few
years, but other than simple documentation lookups, the guide is
pretty much useless. 'ruby in a nutshell' holds more ruby information
in a 200 pages than the rebol guide does for rebol in 700+ pages.

if it weren't for the rebol mailing list and script library i would
have probably given up on rebol a long time ago...

i actually came to rebol via beos. i needed a biff program for beos,
and sockets were broken for both the perl and tcl beos versions (at
the time). rebol filled the gap, and when view came out it trumped
both tk which as far as i know is STILL not available for beos.

···

Peter Carlsson wrote on 11/2/2005 2:00 AM:

using REBOL for six years I would like to ask if anyone
could give a brief summary of what's the difference
between Ruby and REBOL.

--
http://home.cogeco.ca/~tsummerfelt1

[snip]

I have found plenty of information on the internet that
compares Ruby with other languages, but not with Rebol.

I realise that I'm on a list for Ruby, and the answers
might be a little biased, but what are the pros and cons
for these languages?

For a while I did stuff in Rebol, before I switched to Ruby.
These days I only* use Ruby and has never looked back.

IIRC Rebol had some neat builtin constucts for creating your
own domainspecific languages.

···

On 11/2/05, Peter Carlsson <peter.carlsson.konsult@space.se> wrote:

--
Simon Strandgaard

(*) I also use objC++.

using REBOL for six years I would like to ask if anyone
could give a brief summary of what's the difference
between Ruby and REBOL.

i think the main difference you're going to find is the abundance of
documentation for ruby.

the docs for rebol are few and horrendous. the above example i wrote
when i first got into rebol but "system/script/args" took me four
hours to find. i had to comb through the rebol script library. before
i found the example. i've owned the official rebol guide for a few
years, but other than simple documentation lookups, the guide is
pretty much useless. 'ruby in a nutshell' holds more ruby information
in a 200 pages than the rebol guide does for rebol in 700+ pages.

I agree that the documentation for REBOL at the moment is a
weak point. At the REBOL DevCon 2005 last month this was one
of the top priorities. Another one was to attract more users,
which I think goes hand in hand. Lack of documentation will
scare many people away. If the documentation was good, maybe
the syntax didn't have to feel "quirky".

if it weren't for the rebol mailing list and script library i would
have probably given up on rebol a long time ago...

The mailing list is full of helpful people and has helped me
many times. As you say the script library is also good and you
also have AltME (http://www.altme.com) as well.

Personally I use REBOL for many daily tasks and I find new
things almost every day and is more and more impressed by
REBOL and its way to solve things. Ruby seems to have a lot
of neat things as well but I haven't used it more than a
short time yet. Always nice to learn more language though.

Best regards,
Peter Carlsson

Kim Kubik wrote:

"Peter Carlsson" wrote

I apologize if this is a little bit off topic.

As part of my master thesis I am about to develop some
scripts using Ruby. As I have never used it before and
using REBOL for six years I would like to ask if anyone
could give a brief summary of what's the difference
between Ruby and REBOL.

could be very attractive for some users. E.g., at the REBOL
prompt I typed:

send t...@email.msn.com "Did this work?"

and in response it dialed my modem, connected to my ISP, and then REBOL
crashed after provoking an invalid page fault in kernel32.dll. Then my
connection broke, and the modem dialed and connected again.
Then it just sat there until it timed out.

I never had any problems like that. REBOL has always felt
very robust and the latest versions has been improved in
functionality alot. Maybe if it's reproducible you should
send them a bug report?

Best regards,
Peter Carlsson

Lionel Thiry <lthiryidontwantspams@skynetnospam.be> writes:

Ruby is fondamentally OO. For exemple, you never truly call any
function, you just send messages to objects. While Rebol is
fondamentally procedural with prototyped OO.

Rebol also makes use of generic functions and multi-method
dispatch/overloading (they call them "relative expression"); in Ruby
this is done with duck-typing.

Rebol is a lot DSL based. Ruby may have DSLs but is not that much based
on them. (DSL == Domain Specific Language)

Block in Rebol is a fit-for-all construct which, among other things,
allow to manage non evaluated piece of code (in other words: quotation).
Block in ruby isn't a quotation, but it is still a piece of code which
works as a closure i.e. it binds local variables of its enclosing scope.
Ruby has a lot of facilities to manage blocks and use it almost everywhere.

Also, blocks in Rebol support introspection ("source"), in Ruby this
is basically not possible (at least not to the extent of Rebol, even
with nodewrap and ruby2ruby). Ruby blocks therefore are not used to
store data, in Rebol they can be used as a data-structure ("Series!",
but compare with Ruby generators and Enumerable). Rebol blocks are
first-class, a function can take any number of them.

Rebol's block share the defining scope too, there is a "hack"
("/local") (and sorry, I just call it that way because it's rather
similar to what awk does :-P) to introduce block-local variables.

Rebol is dynamically typed while Ruby has in fact only one type: the
object. It means ruby never checks types (but you still may explicitely
check an object's class), it relies on its method dispatching system,
alias the lookup, to tell you if a method call is valid or not.

Therefore, Ruby is dynamically typed too. I don't think there is a
difference in the languages with respect to that, but my Rebol is
rather rusty.

I don't remember if rebol had an exception framework, but I'm sure ruby
has one. An invalid method call, for example, raises an exception.

Rebol has "catch", "throw" which are comparable to Ruby's method with
the same name. An exception framework exists too, the exception
handling looks a bit more clumsy to my, though.

I'd like to add: Rebol's syntax is totally regular, there are no
exceptions for control-structure (I'm not sure if the control
statements are keywords or functions, I guess the latter.). Compare
with Smalltalk, Io or Tcl. This can be a curse or a blessing,
depending on your Lisp influence and your eyes. Rebol doesn't have
operator precedence either.

Rebol has a BNF parser in the core, maybe comparable to Perl6's rules.
Ruby can provide these things with external libraries, which can be
very convenient due to syntactic sugar too.

Rebol/View has it's own GUI library, Ruby provides binding to a lot of
them (Tk, Gtk+, Qt, Cocoa, Win32, Wx, Fltk).

Ruby is open-source, available under the GPL and a BSD-like, more
permissive license; Rebol is available as binaries only.

Finally, Ruby has a friendly and strong community; Rebol has a lot
less users and less third-party libraries.

···

Lionel Thiry

--
Christian Neukirchen <chneukirchen@gmail.com> http://chneukirchen.org

i agree. when people see how quickly net related operations can be
done because of the built in protocols quirky will not be factor.

somebody else mentioned the fact that opensource languages are adopted
a lot quicker.

i realize the folks in charge of rebol want to make money, but
crippling a programming language is not the way to do it.

view just was just recently allowed to access the shell but i think
that came a little too late.

take a look at some of the applications written in ruby (freeride
being a great example) there's NOTHING this sophisticated in rebol
with the possible exception of altme.

altme is unique but it's two major problems are: too integrated with
the altme server (with a cost of $295 on linux to 'free' it) and that
the source is not available. i think if the source had be available
you would have seen a file transfer feature 2 years ago.

none of the programs in the script library are sophisticated enough to
'steal' for use in other programs.

having said all that, i like rebol. i like the 'feel'. i like the
size. i'm still holding out for the sdk to drop below $100 U.S so some
of us single developers can add it to our toolbox :slight_smile:

···

Peter Carlsson wrote on 11/3/2005 2:09 AM:

scare many people away. If the documentation was good, maybe
the syntax didn't have to feel "quirky".

--
http://home.cogeco.ca/~tsummerfelt1

"Peter Carlsson" wrote in message
  "kim kubik" wrote

> at the REBOL prompt I typed:
>
> >> send t...@email.msn.com "Did this work?"
>
> and in response it dialed my modem, connected to my ISP, and then REBOL
> crashed after provoking an invalid page fault in kernel32.dll. Then my
> connection broke, and the modem dialed and connected again.
> Then it just sat there until it timed out.

I never had any problems like that. REBOL has always felt
very robust and the latest versions has been improved in
functionality alot. Maybe if it's reproducible you should
send them a bug report?

that was from someone else's posting to c.l.python in 1998 (probably on
a Win95 system), it is not my doing, I merely passed it on; I'm sure
things have been improved since then. You might also Google Groups for
Larry Wall's circa 1998 impressions of REBOL, again, impressions of
REBOL circa 1998.

It's not just an issue of proprietary languages being limited by the
vendor or not developing as quickly as open source languages; there's
also the issue of what happens if the vendor goes under or is bought out
by a competitor who discontinues their product.

You gotta wonder -- is it worth pouring months or years of work into
software in a language that can just disappear overnight?

On the other hand, even if civilization were wiped off the face of the
earth by nuclear holocaust, I'm willing to bet even money that there'd
be a post-apocalyptic shaman somewhere invoking the god Enumerable and
speaking reverently of chunky bacon.

-mental

···

On Thu, 2005-11-03 at 21:36 +0900, tony summerfelt wrote:

somebody else mentioned the fact that opensource languages are adopted
a lot quicker.

i realize the folks in charge of rebol want to make money, but
crippling a programming language is not the way to do it.

I'm not sure but I think the REBOL pattern matching is like REXXs
parse command, rather than awk/sed/perl regexps.

The author of REBOL, Carl Sassenrath did a lot of work with Amiga,
which had integrated ARexx, so its possible that some REXX features
inspired REBOL.

It's not just an issue of proprietary languages being limited by the
vendor or not developing as quickly as open source languages; there's
also the issue of what happens if the vendor goes under or is bought out
by a competitor who discontinues their product.

that's a good point. although in some cases if the company is general
enough (yahoo, google, etc.) they're likely to release it for free.

You gotta wonder -- is it worth pouring months or years of work into
software in a language that can just disappear overnight?

and that counts for ANY software (raise your hand if you miss pctools
v6.0, the only real competitor to norton utilities.) not just
programming languages.

···

MenTaLguY wrote on 11/3/2005 1:40 PM:

--
http://home.cogeco.ca/~tsummerfelt1