r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[I'm new] Ask any question, and a helpful person will try to answer.

Maarten
3-Jun-2007
[465x3]
god -> good
The fact that it's one small yet complete executable and rebol.org 
has scripts for things like XML etc. ... I have seen REBOL scale 
from netowrk management tools to e-bank prototypes to ...
Lisp let's you think thoughts previously not thought possible. REBOL 
makes you use them.

 In a way it may wreck a programmers view of the world because a lot 
 of other technologies may become.... annoying
DanielSz
3-Jun-2007
[468x10]
Rebol may become your most useful asset in your toolbox, because 
it's expressiveness and its ease of use, but it will not help you 
understand computer science, precisely because it is so intuitive. 
Anyone trying to grasp the fundamentals of programming will have 
to delve in other languages and paradigms. Also, Rebol didn't spring 
from the void. It is grounded in what Carl knows and he knows a lot. 
I think the link with Lisp is obvious. Parsing comes from the BNF 
grammar. I greatly benefited from studying S-expressions. Look at 
how Lua implements associative arrays (tables), it is very instructive, 
very powerful, they are better than hashes in Rebol, (Carl has expressed 
interest in his blog to revise them). Another thing Lua got right 
is size, it is smaller than Rebol. Lua can be ported more easily, 
it is available on the palm platform for years now. Rebol still promises 
this. Learn Rebol, but don't stop with Rebol.
The integrated internet protocols in Rebol is a great strenth. S-
S-expressions shows that code is data, and data is code. Blocks are 
conceptually the equivalent in rebol. I don't know if they are on 
par, though. It's an interesting topic.
OO in Rebol is prototype based, like in javascript, actionscript, 
lua. Unlike Smalltalk or Java, which are class based.
The guru in terms of explaining programming concepts in Rebol is 
Ladislav Mecir. His articles are a must.
Carl said in his rebol 3.0 front line blog: In REBOL 3.0, closure 
functions are implemented with the closure! datatype and a new mezzanine 
function called closure. That is significant in terms of programming 
techniques.   Ladislav shows how you can achieve them in Rebol 2. 
http://www.fm.vslib.cz/~ladislav/rebol/contexts.html
The thing is, you don't have to understand advanced concepts in order 
to use Rebol. Anyone with some willingness is ready to roll some 
Rebol code. That is great, and if one continues to learn on the side, 
one wins on all the fronts.
In the preface to Structure and Interpretation of Computer Programs, 
Abelson and Sussman state 

“First, we want to establish the idea that a computer language is 
not just a way of getting a computer to perform operations but rather 
that it is a novel formal medium for expressing ideas about methodology. 
Thus, programs must be written for people to read, and only incidentally 
for machines to execute.”
Lots of the fun with Rebol comes from its readability. To be fair, 
lots of people testify the same with Ruby.
Sorry for my ramblings. I'm done now.
Chris
3-Jun-2007
[478x2]
I'm intrigued by Ruby's ability to minimize statements (for example 
here -- http://www.softiesonrails.com/2007/5/22/ruby-101-clear-code
)  There does seem to be cases where Ruby can be more concise/expressive 
than Rebol.
Perhaps that should be concise -- the expressive I guess is the ability 
to set the condition after the action, in a way that is easier for 
our brains to parse.  Of course, the core of Rebol's expressiveness 
is that the language is built on top of a consistent, robust vocubulary 
(datatypes), though it can take time to learn how to construct the 
most expressive statements.  Ruby is not instinctively reflective 
(is this the right term)?  Now I'm rambling...
Oldes
3-Jun-2007
[480]
I still prefere:

shutter_clicked: does [while [camera.on? and camera.memory_available?][capture_image]]
DanielSz
3-Jun-2007
[481]
Nice article, shows how modifiers are used in Ruby, a fine language 
by all accounts. I suppose you would resort to the dialecting facilities 
of rebol to achieve similar constructions.
Chris
3-Jun-2007
[482]
(someone already posted that link in AltME, don't remember who, sorry)
Oldes
3-Jun-2007
[483]
using...

def go_crazy
    capture_image until @camera.memory_card_full?
end


...seems to be useless if you need to do more than just call one 
function.... but I don't know Ruby at all, so maybe I'm wrong
Chris
3-Jun-2007
[484x3]
Yes, but in this instance, it is easy to read.
In dialects, it is possible to order things as you wish.  In filtered-import.r, 
a rule can be followed by a condition message:

foo: integer! else "Not an integer!"


But that is limited to dialects.  In Rebol proper, you'd be limited 
to:

while [camera/memory-available?][capture-image]
or
until [capture-image camera/memory-full?]
until [capture-image camera/memory-full?] -- is an awkward construct.
Oldes
3-Jun-2007
[487x3]
REBOL: while [camera/memory-available?][capture-image]

RUBY:    def go_crazy capture_image until @camera.memory_card_full? 
end
I still prefere Rebol:)
and I don't know if you can write it all at one line in Ruby
Chris
3-Jun-2007
[490]
To be fair:

REBOL: while [camera/memory-available?][capture-image]
RUBY:     capture_image until @camera.memory_card_full?
Oldes
3-Jun-2007
[491]
ok.. that's true
Sunanda
3-Jun-2007
[492]
As Oldes says: it looks great until you need to change the action 
[capture_image] with something more complicated....Say two functions: 
What then in Ruby?
Chris
3-Jun-2007
[493x2]
Or:

REBOL: while [not camera/memory-card-full?][capture-image]
RUBY:   capture_image until @camera.memory_card_full?
I'll leave that to someone else (like I said, I'm intrigued -- I 
don't understand :)
Oldes
3-Jun-2007
[495]
The true is... thay have very nice looking pages:-(
Chris
3-Jun-2007
[496]
It seems Ruby is full of such shortcuts -- I'd love to know if they 
really are effective the larger an application becomes.  I've seen 
it written that RoR is reknowned for it's expressive approach to 
building web apps, but that expressiveness is lacking if you actually 
delve into the actual RoR application code.  I guess Rebol has its 
dark secrets when you e.g. are exploring the internals of the View 
system...
Sunanda
3-Jun-2007
[497]
Scalability/maintainabilty are an important issues.

Carl, in an early Zine article shows a way of shortening a REBOL 
assignment:
http://www.rebolforces.com/zine/rzine-1-02/#sect10.

Clever, but I was never convinced it added to maintainability -- 
what if additional processing was needed when settimg data to "active" 
?
Pekr
3-Jun-2007
[498]
What is so special in linked Ruby examples? It is just few variables/methods 
tested, just that those are named in enlgish like manner.
DanielSz
3-Jun-2007
[499]
From the article: The key is to know that keywords like return, while, 
if, unless, and until can be used as modifiers. This means that you 
put the conditional part after the keyword. Sounds silly, and sometimes 
it is. But sometimes it has a big payoff.
Chris
3-Jun-2007
[500]
Petr, it's all about expression, and expression is the key to leveraging 
any language, no?
Pekr
3-Jun-2007
[501]
Yes, but with dialects, you can be as free form as you wish ... well, 
mostly ... But of course that is different - you have to construct 
your grammar ...
Geomol
3-Jun-2007
[502x2]
What would it mean, if I in Rudy wrote:
func1 while cond1 func2 while cond2 func3 end

Would it be:
(func1 while cond1) func2 (while cond2 func 3 end)
or
func1 (while cond1 (func2 while cond2) func2 end)
or what?
*Ruby*
Anton
4-Jun-2007
[504x4]
In rebol I can make my own function to order the condition and action 
arguments how I want, but, as easy as this is,  I generally avoid 
this and just use Rebol's built-in control functions. This means 
that other users can understand what my code is doing without scraping 
around looking for the custom control flow function that I put somewhere. 
(I put myself in the "other user" category after a few weeks have 
passed since writing the code...)
So I gnash my teeth sometimes at the argument order in some functions, 
wishing for the order to be different, but it is a perfectionist 
restriction I'm putting on myself, really.
Oops, I should have read the article first. (post_comments unless 
@not_read_article?) 

Of course, in rebol, you can't put the action block before the condition 
unless it's in a dialect that allows that.
Ruby "unless" after the action, is better than Rebol "unless" before 
the action.
Unless

 afterwards is more natural and English-like, before is somewhat confusing.
Gabriele
4-Jun-2007
[508x3]
we could have do/unless [code] condition
but i'm not really sure of the advantage...
if it's just to be english-like, we can beat them any time with a 
simple dialect :)
Geomol
4-Jun-2007
[511x2]
I think, performance should win over expressiveness. I'm think, we 
don't have
action unless condition

in REBOL, because it'll cost in performance to check, if there is 
an 'unless' after the action. As it is now, the REBOL intepreter 
knows what to do most of the time. Operators are the exception of 
the rule.
It could be interesting to know, how much better performance would 
be, if REBOL didn't have infix operators. Carl probably did some 
tests.
Rebolek
4-Jun-2007
[513]
what is interesting here is, that infix operators are in fact faster 
in REBOL than prefix equivalents ('+ vs. 'add ...)
Gabriele
4-Jun-2007
[514]
i don't think performance would change a lot