Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

Where are the dialects?

 [1/10] from: brett::codeconscious::com at: 10-Jul-2001 18:38


One of the strengths of Rebol is the support for the creation of mini-languages, or more fundamentally the fact that a block is an unevaluated store of data that can be interpreted in different ways for different contexts. My frustration with myself is that I've not been able to capitalise on these qualities of the language as much as I should have (probably too much other coding experience constrains the mind). The thing is though, I haven't seen a lot of examples on the list either. Obviously those at RT are switched on to it (Vid, make-doc, Zork like game by Jeff). I'd be grateful if people could share any insights, breakthroughs, applications, whatever on this topic. I need help to get my mind onto the possibilities of Rebol rather than *just* using it as a programming language. :) Regards, Brett

 [2/10] from: fsievert:uos at: 10-Jul-2001 12:02


I implemented a lego-dialect. You can control a Lego-Cybermaster Robot, and write and download programs on it. http://proton.cl-ki.uni-osnabrueck.de/REBOL/lego.r You can have a look at math-do.r at http://proton.cl-ki.uni-osnabrueck.de/REBOL/math-do.r Which shows, how to use my parser-object (Observer-Model) for implementing dialects. My irc-protocol uses a dialect to produce irc-messages http://proton.cl-ki.uni-osnabrueck.de/REBOL/irc-protocol.r REBlog is a prolog-dialect for REBOL http://proton.cl-ki.uni-osnabrueck.de/REBOL/reblog.r (new version comming soon, i hope :) CU, Frank

 [3/10] from: brett:codeconscious at: 10-Jul-2001 21:05


That's excellent Frank. I confess it will take me a little while to understand what you have done. Any reflections on the process having completed these? Brett.

 [4/10] from: joel:neely:fedex at: 10-Jul-2001 10:18


Hi, Brett, Brett Handley wrote:
> One of the strengths of Rebol is the support for the creation > of mini-languages, or more fundamentally the fact that a block
<<quoted lines omitted: 5>>
> get my mind onto the possibilities of Rebol rather than *just* > using it as a programming language. :)
No grandiose claims here (TMTOWTDI), but you might find the GENERATE-DATA dialect article useful. It can be found at http://www.rebolforces.com/zine/rzine-1-02.html#sect7. HTH! -jn- -- My hero, zero. Such a funny little hero, But till you came along, we counted on our fingers and toes. -- Schoolhouse Rock (1973) joelDOTneelyATfedexDOTcom

 [5/10] from: brett:codeconscious at: 11-Jul-2001 10:11


Thanks Joel !
> No grandiose claims here (TMTOWTDI), but you might find the > GENERATE-DATA dialect article useful. It can be found at
Like I asked Frank, having completed the dialect do you have any reflections on the process? BTW, What does "TMTOWTDI" mean - this is one dialect I cannot fathom. Brett.

 [6/10] from: joel:neely:fedex at: 10-Jul-2001 14:51


Brett Handley wrote:
> Thanks Joel ! > > > No grandiose claims here (TMTOWTDI), but you might find > > the GENERATE-DATA dialect article useful... > > Like I asked Frank, having completed the dialect do you > have any reflections on the process? >
PRO: - It's very nice to be able quickly to craft a mini- language for a specific problem domain. - The effectiveness of such a mini-language depends on having a "critical mass" of processes that are enough alike to make extracting the engine worthwhile. CON: - Deciding on the syntax of the mini-language can be the hardest part (I punted on this and stayed at the "assembler" level rather than trying to create an entire high-level language). - The classic trade-off between generality and speed; a custom-crafted solution is usually faster, but also more work to maintain/extend; a general solution is more flexible but not as fast. - The biggest danger of becoming too context-dependent IMHO is the potential confusion from overloading the terms that have different meanings inside the dialect than outside, and from having unmet expectations set up by the choice of common terms with everyday "baggage". REBOL certainly has the chops to make dialecting a more feasible practice than most languages. (Ever tried to use lex/yacc with TLTMNBN?)
> BTW, What does "TMTOWTDI" mean - this is one dialect I > cannot fathom. >
(T)here's (M)ore (T)han (O)ne (W)ay (T)o (D)o (I)t -- it's a well-known camel utterance (camel being the mascot of Perl ;-) -jn- --------------------------------------------------------------- There are two types of science: physics and stamp collecting! -- Sir Arthur Eddington joel-dot-neely-at-fedex-dot-com

 [7/10] from: fsievert:uos at: 11-Jul-2001 8:29


> Any reflections on the process having completed these?
Yes. One interesting point: When I started working on the lego-protocol, i just wanted to do something like "motor left on" etc. to control the robot directly. A non-dialecting sollution might look like: lego/motors/left/power 10 lego/motors/left/start But I decidet for dialecing: insert lego [motor left power 10 start] But after a while I wanted to extend the protocol to download tasks that run on the robot itself. Now I was able to allow: insert lego [ task 0 [ motor left power 10 start ..... ] ] And, of course, you have variables, too. This would look ugly if there were no dialecting. The reason is that it is no longer commands, what I write down, but data. Method-Invocations are more like commands, which are evaluated at invocation-time. Also they are often used to represent data-structures. (Like building a user-interface with java-awt). Dialecting allowes it to write down data more elegant and more explicit. CU, Frank

 [8/10] from: brett:codeconscious at: 11-Jul-2001 18:30


Thank you Joel and Frank thank for you scripts and comments. I hope that there are more responses from the list, I think is an area of Rebol that is underdeveloped for many (me included). It would be great also, to see some discussions on the list on how to approach a problem when dialecting is the tool for solving it. What to think about, how to structure the grammar. Etc. Thanks again. Brett.

 [9/10] from: allenk:powerup:au at: 11-Jul-2001 22:22


Brett, Ingo runs through the process of creating his TUI dialect http://www.rebolforces.com/articles/tui-dialect.html For me the simplest example of a creating a dialect was the one Carl did for the Dr. Dobbs (July 2000 Distributed Computing) issue. Sadly that issue isn't available on-line, but the accompanying code is at http://www.ddj.com/ftp/2000/2000_07/rebol.txt Cheers, Allen K

 [10/10] from: dvydra2:yaho:o at: 14-Jul-2001 11:01


Brett, At my last job I've used rebol to implement a translator from a REBOL dialect to XML. This can be useful for systems that take XML input, but you want to to create scripts in a more english-like sysntax. XML: <create type='Customer' is='C1'> <field name='name'>AT&T</field> <field name='address'>Somewhere in Jersey</field> <field name='salesrep'> <lookup type='SalesRepresentative'> <key name='country'>US</key> <key name='state-or-province'>NJ</key> </lookup> </field> </create> REBOL Dialect: create Customer as C1 name = "AT&T" address = "Somewhere in Jersey" salesrep = [SalesRepresentative with country = "US" and state = "NJ"] Regards, David --- Brett Handley <[brett--codeconscious--com]> wrote:
> One of the strengths of Rebol is the support for the > creation of
<<quoted lines omitted: 27>>
> [rebol-request--rebol--com] with "unsubscribe" in the > subject, without the quotes.
===== David Vydra www.vydra.net david (at) vydra (dot) net

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted