Parsing comment
[1/44] from: jason:cunliffe:verizon at: 23-Sep-2002 0:03
Today I read a comment about REBOL which I don't understand. I am NOT seeking to
start a language flamewar. Just curious and hoping someone here can explain more
about parsers. I barely know how to use REBOL's parse, but I like what I know
about it, and it has a strong reputation in these waters.
> On Rebol (which to my ears rhymes more with Cobol than with rebel :-),
> I've not looked much at it personally, but I trust a close colleague
<<quoted lines omitted: 4>>
> must try to learn from other ideas in it, not from the core language
> design.
The context behind this is I have been engaged in a some intense debate on the
Python-oriented Edu-Sig list. I love Python, but tried point out the obstacles I
think it presents to very novice programmers.
I mentioned REBOL, giving a contrasting example of how direct and friendly
REBOL's help command is. Mainly because it includes a search function. Simple
idea, but incedibly friendly effective result. My scenarios was of novice python
student trying to determine the current working directory. "Where am I?"
>> ? d
>> ? dir
>> ? what-dir
Python by contrast is great for hackers, and should be great for students. It
has all kinds of super-duper tools a for browsing docstrings, and object
introspection, but it can be initially overwhelming or useless, until you know
exactly what to type, you can find yourself a few screenfulls later before your
get the golden answers. In Python to answer the question "where am I?" you have
import a module, then invoke one of its methods. Very Easy when you know how,
but obscure as hell when you don't:
>>> import os
>>> os.getcwd()
'C:\\Python22'
Thanks
./Jason
[2/44] from: ingo:2b1 at: 24-Sep-2002 6:06
Hi Jason,
this comment is not directed at the rebol parse word, but at the
internal parser which parses a script to execute it.
So what he weans is the following:
fee fie foe fum
may be a valid line in a Rebol script. But you don't know from first
view what happens here: are these 4 functions, run one after another? Is
it one function with 3 arguments? Is it a function with 2 arguments,
where the second argument is first calculated by another function with
one argument? Or what? Only the parser knows at execution time, or the
one who knows the words by heart.
In Python the line might look like:
fee( fie foe( fum))
where you can instantly see, that fee is a function of 2 arguments, and
where the second argument is computed by foe, a function with one
argument.
Now in Rebol, due to it's LISPy nature, you could write it like:
(fee fie (foe fum))
to give you the same visual feedback, but you aren't forced to use the
parentheses, so most people don't most of the time, except when the
expression becomes too complicated.
I hope that sheds a little light on the subject.
Kind regards,
Ingo
Am Mon, 2002-09-23 um 06.03 schrieb Jason Cunliffe:
[3/44] from: jason:cunliffe:verizon at: 23-Sep-2002 23:36
http://mail.python.org/pipermail/edu-sig/2002-September/002361.html
http://mail.python.org/pipermail/edu-sig/2002-September/002362.html
http://mail.python.org/pipermail/edu-sig/2002-September/002363.html
I dunno what got into me.. must've been the full moon or something!
./Jason
[4/44] from: tomc:darkwing:uoregon at: 23-Sep-2002 22:10
Hi Jason,
I'm not attempting to answer your question so much as point out that you
and your 'friends-friend are refering to different parsers,
You are are talking about the parse dialect in rebol.
They seem to be refering to the parse that is conducted by the rebol
interperter as it reduces blocks of code/data into what we want.
I am not clear on what their problem with "number of arguments to a
function" is but maybe it is that the number is fixed -- no overloading
or maybe they miss brackets f()
maybe one of the languages people will explain the trade offs w.r.t.
argument passing.
On Mon, 23 Sep 2002, Jason Cunliffe wrote:
> Today I read a comment about REBOL which I don't understand. I am NOT seeking to
> start a language flamewar. Just curious and hoping someone here can explain more
<<quoted lines omitted: 8>>
> > must try to learn from other ideas in it, not from the core language
> > design.
snip
[5/44] from: g:santilli:tiscalinet:it at: 24-Sep-2002 8:39
Hi Jason,
On Monday, September 23, 2002, 6:03:50 AM, you wrote:
JC> start a language flamewar. Just curious and hoping someone here can explain more
JC> about parsers. I barely know how to use REBOL's parse, but I like what I know
The comment below has noting to do with REBOL's PARSE function.
>> I've not looked much at it personally, but I trust a close colleague
>> who has, and who finds it hard to use because the parser cannot know
[...]
I.e., he's suggesting that we should use parenthesis like Lisp. My
answer is, no comment.
(There are a lot of things in REBOL that could be criticized, but
this one really makes no sense to me.)
Regards,
Gabriele.
--
Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer
Amigan -- AGI L'Aquila -- REB: http://web.tiscali.it/rebol/index.r
[6/44] from: al:bri:xtra at: 24-Sep-2002 18:00
Equinox got to you? :)
Andrew Martin
ICQ: 26227169 http://valley.150m.com/
[7/44] from: gscottjones:mchsi at: 24-Sep-2002 5:25
Hi, Jason,
From: "Jason Cunliffe"
...
> http://mail.python.org/pipermail/edu-sig/2002-September/002362.html
...
<external quote>
...
> rejoin ["some string" variable function [param1 param2]]
>
> If it gets any longer than that,
> time for line breaks.
> Keep each phrase
> on its own line
> so it reads like a poem!
...
That is wonderful! REBOL poetry for the masses (, but the gurus use REBOL
sonnets!). I think Ralph Roberts would like this, too.
I guess REBOL's indentation rules (or lack thereof) and syntax (or lack
thereof) would probably drive a hard-core Pythoner to drink (at least one
who had never been exposed to more functional-like languages). It made me
think of another analogy, of sorts, in how we learn language. We start with
short phrases, testing them out, and see what response we get. Sometimes,
we see that our meaning has been conveyed; other times, not. Sometimes we
*unknowingly* carry forward an ambiguous state of knowledge and
understanding that only unravels much later. It can be very confusing to
the initiate. The ability to work interactively with short commands can be
very powerful, easy way to learn and be productive from early on.
Some imperative languages (NB: I am not necessarily characterizing Python in
this regard) require a process more akin to sentence diagramming. However,
instead of decomposing a sentence into its diagram, one would construct the
fragments, and then string the fragments into a working whole. The process
itself may contribute to developing well-organized, technically correct
sentences (or program, by way of the analogy) where errors can be pinpointed
more readily, but the learning curve for the initiate is daunting. Proper
construction requires vision, planning, and experience.
Most of us learn our spoken languages at the command-line console of life.
Later, we learn more about proper structure through the implicit method of
diagramming in the development of sentences, paragraphs, and topics. I do
not know this to be true, but my guess is that some languages have more
built-in ambiguity than others. Formalized training in the scientific
process helps us to disambiguate language and concepts, but our building
blocks are inherently ambiguous (by tradition and culture).
REBOL and Python both offer the consoles that ease the learning curve. Both
are high level in that we are not having to bake our limestone, so that we
can have cement to which we can add to aggregate and build the concrete
foundation upon which we build our house (makes me miss assembly language).
REBOL allows a decidely more free-form construction that can become James
Joyce-ian, and therefore inscrutable to all but the REBOL interpreter and
the author :-). Python encourages the sort of structure upon which sky
scrappers can be built. These are not absolutes, of course, as we certainly
know that James Joyce wrote some impressive novels, and who amongst us
believes that we are going to build a sky scrapper by ourselves.
The one special quality that REBOL offers over many other languages is the
stuff of alchemy: not only the ability to know about itself, but to change
itself into something quite different. It is the jump from the hand carved
printing block to moveable type. REBOL is not unique in this capacity, of
course, nor do many people take advantage of this feature. But like the
lawyer who can wiggle his/her words as needed, its nice to know that it
*can* be done when needed.
;-)
Thanks for sharing your ideas.
--Scott Jones
[8/44] from: al:bri:xtra at: 24-Sep-2002 16:36
Jason wrote:
> Today I read a comment about REBOL which I don't understand. I am NOT
seeking to start a language flamewar. Just curious and hoping someone here
can explain more about parsers. I barely know how to use REBOL's parse, but
I like what I know about it, and it has a strong reputation in these waters.
> > ...who finds it hard to use because the parser cannot know the end of a
function's parameter list -- that's only known at run time, once the
function is called.
I think your correspondent means the parser that interprets the Rebol
dialect, not the 'parse dialect. And I think the colleague is unused to
Rebol language with it's no function calling syntax. For example, in Rebol:
>> print 1 + 2
3
In other languages (like Python), the above is something like:
print (1 + 2)
(I think...)
Andrew Martin
Who's recall of other languages is fading away in the blinding light of
Rebol...
ICQ: 26227169 http://valley.150m.com/
[9/44] from: brett:codeconscious at: 24-Sep-2002 20:24
Hi Jason,
> > who has, and who finds it hard to use because the parser cannot know
> > the end of a function's parameter list -- that's only known at run
> > time, once the function is called.
Ingo and Tom have pointed out how the the parser that is being referred to
is the language parser and why it is difficult to identify a function's
arguments or even whether it is a function anyway. More than this though,
it is a funny comment in the context of educating novice programmers. The
trials and tribulations of a parser don't seem relevent to someone learning
a language.
>> Sounds like dead on arrival to me,
> > as far as language design goes.
This to me implies that the writer is singularly focussed on the design of
Python and potential improvements. No real interest in REBOL as far as I can
see here. It indicates a certain assumed world view as far as the way things
should work. Rather that writing "dead on arrival" that person would have
done themselves a favour and perhaps learnt something by instead asking the
question "I wonder if it is appropriate to apply my ideas of language design
to REBOL in this instance?".
The REBOL language primarily consists of syntactic forms e.g http://blah...
is an url!. If you need the In "base" REBOL, only functions (at evaluation
time) imply any sort of grammar (any specific ordering of items in the
source input). Though the exception might be the operators +, -, = etc.
The whole point about the design of REBOL is, I think, that it is a
foundation that enables many languages to be designed (dialects). Dialects
are the languages of REBOL where the grammar is made apparent. You can
create a dialect/language so that a parser can know where a function ends,
etc. It is just that you have to write the parser (PARSE is a tool to assist
this).
Writing a dialect and a parser for it is worthwhile only if it adds value in
some way. For example, some time ago Andrew Martin published his XML script
which evalutes a dialect he defined. The result of the evaluation is well
formed XML. His dialect added value by enabling a simple syntax to generate
XML. VID adds value by enabling a simple syntax to generate visual
interfaces for REBOL/View.
Just because we can read the source of Andrew's XML function does not mean
that the input to it it isn't *real* executable code. In REBOL it is the
evaluation of the input which defines the meaning/effect. Andrew's XML
function becomes another mezzanine alongside LAYOUT etc. In this way we end
up "growing" REBOL in ways best suit our requirements.
I don't know Python, but I'm guessing that the main way to "grow" Python is
through class libraries. REBOL's dialects can be "melded" together - the
like paren! inside VID or a parse rule. They are embedded languages, which
has been reported as an extremely powerful way to construct programs. Class
libraries tend to interact like oil and water - they don't, your main
program has to do it for them.
>>.... So if we want to learn from Rebol, we
> > must try to learn from other ideas in it, not from the core language
> > design.
I guess people will always miss out on varying experiences and things that
can be learnt because it it is in fact really hard to let go of
pre-conceptions. :^)
Regards,
Brett.
[10/44] from: steven:white:ci:bloomington:mn:us at: 24-Sep-2002 12:21
>I.e., he's suggesting that we should use parenthesis like Lisp. My
>answer is, no comment.
>(There are a lot of things in REBOL that could be criticized, but
>this one really makes no sense to me.)
His reasoning might be what stumped me for a long time
with REBOL. Some of us are so used to languages requiring
punctuation that we develop a subtle reliance on it for clues
about what we are reading, such as, what are the parameters
for a function, which statements are executed if a condition is
true, where does the program start, where does it end. It has
taken me a while to get over that. I've been wondering if
I should try writing a book called REBOL For COBOL
Programmers.
Of course the other side of the punctuation issue is that if
it is required, then errors in it can make interesting program
bugs. (Reminds me about the episode of the period and
the fuzzy paper...)
Steven White
City of Bloomington
2215 W Old Shakopee Rd
Bloomington MN 55431-3096
USA
952-563-4882 (voice)
952-563-4672 (fax)
[swhite--ci--bloomington--mn--us]
[11/44] from: g:santilli:tiscalinet:it at: 24-Sep-2002 21:19
Hi Steven,
On Tuesday, September 24, 2002, 7:21:11 PM, you wrote:
SW> His reasoning might be what stumped me for a long time
SW> with REBOL. Some of us are so used to languages requiring
SW> punctuation that we develop a subtle reliance on it for clues
But you can use punctuation in REBOL if you want to, you just
aren't forced to.
Also, the whole idea is that REBOL is dynamic. It couldn't be if
there was punctuation. I.e.:
print a + b
DOES NOT have a meaning, unless evaluated under some rules and
some context. When you use syntax to give meaning (as opposed to
context), you are imposing artificial limits. Whether they are
useful or not, depends. I think that the point of REBOL is
simplifying, also by removing some artificial limits.
Of course, IMHO.
Regards,
Gabriele.
--
Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer
Amigan -- AGI L'Aquila -- REB: http://web.tiscali.it/rebol/index.r
[12/44] from: carl:cybercraft at: 25-Sep-2002 13:53
Hmmm. This bounced with the first try. Everyone's a critic... (:
Anyway...
On 23-Sep-02, Jason Cunliffe wrote:
> Today I read a comment about REBOL which I don't understand. I am
> NOT seeking to start a language flamewar. Just curious and hoping
<<quoted lines omitted: 9>>
>> learn from Rebol, we must try to learn from other ideas in it, not
>> from the core language design.
Ingo gave a good example of what they were probably on about I think.
ie,
fee fie foe fum
could be any mixture of functions and arguments in REBOL. For those
coming from other languages, seeing half a dozen or more words in a
line with nothing to distinguish between them other than their
letters can be disconcerting. The problem's caused by REBOL being a
functional language I guess. If we were forced to use parens
everywhere the scripts would look horrible, as apposed to just
incomprehesible. For this reason, I've never liked the suggestion
that the best way to learn REBOL is to look at other people's
scripts. It didn't work for me and I doubt it does for a lot of
people. Get the guide and start writing scripts would be my
suggestion.
What's important with your scripts is to choose good words for your
functions and data, something that doesn't always matter as much in
other languages. Ideally the words should suggest what they do or
the data they represent, but it's not always easy thinking of good
ones when you're coding - it can interrupt the flow.
Once you're reasonably comfortable with REBOL you don't give a second
thought about this, though it may be that REBOL's only suitable to
certain types of programmers. That said, I haven't heard any major
complaints about this from those who've seriously attempted to learn
REBOL. Speed, features, documentation and licencing seem to get much
more complaints.
--
Carl Read
[13/44] from: carl:cybercraft at: 25-Sep-2002 16:27
On 24-Sep-02, Jason Cunliffe wrote:
> http://mail.python.org/pipermail/edu-sig/2002-September/002361.html
> http://mail.python.org/pipermail/edu-sig/2002-September/002362.html
> http://mail.python.org/pipermail/edu-sig/2002-September/002363.html
> I dunno what got into me.. must've been the full moon or something!
> ./Jason
(: A good read anyway, Jason. I'm not sure you're right about people
finding REBOL easy to get into though. As with most things, some
people go for them like a duck to water. But I wouldn't be surprised
if a lot give up on REBOL pretty quick due to it being a little bit
too free-form for their liking.
But anyway, that last poster's good-things-about-REBOL had this in it:
"...the idea of building a cursor into container objects which is
then manipulated via side effect..."
Ummm, pardon?
Oh - does he mean the series' index? (Why do the answers come to me
/after/ I've written the question and not before?;)
--
Carl Read
[14/44] from: carl:cybercraft at: 25-Sep-2002 16:53
On 25-Sep-02, Gabriele Santilli wrote:
> Also, the whole idea is that REBOL is dynamic. It couldn't be if
> there was punctuation. I.e.:
<<quoted lines omitted: 4>>
> useful or not, depends. I think that the point of REBOL is
> simplifying, also by removing some artificial limits.
And we can have...
print + a b
which is more functional, shall we say, but can we write functions
that behave like operators? (Or can we write operators, for that
matter.) ...
>> + 1 2
== 3
>> 1 + 2
== 3
>> sum: func [a b][a + b]
>> sum 1 2
== 3
>> 1 sum 2
** Script Error: sum is missing its b argument
** Near: sum 2
Can it be done?
--
Carl Read
[15/44] from: brett:codeconscious at: 25-Sep-2002 14:58
== 3
> >> 1 sum 2
> ** Script Error: sum is missing its b argument
> ** Near: sum 2
>
> Can it be done?
In a dialect, probably.
As normal REBOL behaviour - hopefully not ;^)
Brett.
[16/44] from: anton:lexicon at: 25-Sep-2002 14:52
I disagree. :) But first, I would say that
it's probably silly to start promoting rebol
here. We should hang out on other mail lists
and catch misinformation where it is usually
missed.
> For this reason, I've never liked the suggestion
> that the best way to learn REBOL is to look at other people's
> scripts. It didn't work for me and I doubt it does for a lot of
> people. Get the guide and start writing scripts would be my
> suggestion.
I learned a lot by reading other people's code
on this mail list and from their rebsites.
Anton.
[17/44] from: carl:cybercraft at: 25-Sep-2002 18:02
On 25-Sep-02, Anton wrote:
> But first, I would say that
> it's probably silly to start promoting rebol
> here. We should hang out on other mail lists
> and catch misinformation where it is usually
> missed.
Fair enough, as long as you don't end up being their local REBOL
zealot. Easy to turn people off just by the level of noise you
generate. (:
--
Carl Read
[18/44] from: al:bri:xtra at: 25-Sep-2002 18:09
Carl Read wrote:
> (Or can we write operators, for that matter.) ...
> >> + 1 2
<<quoted lines omitted: 8>>
> ** Near: sum 2
> Can it be done?
We can do something like it (acknowledgements to Gabriele):
!=: get first [<>]
And use it like:
>> 0 != 2
== true
>> 4 != 4
== false
But I don't know how to make other infix operator functions. It would be
nice to have them. I've got at least one application for it.
Andrew Martin
ICQ: 26227169 http://valley.150m.com/
[19/44] from: lmecir:mbox:vol:cz at: 25-Sep-2002 9:09
Hi,
allow me to jump in. Tim Peters was a regular Rebol list member for quite
some time, so he knows what he is speaking about. The comment on function
free-formness surprises me like it surprised Gabriele, because anyone can
use parens at will. Some expressions really need parentheses for
readability.
The only trouble with the free-formness is, that the interpreter has got
more work to do, which may slow down the interpretation.
Operators: I wrote some comments on operators in
http://www.rebolforces.com/~ladislav/rep.html - the section on Evaluation
Order.
Basically, the interpreter considers some words to be slightly different
than others - I call them OP-WORDS. Gabriele revealed, that there is an
unused OP-WORD !=. If an OP-WORD has a value of the OP! type, it becomes a
Rebol operator.
-L
----- Original Message -----
From: "Andrew Martin"
Carl Read wrote:
> (Or can we write operators, for that matter.) ...
> >> + 1 2
<<quoted lines omitted: 8>>
> ** Near: sum 2
> Can it be done?
We can do something like it (acknowledgements to Gabriele):
!=: get first [<>]
And use it like:
>> 0 != 2
== true
>> 4 != 4
== false
But I don't know how to make other infix operator functions. It would be
nice to have them. I've got at least one application for it.
Andrew Martin
ICQ: 26227169 http://valley.150m.com/
[20/44] from: g:santilli:tiscalinet:it at: 25-Sep-2002 11:17
Hi Carl,
On Wednesday, September 25, 2002, 6:53:36 AM, you wrote:
CR> which is more functional, shall we say, but can we write functions
CR> that behave like operators?
Not AFAIK.
Also, the interpreter is really doing tricks, because:
>> set '+ none
== none
>> 1 + 2
** Script Error: Invalid operator: +
** Where: halt-view
** Near: 1 + 2
(This one, for example, didn't allow me to use DO/NEXT to
automatically evaluate code in DBMS.r's query language, because I
use the words 'AND and 'OR.)
Regards,
Gabriele.
--
Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer
Amigan -- AGI L'Aquila -- REB: http://web.tiscali.it/rebol/index.r
[21/44] from: g:santilli:tiscalinet:it at: 25-Sep-2002 11:23
Hi Andrew,
On Wednesday, September 25, 2002, 8:09:38 AM, you wrote:
AM> And use it like:
>>> 0 != 2
AM> == true
>>> 4 != 4
AM> == false
That actually works because '!= is defined inside REBOL, to avoid
RT folks headaches when switching between C and REBOL.
>> sum: :+
>> 1 sum 2
** Script Error: sum expected value2 argument of type: number pair char money date time
tuple
** Where: halt-view
** Near: sum 2
AM> But I don't know how to make other infix operator functions. It would be
AM> nice to have them. I've got at least one application for it.
Indeed, it would be much better to have a generic mechanism to
define/undefine operators. I might want to avoid them for some
reason in one expression, so I should be able to disable that
processing in some way. Also, if I wanted to add an operator word,
I should have a way to add it to the list of words that are
considered operators by the interpreter.
Regards,
Gabriele.
--
Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer
Amigan -- AGI L'Aquila -- REB: http://web.tiscali.it/rebol/index.r
[22/44] from: reffy:ulrich at: 25-Sep-2002 7:23
> Also, the whole idea is that REBOL is dynamic. It couldn't be if
> there was punctuation. I.e.:
<<quoted lines omitted: 5>>
> simplifying, also by removing some artificial limits.
> Of course, IMHO.
print a + b
would have meaning if evauation order was right to left or parentheses were used
print (a+b)
[23/44] from: reffy:ulrich at: 25-Sep-2002 7:19
> which is more functional, shall we say, but can we write functions
> that behave like operators? (Or can we write operators, for that
<<quoted lines omitted: 3>>
> >> 1 + 2
> == 3
Seems you would need to have a function definition template much like APL has:
Define R Is lop FUNC rop ; locals {block}
Where "R Is" (by its presence) indicates the function returns an explicit result
Where "lop" (by its presence) indicates a left operand
Where "rop" (by its presence) indicates a right operand
Where "FUNC" is the name of the dyadic function (in this case)
Some variations as examples:
NILADIC FUNCTION / no RESULT
Define FUNC {block}
NILADIC FUNCTION / with RESULT
Define R Is FUNC {block}
MONADIC FUNCTION / no RESULT
Define FUNC rop {block}
MONADIC FUNCTION / with RESULT
Define R Is FUNC rop {block}
DYADIC FUNCTION / no RESULT
Define lop FUNC rop {block}
DYADIC FUNCTION / with RESULT
Define R Is lop FUNC rop {block}
NOMADIC FUNCTION / no RESULT
Define [lop] FUNC {block}
NOMADIC FUNCTION / with RESULT
Define R Is [lop] FUNC {block}
Now, for a user defined function to simulate the built-in '+' primitive function:
Define R Is a plus b { R is a + b }
The order of evaluation is assumed to be strictly right to left unless overridden with
parens:
5 * 2 plus 2
(5 * 2) plus 2
=12
[24/44] from: jason:cunliffe:verizon at: 24-Sep-2002 13:51
> Equinox got to you? :)
Very much so!
Harvest Moon came early this year and caught me by surprise ;^)
./Jason
[25/44] from: jason::cunliffe::verizon::net at: 24-Sep-2002 16:25
dynamic syntax => was : {Re: Re: Parsing comment}
> But you can use punctuation in REBOL if you want to, you just
> aren't forced to.
<<quoted lines omitted: 6>>
> useful or not, depends. I think that the point of REBOL is
> simplifying, also by removing some artificial limits.
Gabriele.
Yes exactly. It is much more like conversation, narrative, poetry.
Rebol is idiomatic and code definitely reads best in small well presented
clusters with only a few words per line.
And like poetry and like FORTH, I see the real art of Rebol is
choosing/designing words well.
./Jason
[26/44] from: jason:cunliffe:verizon at: 24-Sep-2002 23:11
Re: Parsing comment
Hi Carl
> incomprehesible. For this reason, I've never liked the suggestion
> that the best way to learn REBOL is to look at other people's
> scripts. It didn't work for me and I doubt it does for a lot of
> people. Get the guide and start writing scripts would be my
> suggestion.
Yes right.
I do see a developing distinction and concensus from this.
Python [and ilk] is notable for readability.
One can learn a lot of Pythin by reading other peoples code
Rebol is first and foremost a writer's language in the same way FORTH is.
That's whay it's so good for rapid prototyping and fun too.
Pythin is too. In that sense it is very well balanced, but with REBOL one really
gets insde teh logic flow in a differnt way. Its 'narrative'. I suppose that's
my ways of saying functional.
Which raises the question: how well does Rebol scale.
> What's important with your scripts is to choose good words for your
> functions and data, something that doesn't always matter as much in
> other languages. Ideally the words should suggest what they do or
> the data they represent, but it's not always easy thinking of good
> ones when you're coding - it can interrupt the flow.
I agree.
REBOL reminds me often of'Starting Forth' by Leo Brodie. I read it my first
Amiga and started learrning JForth [for HMSL]. I he described well the art and
importance of selecting the right words. Wish I had my copy to hand.
Starting Forth
http://www.amazon.com/exec/obidos/ASIN/0138429227/002-1248362-9982457
http://home.earthlink.net/~lbrodie/books.html
> Once you're reasonably comfortable with REBOL you don't give a second
> thought about this, though it may be that REBOL's only suitable to
> certain types of programmers. That said, I haven't heard any major
Yes..
What do you think exactly it is that one learns to become comfortable?
What do think about REBOL being used as 'first' language and/or for kids?
> complaints about this from those who've seriously attempted to learn
> REBOL. Speed, features, documentation and licencing seem to get much
> more complaints.
Agreed
thanks for your comments
./Jason
[27/44] from: jason:cunliffe:verizon at: 24-Sep-2002 15:34
Hi Brett
Thanks to you and others for the careful comments.. its most encouraging.
I am sorry that I don't yet know how to write and discuss these topics
concisely. I am very interested in REBOL scope as a beginners language. Separate
from x-internet dreams and nifty commercial applications, I think primary
education is REBOL's 'true' home. So I'd love to keep this topic alive for a
while and see if some deeper collective insights can be focused.
> arguments or even whether it is a function anyway. More than this though,
> it is a funny comment in the context of educating novice programmers. The
<<quoted lines omitted: 4>>
> This to me implies that the writer is singularly focussed on the design of
> Python and potential improvements. No real interest in REBOL as far as I can
LoL: You don't know how right you are! That was said by Guido Van Rossum, the
brilliant and hard working author of Python. He is in so deep with what he is
doing, I guess her really does not have time to step back much. He is always
clear and decisive and has shown sound judgment. The growth of Python is proof
of that. Similar perhaps to Carl Sassenrath's relationship to REBOL, Guido is
known respectfully accepted as Python's BDFL [Benevolent Dictatator For Life]
Python Conference: The Opening Keynote, 2001
Guido van Rossum, Python's BDFL (Benevolant Dictator for Life), introduced the
conference theme, "Python Fits Your Brain"--not everybody's brain, but at least
the brains of those who like it. Guido has always preferred to make the language
work well for its adherents (and especially for himself) rather than try to
please everybody. Not only programmers but also artists, scientists and teachers
are finding Python well suited for their work
Make no mistake, Python is a formidable work with very interesting roots:
http://www.engin.umd.umich.edu/CIS/course.des/cis400/python/python.html
Python is a very new language; in fact it was released by its designer, Guido
Van Rossum, in February 1991 while working for CWI also known as Stichting
Mathematisch Centrum. Many of Python's features originated from an interpreted
language called ABC. Rossum wanted to correct some of ABC's problems and keep
some of its features. At the time he was working on the Amoeba distributed
operating system group and was looking for a scripting language with a syntax
like ABC but with the access to the Amoeba system calls, so he decided to create
a language that was generally extensible. Since he had some experience with
using Modula-2+, he decided to talk with the designers of Modula-3. Modula-3 is
the origin of the syntax and semantics used for exceptions, and some other
Python features. In 1989, during the Christmas holidays, he decided to give it a
try and design a language which he later called Python.
ABC was supposed to be a really easy beginners language [like LOGO]. I recall
Guido saying that ABC failed partly becuase he had made the mistake of insisting
on use of CAPITAL LETTERS.
Much later [1999] he co-wrote an ambitious [$7 million] DARPA grant proposal:
Computer Programming for Everyone
, usually refrered to as 'CP4E'. Here's the
original
http://www.python.org/doc/essays/cp4e.html
Also some written and oral interviews from around that time:
An Interview with Guido van Rossum [Linux Journal,1999]
http://www.linuxjournal.com/article.php?sid=5028
Dr. Dobbs NetCast
http://technetcast.ddj.com/tnc_play_stream.html?stream_id=240
In the end the CP4E grant project did not happen. But some active traces remain:
http://www.python.org/cp4e/
Some of the people on the Edu-Sig list carry the torch brightly, though many not
directly in line wiht the CP4E proposal. Some I think are sophsitaicated in
their reading and analysis of learning issues.
For example, Kirby Urner is a very open-minded developer who contributes to
Edu-Sig often, and while working closely with Python, his scope is much wider.
Kirby has been developing a curriculum, much of it around learning programming
through geometry:
http://www.inetarena.com/~pdx4d/ocn/
A good eaxmple of his approach is:
[Edu-sig] Update from Urner (Fri, 05 May 2000)
http://mail.python.org/pipermail/edu-sig/2000-May/000406.html
check the links he gives at the bottom of that page.
He also maintains a wonderful site "Synergetics on the Web", presenting some of
the core insights of Buckminster Fuller
http://www.grunch.net/synergetics/
> The REBOL language primarily consists of syntactic forms e.g http://blah...
> is an url!. If you need the In "base" REBOL, only functions (at evaluation
> time) imply any sort of grammar (any specific ordering of items in the
> source input). Though the exception might be the operators +, -, = etc.
that's an interesting way to describe it.
> Just because we can read the source of Andrew's XML function does not mean
> that the input to it it isn't *real* executable code. In REBOL it is the
> evaluation of the input which defines the meaning/effect. Andrew's XML
> function becomes another mezzanine alongside LAYOUT etc. In this way we end
> up "growing" REBOL in ways best suit our requirements.
Yes that's right.
> I don't know Python, but I'm guessing that the main way to "grow" Python is
> through class libraries. REBOL's dialects can be "melded" together - the
> like paren! inside VID or a parse rule. They are embedded languages, which
> has been reported as an extremely powerful way to construct programs. Class
> libraries tend to interact like oil and water - they don't, your main
> program has to do it for them.
hmm.. yes. Python is very structural, a giant open architectural toolkit, with a
strong set of framework patterns already established.
Python has multiple inheritance and overloading so you can 'cook' with it. Most
Python cookery is like a healthy meal - lots of salads, some side dishes and
several light courses. The very fancy stuff is incudes preparing sauces.
> >>.... So if we want to learn from Rebol, we
> > > must try to learn from other ideas in it, not from the core language
> > > design.
>
> I guess people will always miss out on varying experiences and things that
> can be learnt because it it is in fact really hard to let go of
> pre-conceptions. :^)
Isn't it just...
Keep trying though !
cheers
./Jason
[28/44] from: lmecir:mbox:vol:cz at: 25-Sep-2002 15:58
Hi,
I don't understand your post. I am pretty sure, that even
print (a + b)
has no meaning in Rebol without a context supplying additional info.
Example of an atypical meaning:
use [print a] [
print: func ['x] [reduce ['print to paren! x]]
a: func ['x 'y] [compose [a (x) (y)]]
print (a + b)
] ; == [print (a + b)]
Cheers
-L
----- Original Message -----
Sent: Wednesday, September 25, 2002 5:23 PM
Subject: [REBOL] Re: Parsing comment
> Also, the whole idea is that REBOL is dynamic. It couldn't be if
> there was punctuation. I.e.:
<<quoted lines omitted: 5>>
> simplifying, also by removing some artificial limits.
> Of course, IMHO.
print a + b
would have meaning if evauation order was right to left or parentheses were
used
print (a+b)
[29/44] from: rebol665:ifrance at: 25-Sep-2002 17:24
Hi Ladislav,
Could you explain a bit your code ? especially this line
print: func ['x] [reduce ['print to paren! x]]
Why is it not
print: func ['x] [reduce ['print to-paren x]]
Ciao
Patrick
[30/44] from: greggirwin:mindspring at: 25-Sep-2002 10:39
Just jumping in with a couple thoughts...
<< I'm not sure you're right about people finding REBOL easy to get into
though. As with most things, some people go for them like a duck to water.
But I wouldn't be surprised if a lot give up on REBOL pretty quick due to it
being a little bit
too free-form for their liking. >>
I think programming languages, like so many other things in life, may have
certain features that people feel are good or bad (universally or otherwise
:) but, from a syntactic point of view, people etiher like them or they
don't. Sometimes you spend a lot of time with a language and "get used to"
its syntax. Other times it just clicks in your head and you get it right
off. Some people like modern art; some don't. Some people like Antonio
Gaudi's architecture; some don't. That doesn't mean modern art is bad art or
Gaudi's designs are ugly. Some people like hacking, some like UML and lots
of "process". Neither one is universally better than the other. It depends
on the context.
I've looked at lots of languages and tools over the years. I can't tell you
why the majority of them didn't click with me, but they didn't. REBOL
clicked. I *really wanted* Eiffel, Python, and Ruby to click for me, much
like I wanted Oberon and Frontier to click for me as environments, but it
didn't happen. I can see so much potential in each of them, in different
ways, but they just didn't grab me. I still pull them out periodically, and
I still look for new things, but REBOL grabbed me - big time.
As I drift through my morning fog I think...
Is a cordless circular saw better than a Japanses pull saw? Could you design
a tool with the strengths of both and neither of their weaknesses?
Is pre-fab, or steel frame, construction better than timber-framing? Would
you want to build *every* structure using just one of those methods?
Is English better than Basque?
People can argue the technical merits of tools and languages but, if someone
can use them effectively, you can't discount them out of hand. Beyond the
technical viability of a tool, language, or process, can you disregard the
less scientific
aspects, like culture and craft?
...time for more coffee
--Gregg
[31/44] from: g:santilli:tiscalinet:it at: 25-Sep-2002 17:04
Hi Jason,
On Wednesday, September 25, 2002, 5:11:27 AM, you wrote:
JC> I do see a developing distinction and concensus from this.
JC> Python [and ilk] is notable for readability.
JC> One can learn a lot of Pythin by reading other peoples code
JC> Rebol is first and foremost a writer's language in the same way FORTH is.
JC> That's whay it's so good for rapid prototyping and fun too.
I'll add another interesting difference. I'm not an expert of
Python, but I don't think it would be possible to automatically
translate (i.e. compile) REBOL code into Python code, while it
shouldn't be too much difficult to translate Python code into
REBOL code.
Python is a scripting language. But REBOL is more than just that;
I've always had a hard time in trying to explain this to other
people, so either I'm not good at explaining it, or most people
does not really understand what a metalanguage is.
Regards,
Gabriele.
--
Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer
Amigan -- AGI L'Aquila -- REB: http://web.tiscali.it/rebol/index.r
[32/44] from: g:santilli:tiscalinet:it at: 25-Sep-2002 17:13
Hi Dick,
On Wednesday, September 25, 2002, 5:23:30 PM, you wrote:
run> print (a+b)
As Ladislav said, it doesn't. It is just a word! followed by a
paren! that contains three word!s. (Oh, in your example above
there's actually only one word! in the paren!, because you forgot
spaces. I'll just consider this a typo...) You can give this any
meaning you want in REBOL; by default, REBOL is set up to give it
the meaning you would expect by coming from other languages.
REBOL relates much more to XML than to other scripting
languages...
Regards,
Gabriele.
--
Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer
Amigan -- AGI L'Aquila -- REB: http://web.tiscali.it/rebol/index.r
[33/44] from: rotenca:telvia:it at: 25-Sep-2002 20:36
Hi Gabriele,
> print (a+b)
>
> As Ladislav said, it doesn't. It is just a word! followed by a
> paren! that contains three word!s
I am not so sure. :-)
This is true only if the standard function Load has been called on the
original string, but Rebol does not require it:
x: to-word "print (a + b)" ;== print (a + b)
t? x ;== word!
mold x; == "print (a + b)"
and it can be used almost like all other words.
---
Ciao
Romano
[34/44] from: gchiu:compkarori at: 26-Sep-2002 8:06
From all of this, I think Tim Peters does make a valid
comment. Many newbies have joined the list and left,
unable to come to grips with Rebol.
I think part of the problem is due to the lack of
documented scripts. Sure there are plenty of scripts now
in the script library ( and I don't think they were that
many when Tim (wink) was on the list which I think was
over 2 years ago), but the scripts in general were not
written to educate, but to perform some function. And who
bothers to document their scripts with the intention that
someone will learn something from them??
In an ideal world, Rebol scripts will be self documenting,
but to the newbies ( and me ), this is not going to be the
case.
If the librarian project ever gets off the ground, perhaps
this aspect could be addressed. Scripts could be rated on
their instructive value. A way to vote perhaps?
--
Graham Chiu
[35/44] from: greggirwin:mindspring at: 25-Sep-2002 15:03
<< If the librarian project ever gets off the ground, perhaps
this aspect could be addressed. Scripts could be rated on
their instructive value. A way to vote perhaps? >>
Or even a special category for tutorial scripts, and an area for function
libraries.
--Gregg
[36/44] from: reffy:ulrich at: 25-Sep-2002 16:30
I am trying to understand ...
10 + 10
means something to the Rebol interpretation process, but
10+10 does not have the same meaning, yet you say it can be
given different meaning. Are you implying that the expected operands
and the attributes of the operands to a built-in primitive function can be
respecified? Or are you saying "10+10" can be given new meaning as if
though a user-defined function? Help here please?
10 10+10 10
==10 20 10 OR
==20 20
Dick
[37/44] from: carl:cybercraft at: 26-Sep-2002 9:55
On 25-Sep-02, Jason Cunliffe wrote:
>> What's important with your scripts is to choose good words for your
>> functions and data, something that doesn't always matter as much in
<<quoted lines omitted: 7>>
> Wish I had my copy to hand.
> Starting Forth
http://www.amazon.com/exec/obidos/ASIN/0138429227/002-1248362-9982457
> http://home.earthlink.net/~lbrodie/books.html
I programmed in Forth and LOGO a long time ago, so REBOL's wordy-ness
is not a new concept to me. While I think it should scale well, I
wonder how easy large programs would be to maintain once the original
programmers have moved on. "Ummm, is that REBOL code in that block,
or someone's dialect?" (:
>> Once you're reasonably comfortable with REBOL you don't give a
>> second thought about this, though it may be that REBOL's only
<<quoted lines omitted: 3>>
> What do you think exactly it is that one learns to become
> comfortable?
The console and all those datatypes make your code easy to test and to
trial different ways of doing things. I seem to spend more time
searching for the names of REBOL's native words (which this old brain
has forgotten again:) than I do in tracking down bugs.
> What do think about REBOL being used as 'first'
> language and/or for kids?
Tim Johnson would be a better person to ask I think, as he's had some
experience of teaching REBOL to kids. I'd think it would have quite
a few advantages though, in that it's a functional and extensible
language, but you can also treat it as an imperative language if you
want. There's objects too, so it could be used for teaching
object-oriented programming, but once again, you're not forced to
write object-oriented code. Plus there's dialects, so you could use
it to teach not only programming, but how to create programming
languages as well, which would also teach there's different ways a
programming language can be structured. And the total control you
have over View, (and I mean View, not VID), would be I think great
for teaching GUI design.
The downside would be the lack of documentation, (especially for
View), plus the lack of experienced REBOL programmers to teach the
language. Not a good look when the teacher doesn't know the answer
to a question and hasn't the resources to find it.
--
Carl Read
[38/44] from: greggirwin:mindspring at: 25-Sep-2002 16:53
Hi Dick,
Hopefully I won't just add more confusion here...
<< 10 + 10
means something to the Rebol interpretation process, but
10+10 does not have the same meaning, yet you say it can be
given different meaning. Are you implying that the expected operands
and the attributes of the operands to a built-in primitive function can be
respecified? Or are you saying "10+10" can be given new meaning as if
though a user-defined function? Help here please? >>
If we take the numbers out of the equation :) to avoid syntactical issues,
you can do this (because + is a valid character in words):
>> a: 1
== 1
>> b: 2
== 2
>> a + b
== 3
>> a+b: 4
== 4
>> a+b
== 4
So, "a+b" is not the same as "a + b". Now, you could also change the
operation of +, like this:
>> set '+ :*
>> 1 + 3
== 3
But, AFAIK, you can't alter the operands that an operator operates upon. :)
--Gregg
[39/44] from: g:santilli:tiscalinet:it at: 26-Sep-2002 1:10
Hi Romano,
On Wednesday, September 25, 2002, 8:36:43 PM, you wrote:
RPT> This is true only if the standard function Load has been called on the
RPT> original string, but Rebol does not require it:
Of course. :-) But then, any language can be anything, as long as
you read the text with your own parser. ;-)
Regards,
Gabriele.
--
Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer
Amigan -- AGI L'Aquila -- REB: http://web.tiscali.it/rebol/index.r
[40/44] from: g:santilli:tiscalinet:it at: 26-Sep-2002 1:22
Hi Dick,
On Thursday, September 26, 2002, 2:30:45 AM, you wrote:
run> 10 + 10
run> means something to the Rebol interpretation process, but
run> 10+10 does not have the same meaning, yet you say it can be
>> length? [a + b]
== 3
>> length? [a+b]
== 1
>> a+b: func [x] [print x]
>> a+b "hello"
hello
REBOL needs spaces to separate words.
>> foreach value [a + b] [print type? value]
word
word
word
You just have three words. REBOL does not make any assumption on
their meaning, like other languages do.
>> foreach value [print (a + b)] [print type? :value]
word
paren
>> foreach value second [print (a + b)] [print type? :value]
word
word
word
This shows what I was saying in the last message.
Now, you do whatever you wanted with that block of values, even
interpreting it with your own interpreter. Or, you could give
those words a meaning different from the usual one (like Ladislav
did in his message) and let the REBOL interpreter evaluate it.
Still, you can't say that that block block will "print the sum of
a and b on screen" unless you know the context in which the
expression
is "evaluated". (We're already making assumptions,
when we talk about "expressions" and "evaluation"...)
Regards,
Gabriele.
--
Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer
Amigan -- AGI L'Aquila -- REB: http://web.tiscali.it/rebol/index.r
[41/44] from: rotenca:telvia:it at: 26-Sep-2002 14:37
Hi Gabriele,
> RPT> This is true only if the standard function Load has been called on the
> RPT> original string, but Rebol does not require it:
>
> Of course. :-) But then, any language can be anything, as long as
> you read the text with your own parser. ;-)
Again, i'm not so sure. :-)
The difference between Rebol and ARexx, for example, is that in the latter
your parser must output a string which follow the ARexx syntax rules.
In Rebol my parser can directly create Rebol datatypes with the 'to function,
by-passing any Load syntax rule.
From this point of view, Load syntax is only the syntax of a dialect (the
bootstrap dialect).
The "true" Rebol language is made of blocks and datatypes not of chars in
string, so I can bypass almost all syntax rules about sequences of chars. The
only syntax limits are that of the 'to function, which are very relaxed and
are about datatypes and not about syntactic sequences of types.
Every code in a string is only a dialect which must be translated (compiled)
in the true interpreted Rebol language by a function like Load. Final user
always works on string dialects, the interpreter only understand the language
made of blocks and datatypes.
What we believe to be the Rebol language is only one of many possible
serializations. String sequence is a layer over the true rebol code, it can be
changed without changing the rebol internal syntax (block and datatypes). The
existence of the 'to function and of datatypes like set-word or func makes all
the Load work only a conventional work (it only calls 'parse and 'to to
emulate the human language).
---
Ciao
Romano
word: is not a set-word
[42/44] from: joel:neely:fedex at: 26-Sep-2002 13:14
Hi, Gregg, et al,
Yet another variation, just for fun, and a profound philosophical
comment... ;-)
Gregg Irwin wrote:
> Hi Dick,
> Hopefully I won't just add more confusion here...
<<quoted lines omitted: 21>>
> But, AFAIK, you can't alter the operands that an operator
> operates upon. :)
Depends on your definition of "alter"...
>> a: func [:op 'val] [set val do [op get val get val]]
>> b: 3
== 3
>> a + b
== 6
>> b
== 6
>>
A long time ago I heard someone say "FORTH is not a programming
language; it is a programming language construction kit!"
Despite differences in notation and internal representation, the
REBOL facility for dailecting, and the absence of distinction
between "data" and "code" make me think that the same statement
could be made of REBOL.
Of course, I remember the saying,
I've only met one self-made man, and he should have sued
the manufacturer for malpractice!
;-)
-jn-
[43/44] from: reffy:ulrich at: 26-Sep-2002 19:55
You guys are titillatingly fun ...
[44/44] from: lmecir:mbox:vol:cz at: 27-Sep-2002 17:42
Hi Pat,
this is a matter of personal preference. I always use the TO function.
(speed, generality)
Speaking about personal preferences: I am eliminatig the usage of functions
with unevaluated arguments and I suggest everyone to do that (see my Rep for
the reasons). The only reason I used them in my example is, that they change
the evaluation order in an unexpected way, which is normally a bad thing
(IMO - this is another point where my POV differs from Tim Peters').
----- Original Message -----
From: "pat665"
Hi Ladislav,
Could you explain a bit your code ? especially this line
print: func ['x] [reduce ['print to paren! x]]
Why is it not
print: func ['x] [reduce ['print to-paren x]]
Ciao
Patrick
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted