IS REBOL object oriented?
[1/15] from: belkasri:1stlegal at: 4-Jun-2002 12:42
Hi all, I admit I don't know a lot about REBOL, but I need to access this platform for my boss. My first impression was that REBOL is an Internet Operating System that uses a script (similar to PEARL, or CSHELL) to do some shell programming! is this impression correct? The marketing guy told my boss that REBOL is object oriented programming...I didn't see anything like that by looking to the sample programs that come with the REBOL trial version...what's up with that? --AB
[2/15] from: anton:lexicon at: 5-Jun-2002 5:03
Rebol appears not to use objects on first glance. And that's a good thing! :) But there are plenty of objects. Lots of rebol's settings, functions and default values are accessible in the 'system object. Try this in the console: help system It shows you the sub-objects. Now you know enough to do: help system/console That is a path that access a sub-object of system. And you can continue this way. That, I think is the principal feature of OO design. Information hiding. It's not really a "trial version". There is no time limit on the free rebol interpreters, just in the pay versions you get some extra features. But that could be just a difference of wording. Regards, Anton.
[3/15] from: belkasri:1stlegal at: 4-Jun-2002 14:35
Anton, 1- Can I create my own custom object? 2- Can I run my legacy application written in C, VC++, VB in the REBOL shell? --Abdel.
[4/15] from: greggirwin:mindspring at: 4-Jun-2002 13:18
Hi Abdel, << My first impression was that REBOL is an Internet Operating System that uses a script (similar to PEARL, or CSHELL) to do some shell programming! is this impression correct? >> Yes and no. :) REBOL is a messaging language, which is as easy to use as a scripting language, but incredibly powerful as well. REBOL/View adds excellent GUI capabilities to the Core language and REBOL/IOS adds a complete collaborative infrastructure (client and server pieces) on top of that. << The marketing guy told my boss that REBOL is object oriented programming...I didn't see anything like that by looking to the sample programs that come with the REBOL trial version...what's up with that? >> You can do OOP in REBOL, but the underlying implementation is different than how OOP works in many other languages (e.g. C++, Java). Objects are more like data structures that can contain functions as well as data. Ojbects are a very handy way to manage scope. I.e. they can be used to provide namespaces. REBOL is quite different from most languages. It's similar to LISP, FORTH, and LOGO in ways, and is very human friendly (IMHO). HTH! --Gregg
[5/15] from: g:santilli:tiscalinet:it at: 4-Jun-2002 22:48
Hi Abdel, On Tuesday, June 04, 2002, 7:42:16 PM, you wrote: AB> The marketing guy told my boss that REBOL is object oriented programming...I AB> didn't see anything like that by looking to the sample programs that come AB> with the REBOL trial version...what's up with that? If you mean class-based OO programming, then no, it's not (well, by default :). However, that does not mean you can't write programs with the OO paradigm. Also, it has to be noted that OOP is not certainly the only one and best design and programming paradigm. :) Regards, Gabriele. -- Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer Amigan -- AGI L'Aquila -- REB: http://web.tiscali.it/rebol/index.r
[6/15] from: greggirwin:mindspring at: 4-Jun-2002 15:20
Hi Abdel, << 1- Can I create my own custom object? >> Yes. The Core PDF docs cover this pretty well. Example: obj: make object! <your-object-spec-here> << 2- Can I run my legacy application written in C, VC++, VB in the REBOL shell? >> With View/Pro or /Command, yes. You can use CALL to run external apps. Under Windows, you can also call into DLLs so you can use ShellExecute for example. Hopefully, that will be added to the free version of Core in the future as well. --Gregg
[7/15] from: chrismorency:videotron:ca at: 4-Jun-2002 19:38
Hi, Some tips regarding OOP under Rebol... - Rebol will let you design objects containing variables and functions. - Rebol has strong datatype (ie not everything is an object !) - Rebol OOP is more like Self than Smalltalk, Java or C++. They are no classes, every object is an instance. Rebol will let you design objects based on another object (not class) through cloning and copying instead of inheritence. All variables and functions are copied. Rebol object creation will copy functions source. So if you have 1000 instances of an object based on another object instance (design to be a template object or pseudo-class), there will be 1000 copies of each functions ! AFAIK it can consume a lot of memory. Rebol's objects are self aware through self... note: it is possible to design a library that will implement the object/class paradigm... I did some preliminary work on the subject. However, IMHO there seems to have some kind of lack of interest for OOP in the Rebol's community. I really wish there was more interest in OOP under Rebol. Rebol is a very powerful messaging, scripting language... OOP is possible but it is not it's force...
>From a person who daily works with Smalltalk.
[8/15] from: nitsch-lists:netcologne at: 5-Jun-2002 4:27
Am Dienstag, 4. Juni 2002 19:42 schrieb Abdel Belkasri:
> Hi all, > > I admit I don't know a lot about REBOL, but I need to access this > platform for my boss. > > My first impression was that REBOL is an Internet Operating System that > uses a script (similar to PEARL, or CSHELL) to do some shell programming! > is this impression correct? >
AFAIK yes. well, i have an IOS-evaluation-account, and start reading. IOS is like an everywhere mirrored file-system. messages are done by changing a file, telling ios its changed. on the other side tell ios to watch a file, reread on change. then ios mirrors. if the other side is offline, it gets the file next time when connecting. thats enough to do Reblets for instant messengers. with log. for edited normal files the dektop-icon turns red when changed locally. one has to re-publish after changes by hand when thinking "finished". theres a version-control for undo too. for collaboration partners talk like "hmm, ok, i change it" - "ok, uploaded" with the messenger and can see the same file a moment later. files are files, so they are easily with external tools. like listing all files which are changed locally. of course scripts can run on the server too, for coordination. but while each user can script its client, server-scripts need admin.rights.
> The marketing guy told my boss that REBOL is object oriented > programming...I didn't see anything like that by looking to the sample > programs that come with the REBOL trial version...what's up with that? >
hmm. rebol and oops.. marketing needs short descriptions sometimes :) IMHO, well, yes, oops works pretty well in rebol. so well, one seldom sees it. think of a script itself as the main-class. the pre-written objects are well choosen and well reusable. most of the time one does not need to define big extra classes. also, there are dialects. they are more the rebol-way. conventional oops declares related objects with methods. and tells you how to use them. Container, addListener, Event, .. rebol uses a compiler-compiler. "parse". its great. writing a special language can be done in some lines. they create and connect objects for you. and can always include/move real rebol. for key featureare dialects like "layout" view layout[title "helloworld" button "quit" [alert "bye" quit] ] like scripting a gui-builder. returns a very complex object. the rebol-code [alert "bye" quit] is plugged somewhere deep in the appropriate place. view it with "view". press the button. writing dialects is comparable in size to the oops declarations. using them much simpler. but access to the metal (screen-faces) if needed. parse itself is inbuild, but the usage is like a dialect. a little language. parsers are short because they parse rebol-blocks. these are pre-parsed source. simple stuff is already identified and put in an object. like %my-file or dates, 127.0.0.1, http://somewhere or [me--my-server--org] . so the basic syntax of the parser is inbuild. and standardized. every little language understands them. including rebol-code, which can be seen (and handled) as a dialect. a pretty complex one, compared to the others. nearly as complex as programming-languages ;) this basic syntax is used too to store data. similar to xml. which you write to a file. telling ios its changed. somewhere someone will listen. sooner or later. :)
[9/15] from: al:bri:xtra at: 5-Jun-2002 15:03
> Also, it has to be noted that OOP is not certainly the only one and
best design and programming paradigm. :) A dialecting approach is much easier after all. Andrew Martin Speaking in many Rebolios tongues... ICQ: 26227169 http://valley.150m.com/
[10/15] from: steve:shireman:semaxwireless at: 4-Jun-2002 23:39
Abdel, Rebol is both a language, and with /IOS is a complete application framework for distributed Reblet creation. The framwork is robust, so it is hard to crash the Rebol IOS when it runs. In Rebol, you can create Styles, which are more functional than traditional Objects. These Styles can be used by Reblets in a natural language way. It takes very small Reblets to do distributed tasks, thanks to powerful, natural datatypes built in (like time, money, urls, emails, files, etc. Just as CLOS is an object system built out of LISP, you can build an object system (and objects are provided by Rebol) but that uses only a subset of the power. I have found that Rebol is the first leap ahead of the dynamic nature of a smalltalk environment, and the syntax is more natural language and logical than smalltalk. I had used C++ as early as 1989 for embedded projects, Java in 1995, but have never seen anything as exciting as Rebol in my career. I do not think there is any other technology out there to compete with it. The more I dig into it, the more I see the beauty of its design. Whenever you think of a better way to design your script, it gets smaller, and you reallze that the way you think it should be done is the way it has been done. There is really nothing else to compare it to. Respectfully submitted, Steve Shireman Abdel Belkasri wrote:
[11/15] from: rpgwriter:yaho:o at: 5-Jun-2002 13:14
--- Abdel Belkasri <[belkasri--1stlegal--com]> wrote:
> Anton, > > 1- Can I create my own custom object?
Sure. foo: make object! [ . . . ] That'll create an object. It works much like an object in a "real" OO language -- it can have data members, methods, etc. The big thing it misses compared to, say, C++ is you can't overload operators; it also only features single inheritance, but that's not so uncommon.
> 2- Can I run my legacy application written in C, > VC++, VB in the REBOL shell?
AFAIK, yes, using /Pro or /Command, you can run arbitrary "native" programs from REBOL, either from a script or the console. With /Core or /View, no, you cannot.
[12/15] from: nitsch-lists:netcologne at: 6-Jun-2002 0:05
Am Mittwoch, 5. Juni 2002 22:14 schrieb Christopher Dicely:
> --- Abdel Belkasri <[belkasri--1stlegal--com]> wrote: > > Anton,
<<quoted lines omitted: 12>>> it also only features single inheritance, but that's > not so uncommon.
===overloading if one codes like /view does, it works. that means implement vtables by hand (easy), and call the super-method by name. like (pseudocode) my-class: make super-class[ vtable: make vtable[ a-nice-tool: func[self arg1 arg2][ super-class/a-nice-tool self arg1 arg2 my-stuff self/var1 .. ] ] var1: var2: none ] my-object: make my-class[init-stuff] my-object/vtable/a-nice-tool my-object ;pass self by hand looks a bit ugly, but there are some kinds of semantic sugar possible. mostly becuase it hides quick in dialects :) ===multiple inheritance proto1: context[a1: b1: none] proto2: context[a2: b2: none] my-object: make make proto1 proto2 [my-var: none] probe my-object make object! [ a1: none b1: none a2: none b2: none my-var: none ]
> > 2- Can I run my legacy application written in C, > > VC++, VB in the REBOL shell? > > AFAIK, yes, using /Pro or /Command, you can run > arbitrary "native" programs from REBOL, either from > a script or the console. > > With /Core or /View, no, you cannot. >
> > __________________________________________________ > Do You Yahoo!? > Yahoo! - Official partner of 2002 FIFA World Cup > http://fifaworldcup.yahoo.com
no, i do netcologne.. ;)
[13/15] from: rpgwriter:yaho:o at: 5-Jun-2002 17:01
--- Volker Nitsch <[nitsch-lists--netcologne--de]> wrote:
> Am Mittwoch, 5. Juni 2002 22:14 schrieb Christopher > Dicely:
<<quoted lines omitted: 41>>> semantic sugar possible. > mostly becuase it hides quick in dialects :)
Right, and you can use other tricks to do it indirectly, too, I'm sure, but not as directly as the operator/function overloading in, say, C++.
> ===multiple inheritance > proto1: context[a1: b1: none]
<<quoted lines omitted: 8>>> my-var: none > ]
Huh. Never thought of that. Nifty-cool, though.
[14/15] from: nitsch-lists:netcologne at: 6-Jun-2002 5:34
Am Donnerstag, 6. Juni 2002 02:01 schrieb Christopher Dicely:
> --- Volker Nitsch <[nitsch-lists--netcologne--de]> wrote: > > Am Mittwoch, 5. Juni 2002 22:14 schrieb Christopher
<<quoted lines omitted: 54>>> indirectly, too, I'm sure, but not as directly as the > operator/function overloading in, say, C++.
this is no trick, its a pattern ;) c++ methods are hardwired. one can overload them, yes. but not redefine them dynamic. so use one class for data and another class with the method and switch the reference. modern frameworks use a handmade "vtable", exactly this way. like squeak/smalltalk with morph/player, java with one-method/no data listener classes, c++ with, well i forgot it. overloading is deprecated in ComponentPascal (heavy skilled unknown framework-builders), they choose the [ super-class/a-nice-tool self arg1 arg2 ] style. so why should rebol implement a more and more deprecated feature? ;)
[15/15] from: rpgwriter:yaho:o at: 6-Jun-2002 15:09
--- Volker Nitsch <[nitsch-lists--netcologne--de]> wrote:
> so why should rebol implement a more and more > deprecated feature? ;)
I wasn't saying it should, just that it might be a difference that someone whose expectations were formed by C++.
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted