Rebol Talk Forum  |  Getting Started  |  Ask the Guru! (Moderator: Carl)  |  Topic: Rebol a stack-based concatenative polish notation language?
Pages: [1] Print
Author Topic: Rebol a stack-based concatenative polish notation language?  (Read 794 times)
lismoreboy
Newbie
*
Offline Offline

Posts: 2


View Profile
Rebol a stack-based concatenative polish notation language?
« on: January 03, 2008, 11:30:37 AM »

I have been using Rebol as a sysadmin language for XP systems. It certainly is a hard act to follow. Makes complicated things easy!

I have been trying to get my head around the design of the language.  Am I right in saying that Rebol is a stack-based concatenative polish notation language?  Sort of like a back to front Factor (http://factorcode.org)?
Logged
Gregg
Newbie
*
Offline Offline

Posts: 26


View Profile WWW
Re: Rebol a stack-based concatenative polish notation language?
« Reply #1 on: January 06, 2008, 03:18:13 PM »

Factor is pretty much Forth, IIRC. REBOL's heritage comes from Lisp, Forth, and Logo, so there will be some similarities, but it's not the same. Function evaluation in REBOL is free ranging--you don't know how many args a func takes until you evaluate it in context. It also uses definitional scoping.

In programming terms, I think of it more as a functional language, with a few twists (like special evaluation precedence for ops). In general terms, think of everything as data, and sometimes that data gets evaluated.
Logged
btiffin
Jr. Member
**
Offline Offline

Posts: 58


View Profile
Re: Rebol a stack-based concatenative polish notation language?
« Reply #2 on: January 06, 2008, 09:02:19 PM »

Please take this response as if you were talking to someone that doesn't really know but likes to try.  Short answer; no.  Smiley

Gregg's definition may be as close as you can get.  REBOL doesn't really seem to fit any of the common pigeon holes. The way REBOL evaluates expressions is more based on satisfying arity needs, and as Gregg points out, those needs can only be determined at the time of the contextual evaluation.

There is a stack, but from a user perspective only the top is accessible, and by that I mean, (normally) only the last result is returned from multiple sequential expressions.  So calling it stack-based is somewhat of a misnomer.

REBOL can be concatenative, but once again it is not. For one; atomic operations do not have the monadic one function one result elementary decomposition.  e.g. The print function doesn't return anything, (well it returns unset!) but these nit pickies make describing REBOL as concatenative another misnomer.

REBOL is capable of polish notation, but that is more of a side effect of satisfying the arity needs.  2 + 3  works,  + 2 3 works  2 3 + does not.   Under REBOL release 2,  + / 2 3 4 works as (2 / 3) + 4 but REBOL release 3 will not allow for such syntax.  The expression scanner is getting simpler (in terms of end-user) evaluation with REBOL 3.  So once again, polish notation is a misnomer.

See http://www.rebol.com/faq.html#056  for a few more details, but please note this FAQ is REBOL release 2.  Things will change a little bit with REBOL 3.

Again, please note.  I'm never completely sure about REBOL and learn something new everyday, including rethinking entire belief systems from time to time.  Smiley

Cheers,
Brian
Logged
btiffin
Jr. Member
**
Offline Offline

Posts: 58


View Profile
Re: Rebol a stack-based concatenative polish notation language?
« Reply #3 on: January 08, 2008, 10:39:43 AM »

This topic has had me pondering the issue for a few days.  I think that one of the  best ways to describe REBOL is the acronym itself.

A Relative Expression Based Object Language.

Cheers,
Brian

P.S.  That definition still comes up short.  You could go overboard and say something like A multi-platform, datatype rich, reflective, messaging, network aware, R.E.B.O.L. with graphics.  And that would still be incomplete.  So perhaps add "buzz-word compliant".  Smiley
Logged
Pages: [1] Print 
Rebol Talk Forum  |  Getting Started  |  Ask the Guru! (Moderator: Carl)  |  Topic: Rebol a stack-based concatenative polish notation language?
Jump to:  

  
Quick Search...

Advanced search
  
Welcome, Guest. Please login or register.
Did you miss your activation email?
November 20, 2008, 10:22:29 AM
Username: Password: Session Length:
  

News: 01-09-08

Alpha version of REBOL 3 has been released!


  
2287 Posts in 596 Topics by 3720 Members
Latest Member: kallUlcerma

  Rebol Talk Forum | Powered by SMF 1.0.9.
© 2001-2005, Lewis Media. All Rights Reserved.

RT design by Defiant Pc