[REBOL] Re: What language am I looking for?
From: joel:neely:fedex at: 14-May-2001 23:17
Hi, Ken and everyone else,
Having been out of town a couple of days, let me belatedly add
my $0.02.
Ken Anthony wrote:
>... Although I've used dozens of different languages over the
> years, I have always rejected the idea that I couldn't find
> one with both the depth and breadth to do what I ask of it...
>
You're certainly entitled to your quest, "to follow that star..."
(Oops. About to break into song there. ;-) Seriously, good luck!
If you ever find that ideal language, please let me know!
My experience has been that I ask my computers to do so many very
diverse things that I'm better off using different languages for
different tasks. The last two major efforts (of which I'm aware)
aimed at building one-size-fits all languages produced PL/1 and
ADA, and I don't know of very many people that even *use* either
of those, much less regard them as "final solutions".
Finally, the reason I regard this quest as a "never-ending story"
(I can't seem to avoid literary allusions tonight ;-) is that we
(the human race in general) are still learning what to do with
computers. A significant part of my programming concerns daily
applications of concepts that didn't even exist (or barely
existed as laboratory exercises) when I was in graduate school.
As we learn how to do more, and think of new things to do with
our digital toys, we'll continue to have new ideas for how to
conceive of what we're doing -- *and* how to express those ideas
to ourselves and our gadgets.
OK. Enough soap box.
What I *can* tell you is what I think REBOL is good for. You
can decide for yourself whether those things are central enough
to your interests to give you a return on the effort of learning
REBOL.
> ... I have two uses for a language, to get work done, and for
> recreation. When I can't actually get work done with it, I
> tend to lose interest in it as a hobby.
>
I have quite a bit of difficulty distinguishing between work and
play myself! ;-)
> ... It's the little things that count, like using square brackets
> to begin and end a block. [] seems so obviously right to me.
>
The first not-so-little neat feature of REBOL is that blocks are
just blocks, neither exclusively code nor exclusively data. This
opens up a whole world of expressive power. (Incidentally, that
is the sense in which I use the word "power", as almost synonymous
with "expressivity". The ability to twiddle bits and flog registers
at the bare metal level is just speed. ;-)
The next big strength of REBOL is platform-neutrality. I've moved
the same scripts (some useful web-site-generation tricks) among w95,
MacOS, Solaris, HP-UX, Linux, and w2K, with nary a platform glitch.
I can work on it anywhere and it works anywhere.
The specific things that pushed me over the edge into using REBOL
regularly were the built-in (albeit primitive) XML parser and the
rich suite of network support features. One of the first things I
wrote in REBOL was a web-server stress-tester. I've used XML as a
configuration file format for many REBOL-based projects, and found
that to be very useful.
With regard to parsing, the best quick summary I can give is to
think of the PARSE dialect as extended BNF, and forget you ever
heard of regular expressions. (I happen to like regular
expressions,
and in fact use Perl quite often -- put that tomato down, Ralph! --
but BNF and REs are just so different that it doesn't pay me to
try to think of both at once.)
> The highest item on MY list is, can I do that?
> (With a minimum of grief.)
>
My experience is that it depends VERY much on what the "that" is.
I gave up trying to use REBOL for 2- and 3-dimensional array
computation. The notation was too awkward and the performance
just wasn't there.
OTOH, I would hate to do much text parsing and cgi work in c!
(And don't even MENTION c-octothorp!)
To be objective, some of REBOL's current weaknesses are:
1) Lack of comprehensive specifications and documentation for
the language, especially the newer features. Let's face it;
REBOL is a work in progress, and the lack of polished docs
is the price you pay for being on the cutting edge of new
developments.
2) Speed. Or lack thereof. If you need the raw bit-crunching
velocity of gcc with all optimizations turned on so that
you can drive your 21-inch monitor and 100-base-T NIC to the
wall, you won't be doing it in REBOL. (However, for moderate
volumes of CGI hits, development, rapid-turn-around scripts,
trying ideas out, and any situation where plus-or-minus 50%
on the run-time is no big deal, REBOL is quite adequate.)
3) Binary compatibility with other languages. (Of course, you
may not care, if you are looking for the One True Language.)
Being able to write chunks of an app in different languages,
variously compile them and link them together with off-the-
shelf libraries and make one self-contained binary... well,
you aren't going to be doing that with REBOL (at least not
Real Soon Now).
> I've followed the discussion of scope with regard to Rebol with
> some concern. The idea that variables that are all static and
> global does not give me the warm fuzzies (or that you have to
> declare variables local in a function. Just the act of declaring
> them should make them local.)
>
If my posts have created a misconception here, let me apologize and
try to clarify. It is *not* the case that all variables are static
or global. REBOL simply has such a radically different approach to
scoping (i.e., contexts) that conventional comp sci terminology runs
the risk of being very misleading.
REBOL primarily controls scope by "definition", be it of a function,
an object, or otherwise. The *defaults* in some cases favor speed
over encapsulation, but given that REBOL can create functions,
objects, etc. on-the-fly as often as needed, one can implement
ideas that go well beyond the defaults.
As far as words in a function being "local" by default, well I've
been learning and imagining new languages for lotsa years, and it
seems to me that there's virtue in allowing a function/procedure
to access data both in its own scope and in previously-existing
scopes. Which of these cases (local vs. non-local) one makes the
default seems to boil down to:
1) politics and "religion",
2) which case is used more, and therefore should require less
typing to utilize,
3) how much the language designer wants to protect me from myself
vs. give me the power to say what I want (including saying
things I don't understand well myself and then get bitten by)
> I'm a VB programmer these days because that's the language the
> project was written in when I joined my present employer. We do
> have to use C where it's the only option, although I personally
> haven't touched the language in years. The project has about
> 700,000 lines and hits a database with over a hundred tables.
> I need to be able to write this kind of application in my
> language of choice.
>
Does embedded SQL count as another language? ;-)
> Which brings us back to that highest item on my list. As an
> example, if the layout dialect didn't exist, could I write it
> myself in Rebol or would I have to go begging RT to include
> the feature in a new version?
>
VID is a dialect built on top of the more fundamental UI
concepts in REBOL/View. You can rewrite it yourself if you
want to change the way it works. But you have to do so in
REBOL/View, not REBOL/Core. Similarly, if you want to write
some nice dialect that lets you replace bash or ksh with REBOL,
you can do so, but only if you're working in REBOL/Command.
The different flavors of REBOL provide *both* some critical
basic mechanisms and some nice syntactical sugar for using them.
> What other things do I need that are not included? How do I
> create a new widget that isn't already provided for me?
>
Use the source, Luke!
Look at how VID implements the basic
set of widgets it offers, then look at the WinSkin demo, then
try your hand at creating another widget.
I know this reply has rambled severely (it's late here...), but
what I've tried to do is say, "Here's what I personally think
are some of the strengths and weaknesses of REBOL. If those
line up well with the kinds of programs you want to write, then
I recommend it."
Hope this helps!
-jn-