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

My first script and an introduction

 [1/4] from: glenn::hometot::com at: 3-Jul-2004 21:33


Hi all! My name is Glenn M. Lewis, and I'm a language junkie. :-) Actually, I'm looking for a language that would assist in making it easier to write an application where the GUI stays responsive even when the underlying 'engines' might be working away at some large CPU-intensive task. Specifically, I write EDA CAD tools for a living at a major chip manufacturing company. I'm currently looking at Rebol, Erlang, Ocaml, and D... http://www.rebol.com/ http://www.erlang.org/ http://www.ocaml.org/ http://www.digitalmars.com/d/ I'm an old Amiga fan, so when I saw the name Carl Sassenrath on a book cover at Crown books, I didn't even care what was in the book... I immediately bought it. It was just a bonus that it had to do with a computer language. After my first read through the book, I think I just didn't get it. About six months later, I have a real problem to solve, and was starting to get serious about Erlang, and then when I tried out some examples, it heavily reminded me of Rebol, except that Erlang string handling is atrocious. Another one of my dilemmas, along with the responsive GUI, is that the language I choose must be able to create full-featured GUIs with all modern GUI features like dockable windows, high-level widgets, and OpenGL support. I'm having trouble finding something that meets all these needs. So I'm going back now and re-reading the Rebol Official Guide and am attempting to grok it. I went ahead and made my first stab at modifying a script... I took the 'words.r' script that came with Rebol and made 'mywords.r', which I'll attach below. Basically, all it does is add an index to the top so I can see all the words and quickly jump to the one I want. I must say that the indenting for Emacs' 'rebol-mode' is really pretty poor... maybe I have an old version. It says it was updated in 2001. OK, enough rambling. Anyone remember T3DLIB? :-) Here is my mywords.r... -- Glenn ============================================================================ REBOL [ Title: "REBOL Function Summary" Version: 2.0.1 Author: "Carl Sassenrath, modified by Glenn M. Lewis" Purpose: {Generates an HTML document of REBOL functions with leading index.} ] ;-- Build a list of all function words: word-list: make block! 300 vals: second system/words foreach word first system/words [ if any-function? first vals [append word-list word] vals: next vals ] sort word-list bind word-list 'system ;-- Generate the document: output: make string! 120000 emit: func [data] [repend output data] get-next: func ['series] [first back set series next get series] title: "REBOL Function Summary" emit [ {<HTML> <HEAD> <META HTTP-EQUIV="Content-Type" CONTENT="text/html;CHARSET=iso-8859-1"> <TITLE>} title {</TITLE> <STYLE TYPE="text/css"> BODY, P, TD, OL, UL { Font-Family: Arial, Helvetica, sans-serif; Font-Size: 10pt; } PRE, TT { Font-Family: "courier new", courier, monospace; Font-Size: 10pt; } HR {Color: black; Height: 3;} </STYLE> </HEAD> <BODY BGCOLOR="white"> <H2>}title{</H2> <BLOCKQUOTE><B>} Product: system/product <BR> Version: system/version <BR> Created: system/build/date <BR> Totals: length? word-list " functions from " length? first system/words " words" <BR> {</B></BLOCKQUOTE>} ] emit [ {<table cellspacing="10" width="100%"> <tr> <td valign="top"> } ] mycount: 1 mymax: / length? word-list 7 foreach word word-list [ name: word ; to get global binding emit [ {<a href="#}name{">}name{</a><br>} ] if > mycount mymax [ emit [ {</td><td valign="top">} ] mycount: 0 ] mycount: + mycount 1 ] emit [ {</td></tr></table>} ] ;-- Output the details for each function: foreach word word-list [ name: word ; to get global binding args: first get name ; function's arg list spec: third get name ; function's specification if loc: find args refinement! [args: copy/part args loc] emit [ <HR><P> <FONT SIZE="4">{<A NAME="}name{">}<B>name</B></A> " " <I>mold/only args</I></FONT> <BLOCKQUOTE> either string? spec/1 [get-next spec]["Undocumented function."] <P> ] ; Spec format: argument [types] "description" while [not empty? spec] [ if not block? arg: get-next spec [ if any [arg = /local number? arg] [break] types: if block? spec/1 [get-next spec] description: either string? spec/1 [get-next spec][""] emit pick [ <FONT COLOR="maroon"> <FONT COLOR="navy"> ] refinement? arg emit [ <B> mold :arg </B> </FONT> " - " description <I> " (" any [types "any value"] ")" </I><BR> ] ] ] emit [</BLOCKQUOTE><P> newline] ] emit {<P>&nbsp;<P>&nbsp;<P>&nbsp;<P>&nbsp;<P>&nbsp;<P>&nbsp;<P>&nbsp;} emit {<P>&nbsp;<P>&nbsp;<P>&nbsp;<P>&nbsp;<P>&nbsp;<P>&nbsp;<P>&nbsp;} emit {</BODY></HTML>} print {View mywords.html with your web browser.} write %mywords.html output if view? [browse %mywords.html]

 [2/4] from: antonr:lexicon at: 5-Jul-2004 3:24


Hello Glenn, I don't think you'll find dockable windows in Rebol any time soon. That would be not so simple to implement across all the platforms in a cross-platform manner. (I'd imagine you could find a way around that problem area and still get a highly usable interface.) High-level widgets - any in particular you need that you don't see available ? OpenGL support is there if you have external library access (via a licensed View/Pro, for example). So you have to spend some money on that currently. Anton.

 [3/4] from: moliad:aei:ca at: 4-Jul-2004 23:57


Hi, If you can wait a few days, I am in the process of releasing some docs for glayout. it is a superset of VID and allows much more modern ui handling. There is also a newer version of it comming out at the same time. Things like scroll panes and fully resizable windows are nothing short of free and completely automatic. The dialect is built over VID so its easy to use and pretty easy to extend for would be stylesheet creators. It also has better modal window handling for a preview of what glayout can do, try out the repack.r tool on rebol.org. do http://www.rebol.org/library/public/repack.r press on refresh within the package pane and then chose any one of them you can also see its file browser by clicking on the install dir "..." button. every window is resizable (even the event view log and file browser) I can't say when the site is going live, but I'm putting all coding efforts on the release. I will send a mail here when its all done. cheers! -MAx

 [4/4] from: greggirwin:mindspring at: 5-Jul-2004 11:31


GML> My name is Glenn M. Lewis, and I'm a language junkie. :-) Hi Glenn! Welcome to the list! GML> Actually, I'm looking for a language that would assist in making it easier GML> to write an application where the GUI stays responsive even when the GML> underlying 'engines' might be working away at some large CPU-intensive task. GML> Specifically, I write EDA CAD tools for a living at a major chip manufacturing GML> company. This is often an architectural thing. If you put a bunch of code in the action/event-handler for a face/control, it may halt UI event processing while it works. This affects many GUI tools. If you need things to stay responsive, the best way I've found is to break up the large tasks into little chunks and have an internal FSM/event-queue system that is used to dispatch UI events and process chunks when there's nothing else going on. Depending on what you're doing, you may be able to spawn the big tasks as separate processes or use threads (more complexity that way though). REBOL doesn't currently support threads, but you could put that logic in a DLL that allows you to use them. GML> Another one of my dilemmas, along with the responsive GUI, is that GML> the language I choose must be able to create full-featured GUIs with all GML> modern GUI features like dockable windows, high-level widgets, and OpenGL GML> support. I'm having trouble finding something that meets all these needs. That can be tough. The more features you need, the larger and more complex the tools become. Cal Dixon and Cyphre have built demos integrating OpenGL with REBOL; Cyphre, Max, Anton, Brett, Etienne, and others have built some higher level widgets than what VID provides (tree lists, table/grid, menu, tab-panels, etc.). I did a little experiment with layouts that stay docked together, so that's doable as well. REBOL doesn't have a large set of support tools for building bigger applications at this point--not really it's main goal--but it can certainly be done. The foundation it provides is very flexible, so it's just a question of whether the tools it does provide are enough for you to build on, or if you want a tool that already has everything you need in it. Of the tools you listed, I don't know that any of them will. Best of luck, and happy REBOLing! -- Gregg