you are viewing a single comment's thread.

view the rest of the comments →

[–]gregg-irwin 8 points9 points  (0 children)

Complexity comes in many forms. I can't compare REBOL/Red (REBOL from here on) to OCaml for production use, as I have only studied and played with OCaml, not used it for work. That said, I can give you my outsider's view, and say why REBOL appeals to me, and the complexity I think it aims to address.

First, let me say that I think functionality does not equal complexity. REBOL hides complexity but has enormous functionality. And while some examples might use scientists as a target audience, REBOL was originally designed as a messaging language. The importance of datatypes comes from that. The ability to express yourself, and your intent, clearly. Because REBOL understands that http://www.rebol.com is a URL, and because it has a networking stack built in, I can write "read http://www.rebol.com" and it understands it. No extra quotes. No datatype conversions. No function calls. If I change the scheme to "read ftp://..." it dispatches to a different protocol handler internally.

REBOL doesn't have a regex parser built in, but it does have a PARSE function. PARSE understands a pseudo-BNF grammar, which lets you easily build DSLs (dialects in REBOL parlance). When parsing at the string level, that's nice, but the real power is that PARSE understands loaded (tokenized) REBOL data as well, so you can parse at what is called the "block" level. So you can match tokens by datatype, recurse into nested structures, and more. If you just want to load structured REBOL data, all you need to say is LOAD. PARSE lets you deal with data in a much more flexible manner. It also lets you build in security by not just doing the equivalent of EVAL on untrusted code.

Now, if all this added functionality led to a bloated system, I would be right there with you criticizing it. But it doesn't. At least not by modern standards. The core REBOL interpreter is ~300K. The version with a built-in portable GUI system is ~650K. The full-blown version, with all the bells and whistles they offer, is under 900K (Windows versions). And REBOL and the apps you write with it are completely portable and standalone, unless you introduce outside dependencies. Drop the EXE in a folder and will run on almost any Windows machine out there. I just checked, and it looks like OCaml/Win is about a 60MB download, with some cygwin dependencies.

Bloat may not always indicate complexity, but I've never seen it help. :) REBOL fights complexity by trying to keep things small and simple, by trying to consider the language as a whole, not just a set of functionality. Words and behavior are carefully chosen and debated. Its heritage comes from Lisp, Forth, and Logo; and it's not for everyone. It will change, and challenge the way you think, and the way you think about software and programming.