From: rj@eli.wariat.org (Robert J. Brown) Subject: Re: Spytrace package for PFE available for beta Date: 01 Apr 1996 17:53:54 GMT Message-ID: References: <65m5d-ZM7QB@business.forth-ev.de> In-reply-to: All@business.forth-ev.de's message of 29 Mar 1996 22:56:00 +0100 >>>>> "Wolfgang" == Wolfgang Allinger writes: Wolfgang> On 29 Mar 96 in article Wolfgang> Wolfgang> (Robert J. Brown) wrote: >> I wrote a spy tracing package for LMI PC/FORTH+ about 5 years >> ago, and later proted it to LMI 386-UR/Forth. Wolfgang> snipp--- Wolfgang> Hallo Bob Wolfgang> how can I get the spy tracer for LMI forthes? It sounds Wolfgang> very interesting! I guess I could put them in my anon ftp area. Which LMI Forth are you using? Wolfgang> Thanks from Wolfgang Wolfgang> -- FORTHing @ work Cheap Fast Good ...pick any two of Wolfgang> them Dipl.-Ing. Wolfgang Allinger Brander Weg 6 Wolfgang> Voice/FAX [+49] [0] 212 / 66 8 11 D-42699 SOLINGEN Wolfgang> eMail: all@business.forth-ev.de GERMANY ## CrossPoint Wolfgang> v3.02 R ## -- ----------- "... And the men went up and viewed Ai." [Jos 7:2] ----------- Robert Jay Brown III rj@eli.wariat.org http://eli.wariat.org 1 847 705-0370 Elijah Laboratories Inc; 759 Independence Drive; Suite 5; Palatine IL 60074 ----- M o d e l i n g t h e M e t h o d s o f t h e M i n d ------ From: vern_tallman@usa.pipeline.com(Vernon M. Tallman) Subject: Re: Wanted hd64180/z80 Forth Date: 2 Apr 1996 20:26:11 GMT Message-ID: <4js2h3$njt@news1.h1.usa.pipeline.com> References: <4jpvbd$1ko@news1.h1.usa.pipeline.com> X-PipeUser: vern_tallman X-PipeHub: usa.pipeline.com X-PipeGCOS: (Vernon M. Tallman) >On Mar 28, 1996 14:24:21 in article , >'A.M.MacArthur. <100536.1560@CompuServe.COM>' wrote: > > >Can anybody recommend where a Forth Shareware Source listing for >the 64180/Z80 processor can be downloaded ? >..... > The files I previously mentioned are hfz80v096.txt hfz80v096.zip The Taygeta site has been unavailable .. so they can also be found at the mirror site: ftp.uni-bremen.de ... in directory/file: /pub/languages/programming/forth/Taygeta-Archive/Reviewed/hfz80v96.txt /pub/languages/programming/forth/Taygeta-Archive/Reviewed/hfz80v96.zip From: rj@eli.wariat.org (Robert J. Brown) Subject: Re: LaTeX package to typeset Forth Date: 01 Apr 1996 17:58:51 GMT Message-ID: References: In-reply-to: h9290246@hkuxa.hku.hk's message of Mon, 1 Apr 1996 06:00:52 GMT >>>>> "Zsoter" == Zsoter Andras writes: Zsoter> Does any have or does anybody know about a LaTeX package Zsoter> (.sty or the like) to typeset Forth programs? Zsoter> If you answer this question please send a cc to my private Zsoter> address because my news reader still keeps on loosing some Zsoter> messages. :-(( Zsoter> Andras You could look at the "spitery web" literate programming toolkit. It usually comes with a complete TeX distribution as part of the contrib stuff. This toolkit makes it fairly easy to write typesetters for any programming language. I do not think there is a Forth variant yet, but it shouldn't be too difficult to write. -- ----------- "... And the men went up and viewed Ai." [Jos 7:2] ----------- Robert Jay Brown III rj@eli.wariat.org http://eli.wariat.org 1 847 705-0370 Elijah Laboratories Inc; 759 Independence Drive; Suite 5; Palatine IL 60074 ----- M o d e l i n g t h e M e t h o d s o f t h e M i n d ------ From: mhx@IAEhv.nl (Marcel Hendrix) Subject: Base64 protocol Date: 2 Apr 1996 23:19:34 +0200 Message-ID: <4js5l6$mdt@iaehv.IAEhv.nl> Thanks everybody, for the useful suggestions concerning the base64 mystery. Embarassingly, the C-sourcecode for MIME64 was sitting on a Simtel CDROM I bought a few months back. A clear case of information overload. However, the code I will present is a minor variation on Skip Carter's implementation of UUENCODE and UUDECODE (although he may not recognize it himself). There are some iForthisms in the listing appended to this article but they shouldn't be too distractening. Numbers starting with '#' are in decimal, '$' means hex, '%' means binary. Instead of [CHAR] a you may write 'a' . The code uses iForths S-stack, just replace >S S S> with >R R@ R> . The word ?FILE ( ior -- ) handles errors after a file operation: : ?FILE ( ior -- ) ABORT" file error" ; The code will only work for 32-bit Forths that are not case-sensitive. A second iteration over the code might remove the limitations I now mention in the DOC. -marcel -- (* * LANGUAGE : ANS Forth * PROJECT : Forth Environments * DESCRIPTION : Protocol converter * CATEGORY : Tools * AUTHOR : Marcel Hendrix * LAST CHANGE : April 1, 1996, Marcel Hendrix * LAST CHANGE : March 26, 1996, Marcel Hendrix *) NEEDS -miscutil REVISION -64decode "ÄÄÄ Base64 decoder Version 0.00 ÄÄÄ" DOC (* This program decodes base64 encoded files. It expects to read a text file valid for the host OS (that is: cr+lf under DOS, lf for UNIX). There should be 4*n bytes per line read, which translates to 3*n bytes in the output file. The text starts with: Content-Type: text/plain; charset=US-ASCII Content-transfer-encoding: base64 The encode algorithm takes 3 bytes and translates these to four 6-bit ASCII characters, using the following logic: get a b c, put d e f g a b c a0a1a2a3a4a5a6a7 b0b1b2b3b4b5b6b7 c0c1c2c3c4c5c6c7 a2a3a4a5a6a7 b4b5b6b7a0a1 c6c7b0b1b2b3 c0c1c2c3c4c5 d' e' f' g' The primed characters' "value" lies between 0 and 63. This is used as an index into a table of 64 "items", where "item" is chosen to be a non-special printable character for the transmission channel between sender and receiver (This is uudecode/uuencode with an extra indirection added). In this way we can transport the file to any computer, across any medium, and unpack it there to exactly the same bits as we started with. This file only works when the used table contained US-ASCII in the following format: [A-Z][a-z][0-9]+/ . BUG (?) ------- 1. The scanning for the base64 content in the input file may fail because of case-sensitivity problems. 2. When the last characters in the inputfile are NOT valid, the outputfile will have null characters just before EOF. 3. The decoder loop can be done much simpler, there are too many shifts. See also 64encode.frt . *) ENDDOC 0 VALUE ihandle 0 VALUE ohandle 0 VALUE ^out CREATE outbuf 0 C, #127 ALLOT : >outp outbuf ^out + C! \ --- <> 1 +TO ^out ; \ Hard coded, US-ASCII expected. : NEXT@ C@+ \ --- DUP 'A' 'Z' 1+ WITHIN IF 'A' - exit ENDIF DUP 'a' 'z' 1+ WITHIN IF 'a' - #26 + exit ENDIF DUP '0' '9' 1+ WITHIN IF '0' - #52 + exit ENDIF DUP '+' = IF drop #62 exit ENDIF '/' = IF #63 ELSE 0 ( may happen at or just before EOF) ENDIF ; : DECODE-LINE DUP 0= IF EXIT ENDIF \ --- CLEAR ^out 4 /MOD SWAP >S 0 ?DO NEXT@ 2 LSHIFT >S \ .,.,a2a3a4a5a6a7 NEXT@ DUP 4 RSHIFT S> OR >outp \ a0a1.,.,.,.,.,., 4 LSHIFT >S \ .,.,.,.,b4b5b6b7 NEXT@ DUP 2 RSHIFT S> OR >outp \ b0b1b2b3.,.,.,., 6 LSHIFT >S \ .,.,.,.,.,.,c6c7 NEXT@ S> OR >outp \ c0c1c2c3c4c5.,., LOOP S> ( read 0, 1, 2 or 3 slack bytes) CASE 2 OF NEXT@ 2 LSHIFT >S NEXT@ NIP 4 RSHIFT S> OR >outp ENDOF 3 OF NEXT@ 2 LSHIFT >S NEXT@ DUP 4 RSHIFT S> OR >outp 6 LSHIFT SWAP NEXT@ NIP OR >outp ENDOF NIP ENDCASE outbuf ^out ; : GET-IFN BL WORD COUNT 2DUP CR ." Reading: " TYPE R/O BIN OPEN-FILE ?FILE TO ihandle ; : GET-OFN BL WORD COUNT 2DUP ." , creating: " TYPE W/O BIN CREATE-FILE IF DROP ihandle CLOSE-FILE 1 ABORT" couldn't open output file" ENDIF TO ohandle ; : FIND-BEGIN BEGIN PAD #80 ihandle READ-LINE SWAP 0= OR IF ohandle CLOSE-FILE DROP ihandle CLOSE-FILE DROP 1 ABORT" invalid file" ENDIF PAD SWAP #16 MIN S" Content-transfer" COMPARE 0= UNTIL PAD #80 ihandle READ-LINE 3DROP ; : (64DECODE) BEGIN PAD #80 ihandle READ-LINE ?FILE WHILE PAD SWAP DECODE-LINE ohandle WRITE-FILE ?FILE REPEAT DROP ; : 64DECODE GET-IFN GET-OFN FIND-BEGIN ['] (64DECODE) CATCH ohandle CLOSE-FILE IF CR ." Error closing output" ENDIF ihandle CLOSE-FILE IF CR ." Error closing input" ENDIF ?DUP IF THROW ENDIF ; : .ABOUT CR ." 64DECODE - Decode binary files" CR ." usage: 64DECODE infilename outfilename" ; .ABOUT From: mhx@IAEhv.nl (Marcel Hendrix) Subject: Base64 protocol Date: 2 Apr 1996 23:20:35 +0200 Message-ID: <4js5n3$mj1@iaehv.IAEhv.nl> This is a companion to the base64 decoder I posted earlier. There are more iForthisms now than for the decoder. I treat the input file as a byte stream and use the iForth streams.frt package to handle it (OPEN-FILES CLOSE-FILES PUTCH GETCH EOF). TEXT% is used to compile a text without a preceding count. $CR is a counted string that returns the OS-specific end-of-line sequence (^M^J for MS-DOS, ^J for Linux). The code will only work for 32-bit Forths that are not case-sensitive. There may be a few spurious NULLs at the end of the output file. -marcel -- (* * LANGUAGE : ANS Forth * PROJECT : Forth Environments * DESCRIPTION : Protocol converter * CATEGORY : Tools * AUTHOR : Marcel Hendrix * LAST CHANGE : March 26, 1996, Marcel Hendrix *) NEEDS -miscutil NEEDS -streams REVISION -64encode "ÄÄÄ Base64 encode Version 0.00 ÄÄÄ" DOC (* This program decodes base64 encoded files. It expects to read a text file valid for the host OS (that is: cr+lf under DOS, lf for UNIX). There should be 4*n bytes per line read, which translates to 3*n bytes in the output file. The text starts with: Content-Type: text/plain; charset=US-ASCII Content-transfer-encoding: base64 The encode algorithm takes 3 bytes and translates these to four 6-bit ASCII characters, using the following logic: get a b c, put d e f g a b c a0a1a2a3a4a5a6a7 b0b1b2b3b4b5b6b7 c0c1c2c3c4c5c6c7 a2a3a4a5a6a7 b4b5b6b7a0a1 c6c7b0b1b2b3 c0c1c2c3c4c5 d' e' f' g' The primed characters lie between 0 and 63. This is used as an index into a table of 64 "items", where "item" is chosen to be a non-special printable character for the transmission channel between sender and receiver (This is uudecode with an extra indirection added). In this way we can transport the file to any computer, across any medium, and unpack it there to exactly the same bits as we started with. This file only supports an indirection trough US-ASCII. *) ENDDOC CREATE chartable PRIVATE TEXT% ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/% : lookup ( char -- n ) $3F AND chartable + C@ ; \ first byte input is LSB. Last byte input is MSB. : get-3bytes? ( -- n count ) getch DUP EOF = IF drop 0 0 exit ENDIF getch DUP EOF = IF drop #16 LSHIFT 1 exit ENDIF SWAP 8 LSHIFT OR getch DUP EOF = IF drop 8 LSHIFT 2 exit ENDIF SWAP 8 LSHIFT OR 3 ; \ process three characters = 3 * 8 bits = 24 bits = 4 * 6 bits. : encode ( n1 -- n2 ) 0 LOCAL result 4 0 DO DUP lookup result 8 LSHIFT OR TO result 6 RSHIFT LOOP drop result ; : put-4bytes ( n -- ) \ 4 0 DO 8 ROL dup putch LOOP drop ; 4 0 DO dup putch 8 RSHIFT LOOP drop ; : WRITE-EOL ( -- ) $CR COUNT 0 ?DO c@+ PUTCH LOOP drop ; : WRITE$ ( c-addr u -- ) 0 ?DO c@+ putch LOOP drop WRITE-EOL ; : 64ENCODE ( "infile" "outfile" -- ) 0 LOCAL cnt OPEN-FILES S" Content-Type: text/plain; charset=US-ASCII" write$ S" Content-transfer-encoding: base64" write$ write-eol BEGIN get-3bytes? WHILE encode put-4bytes 4 +TO cnt cnt #60 >= IF clear cnt WRITE-EOL ENDIF REPEAT drop WRITE-EOL CLOSE-FILES ; : .ABOUT CR ." Try: 64ENCODE " ; .ABOUT From: Brad Rodriguez Subject: Re: Multitasking Date: 2 Apr 1996 11:49:06 GMT Message-ID: <4jr47i$jut@news.bellglobal.com> References: <3135fbe6.1340938@news.en.com> <4h6ohl$jlu@church.dcss.McMaster.CA> <315c61c9.367942@news.en.com> <4jjb9s$ogo@news.bellglobal.com> <4joa41$4ml@gatekeeper.atml.co.uk> <315FF43E.3A40@netcom.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 1.1PE (Windows; I; 16bit) Thanks, guys. I'm not up to speed when I post these at 6 am. :-) -- Brad Rodriguez bj@headwaters.com Computers on the Small Scale Contributing Editor, The Computer Journal... http://www.psyber.com/~tcj Director, Forth Interest Group........... http://www.forth.org/fig.html !!! 1996 Rochester Forth Conference: June 19-22 in Toronto, Ontario !!! Discount ends April 1st! http://maccs.dcss.mcmaster.ca/~ns/96roch.html From: Brad Rodriguez Subject: Re: Multithreading in Forth Date: 2 Apr 1996 11:53:49 GMT Message-ID: <4jr4gd$jut@news.bellglobal.com> References: <4jmqnr$1vg@whidbey.whidbey.com> <4jnfrc$c9s@sdcc12.ucsd.edu> <4jp1m4$132@news.wco.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 1.1PE (Windows; I; 16bit) bnilsen@wco.com (Byron Nilsen) wrote: >This exercise replaced three $1200 PLC's (ladder-logic controllers) >in the original design (which never had a prayer!) with two $125 >embedded micro's. I've been meaning to write about it for *Forth >Dimensions* whenever I can get around to it. Niiiiice. Please do write this up for FD! -- Brad Rodriguez bj@headwaters.com Computers on the Small Scale Contributing Editor, The Computer Journal... http://www.psyber.com/~tcj Director, Forth Interest Group........... http://www.forth.org/fig.html !!! 1996 Rochester Forth Conference: June 19-22 in Toronto, Ontario !!! Discount ends April 1st! http://maccs.dcss.mcmaster.ca/~ns/96roch.html From: jverne@acs.ryerson.ca (John Verne - CNED/F94) Subject: CRC implementation Date: 3 Apr 1996 04:50:26 GMT Message-ID: <4jt02i$2nq@ns2.ryerson.ca> Homework question! I'm a bit stumped on how to implement a CRC in forth... I'd like to have an address & count on the stack, and get the same, with a n-degree CRC appended to it. So far I have only been able to do it as one character, mathematically. Unfortunately, this doesn't give me a true modulo-2 answer; I have to shift twice as much left to keep the borrows from wiping the right bit of my character. I guess what I'm looking for is something that will simulate/operate as a shift/xor circuit. How do I treat chars as bits? I could loop 8 times, using a shifted mask to AND the bit, and then use this in my shift/XOR circuit...? I've twisted my mind around this, but I can't seem to get a working model. I even resorted to C ;> Eventually this is supposed to be used inside a sliding-windows style communications program... Any ideas/pointers (an example in ANY language would help) ? thanks Jon D. Verne From: h9290246@hkuxa.hku.hk (Zsoter Andras) Subject: Re: Forth on Unix or X? Message-ID: References: <4jro3f$62j@church.dcss.McMaster.CA> Date: Wed, 3 Apr 1996 05:45:26 GMT Brad Rodriguez (bradford@maccs.mcmaster.ca) wrote: >In article <315a4458.3116496@sunss102.cc.cycu.edu.tw>, >Lurng wrote: >>Are there any Forth system on Unix or X? > >Unix: yes, several. pfe, Atlast, ThisForth, and others that I can't >remember off the top of my head (not to worry, someone else will >surely post the complete list). Gforth andmy doof (still in an infantile stage). Just take a look at ftp://taygeta.com/pub/Forth and its subdirectories. For X I also don't know about any Forth with built-in X support but some of them have shared library support so adding support for X should be easy. Andras From: wilbaden@netcom.com (W.Baden) Subject: "Show-Tell-Straight-Narrow-" Message-ID: Date: Tue, 2 Apr 1996 21:43:35 GMT SHOW AND TELL, STRAIGHT AND NARROW, DON'T MUMBLE AND DON'T SHOUT. Doing Spring Housecleaning I came across these guide-lines that I worked out in the 80s. Except for Rules 2 and 3 they apply to all programming languages. 1. SHOW. Typographical structure should manifest logical structure. This is often not mentioned, perhaps because it's taken as given nowadays. How it is done is up to the programmer. Be consistent within a project. 2. TELL. There should never be any question as to what's on the stack. This is more important than the first rule. Unless you know what's on the stack you can't understand what Forth code is doing. 3. STRAIGHT. Minimize changing the order and nature of what's on the stack. Every time you change the stack the reader will have to change mind-set, and that will slow down comprehension. Misjudging what's on the stack is fatal. This is not difficult -- words tend to have stack persistence. 4. NARROW. "Everything worth saying about anything worth saying something about must be expressed in six or fewer pieces." Horizontally this means number of words on a line; vertically this means structures. It also applies to the number of paragraphs and sections of the documentation. (I have been excluding stack comments from the count.) A `dispatch function' is the exception. 5. DON'T MUMBLE. Names and comments should be in proper English. Avoid special characters. Your code should be able to pass a spelling checker. Comments should be grammatically correct. Be consistent with the use of names and abbreviations. Use appropriate names. Note: Some special characters have a commonly recognized meaning. `>' for transformation. Suffix `?' to show that the word is an adjective, not a noun. [square-brackets] for an immediate word. With the liberation from the tyranny of "length and first three characters unique" special characters are no longer necessary to distinguish closely related words. Perhaps we should be phasing WIDGET? and >WIDGET to IS-WIDGET and TO-WIDGET. 6. DON'T SHOUT. Avoid using all uppercase. Don't whisper either. And don't have words which must be distingushed by letter-case. (Don't yodel?) -- Procedamus in pace. Wil Baden Costa Mesa, California From: aph@atml.co.uk (Andrew Haley) Subject: Re: Multitasking Date: 3 Apr 1996 09:38:57 GMT Message-ID: <4jtgvh$qgi@gatekeeper.atml.co.uk> References: <3135fbe6.1340938@news.en.com> <4h6ohl$jlu@church.dcss.McMaster.CA> <315c61c9.367942@news.en.com> <4jjb9s$ogo@news.bellglobal.com> <4joa41$4ml@gatekeeper.atml.co.uk> <315FF43E.3A40@netcom.com> Andrew McKewan (mckewan@netcom.com) wrote: : Andrew Haley wrote: : > : > Brad Rodriguez (bj@headwaters.com) wrote: [ stuff ] : > Are you sure that you need a special < operator? : : > : > : MS ( n -) COUNTER + BEGIN PAUSE DUP COUNTER - 0< UNTIL DROP ; : Exactly. " - 0< " is the special < operator that Brad mentioned. So he doesn't need a special operator then, does he? If the "circular relational" can be implemented with a couple of pre-existing Forth primitives there's no need to have any more operators. It's a very Forth solution to the problem: different applications may need different behaviours, and we may use either "- 0<" (circular) or "<" (linear) as needed. Incidentally, I was very peeved when FORTH, Inc changed the behaviour of "<" and broke a number of my applications: but I just changed the source code of the nucleus right back again. Remember, people: always demand source from your vendor! Cheers, Andrew. P.S. Yes, I know that I could have _redefined_ "<". From: Stephen Pelc Subject: Re: Forth From C Date: Wed, 03 Apr 96 08:25:51 GMT Message-ID: <828519951snz@mpeltd.demon.co.uk> References: <315FE6BC.167EB0E7@paisley.ac.uk> Reply-To: sfp@mpeltd.demon.co.uk X-NNTP-Posting-Host: mpeltd.demon.co.uk X-Mail2News-Path: mpeltd.demon.co.uk In article <315FE6BC.167EB0E7@paisley.ac.uk> com40005@paisley.ac.uk "Robert M Boyce" writes: > I know this has probably been done a thousand times before, but what is > the best way to call Forth from C. > > In particular suppose an event loop is running, and one wishes this > event to loop to start up the Forth interpreter, Process some command > and then return to the C event loop. This event loop has been started > from Forth and is a child process of the Forth System. > > I am using ProForth For Windows, and the event loop is the tk_mainloop > from the Tk toolkit. If that's any help/ Define the Forth word as a callback. You may need to fax MPE technical support for full details, depending on the version you have. All the code you need is contained in the file SOURCE\FORTH\WINDOWS.FTH. A callback performs all the stack allocation, parameter transfer, and return handling automatically. This is the same mechanism used to handle all ProForth's winprocs. -- Stephen Pelc, sfp@mpeltd.demon.co.uk MicroProcessor Engineering - More Real, Less Time 133 Hill Lane, Southampton SO15 5AF, England tel: +44 1703 631441, fax: +44 1703 339691 From: regnirps@aol.com (Regnirps) Subject: Win32Forth question Date: 3 Apr 1996 07:02:44 -0500 Message-ID: <4jtpd4$drd@newsbf02.news.aol.com> Reply-To: regnirps@aol.com (Regnirps) I can't find much documentation, so can anybody tell me how to read/write I/O space? Charlie Springer From: bradford@maccs.mcmaster.ca (Brad Rodriguez) Subject: Re: Multithreading in Forth Date: 3 Apr 1996 12:16:21 GMT Message-ID: <4jtq6l$qsk@church.dcss.McMaster.CA> References: <4jmqnr$1vg@whidbey.whidbey.com> In article <4jmqnr$1vg@whidbey.whidbey.com>, Douglas Beattie Jr. wrote: >In multithreaded program, execution of separate tasks within the >program occurs concurrently, thereby completing the task sooner. >Doesn't multithreading require special construction of the program? > >Is FORTH suited to multithreading? > >Would each thread require its own stacks? Well, if I understand the jargon du jour of the computer science fraternity, most Forths actually do multithreading and not multitasking. E.g., from Tanenbaum's _Distributed Operating Systems_: "In most traditional operating systems, each process [task] has an address space and a single thread of control..." "In many respects, threads are like mini-processes. Each thread runs strictly sequentially and has its own program counter and stack..." "All threads have exactly the same address space, which means that they also share the same global variables... There is no protection between threads because (1) it is impossible, and (2) it should not be necessary... In addition to sharing an address space, all the threads share the same set of open files, child processes, timers, and signals, etc...." Sounds like most Forth multitaskers to me. :-) Brad Rodriguez bj@headwaters.com Computers on the Small Scale Contributing Editor, The Computer Journal... http://www.psyber.com/~tcj Director, Forth Interest Group........... http://www.forth.org/fig.html 1996 Rochester Forth Conference: June 19-22 in Toronto, Ontario http://maccs.dcss.mcmaster.ca/~ns/96roch.html From: bradford@maccs.mcmaster.ca (Brad Rodriguez) Subject: Re: Multitasking Date: 3 Apr 1996 12:29:04 GMT Message-ID: <4jtqug$qut@church.dcss.McMaster.CA> References: <3135fbe6.1340938@news.en.com> <4h6ohl$jlu@church.dcss.McMaster.CA> <315c61c9.367942@news.en.com> <4jjb9s$ogo@news.bellglobal.com> Now, about message passing... the simplest system would be to give each task a mailbox (eg. a user variable). The mailbox can hold 0 for 'empty', or a nonzero value which is a message. Any task can write to the mailbox as long as it is empty. This "test-and-store" must be an atomic (indivisible) operator, which is easy to do in a cooperative multitasker. If a task wants to write to a nonempty mailbox, it must wait until the mailbox becomes empty. A small refinement would also store the task id of the sending task, so the recipient would know who sent the message. A further refinement would allow a queue of messages, so that the sending task could leave a message even when the recipient isn't ready for it. This could be a fixed-size queue (eg. a circular buffer), or a variable-size queue (eg. linked list). Linked lists _may_ get you into the hairy world of dynamic memory allocation. These all assume that the "receive" operator accepts the first message from any sender. If you also need an operator to receive the first message from a specified sender, it gets more complicated. You could have multiple mailboxes (one for each possible sender), multiple queues, or a single queue which can be searched (in which case the queue must contain both the message and the sender's id). I've assumed short & fixed-size messages here; handling long or variable length messages is -- as the profs say -- an exercise for the student. :-) Note from personal experience -- it's surprising how well simple mailboxes work, if you're not trying to write a totally-general application (like a multiuser operating system). Cheers, Brad Rodriguez bj@headwaters.com Computers on the Small Scale Contributing Editor, The Computer Journal... http://www.psyber.com/~tcj Director, Forth Interest Group........... http://www.forth.org/fig.html 1996 Rochester Forth Conference: June 19-22 in Toronto, Ontario http://maccs.dcss.mcmaster.ca/~ns/96roch.html From: MABS85B@prodigy.com (Leo Wong) Subject: Readable Forth Date: 3 Apr 1996 14:14:48 GMT Message-ID: <4ju14o$no6@usenetp1.news.prodigy.com> I once wrote: > I have seen (ANS Forth only): > > : STAR 42 EMIT ; > > : STAR ." *" ; > > : STAR [CHAR] * EMIT ; > I hadn't seen: : .CHAR ( 'name' -- ) POSTPONE [CHAR] POSTPONE EMIT ; IMMEDIATE : STAR ( -- ) .CHAR * ; - LEO WONG MABS85B@prodigy.com New York State Department of Civil Service Albany, NY 12239 From: jvn@faraday.clas.Virginia.EDU (Julian V. Noble) Subject: Re: Forth and AI X-Nntp-Posting-Host: faraday.clas.virginia.edu Message-ID: References: Date: Wed, 3 Apr 1996 15:24:57 GMT stephenb@harlequin.co.uk writes: > In article <4jegvu$2ht@myst.plaza.ds.adp.com> znmeb@news (Ed Borasky) writes: > Either way, Forth is a good way to implement AI, especially the > numeric-intensive kinds of AI. It is a *lot* easier to drive arithmetic > elements like floating point coprocessors at full speed in Forth than > it is in LISP. > > Why? Although I am not Borasky (my mother assures me this is so), I will respond: Basically, most Forths, by incorporating assemblers for the machine language of the host, make direct access to adjunct machinery easier than in other languages I have used. For one thing, if one defines a new primitive such as S>F or D>F (Standard fp words that move single-or double-length integers to the top of the floating point stack which, in a system with a coprocessor, should be independent of the parameter stack and have its TOS cached in a co-processor register--doesn't everybody do it that way? :-) one can test it instantly. No separate assembling or linking steps are necessary. I found it much easier to drive a coprocessor with Forth than with other languages. Moreover, if ultimate speed is required, peephole optimization allows you to employ idiosyncrasies of the cpu/co-processor to get the best possible performance. I discuss this in my book. The problems with using an optimizing compiler for such chores are twofold: first, they generally do not optimize as well as a clever programmer who understands the system; and second, they tend to optimize everything, thereby generating a much bigger machine code image. For many purposes it is adequate to optimize only tiny parts of the program. But Stephen Bevan certainly knows all these things at least as well as I do--he was doubtless asking "Why" rhetorically, for the benefit of new readers of this newsgroup, in hopes that someone like myself would rise to the didactic challenge. -- Julian V. Noble jvn@virginia.edu From: jvn@faraday.clas.Virginia.EDU (Julian V. Noble) Subject: Re: WTB: Jupiter Ace X-Nntp-Posting-Host: faraday.clas.virginia.edu Message-ID: References: <4jp2uf$aqh@info-server.surrey.ac.uk> Date: Wed, 3 Apr 1996 15:04:23 GMT Andrew M Gale writes: > I have a Jupiter Ace, but it's not for sale I'm afraid! > However, if anyone is keen to put together an emulator, then > I could probably put the ROM images somewhere. > > Actually, an emulator shouldn't be tricky - the ACE has a > very simple text display. > > -Andy As one of the early purchasers of a Jupiter Ace, and --to my knowledge-- the only one who ever designed a math coprocessor (AMD 9511) add-on board for same, let me beg anyone who wants to emulate the Ace's Forth-in-ROM NOT to follow the Jupiter Cantabs floating point conventions. The Ace floating point arithmetic used a horrible bastardized BCD that was incompatible with any standard (i.e. 32-bit IEEE) convention. This made interfacing to the co-processor board baroque, to say the least... Worse, the Ace used a co-mingled floating point/parameter stack. As I have pointed out here and elsewhere, it is _possible_ to conduct an fp calculation with a co-mingled stack, but who would want to? Finally, the Ace Forth did not have a floating point function library, so its fp arithmetic was nearly useless for any practical purpose. The Timex/Sinclair ZX81 (or Z1000) managed to include trig, log and exponential functions (also square root, I think) in an 8K ROM Basic, so leaving these out of the Ace was a poor decision--especially since, as I understand it, the Ace's designers were the same people who did the ZX81's ROM Basic. After all, if it can be done with an interpretive Basic, Forth should use _less_ memory, right? If anyone is interested in the co-processor board, I can post its schematic on taygeta, together with the sad story of its design and the demise of the Jupiter Ace. It appeared in Larry Forsley's mag, Definitions last year some time. -- Julian V. Noble jvn@virginia.edu From: barrym@starbase.neosoft.com (barrym) Subject: Re: WTB: Jupiter Ace Date: 3 Apr 1996 18:28:34 GMT Message-ID: <4jug0i$sgp@uuneo.neosoft.com> References: <4j39v1$1sc@news.moose.co.uk> <4j9ja7$tqn@trog.dra.hmg.gb> Gary Payne (gdpayne@dra.hmg.gb) wrote: : James@moose.co.uk wrote: : >Remember this Forth-using blast from the past... I want to buy one or : >find an EMULATOR for the PC or Amiga... : Your not the only one, I'd love to have a Jupiter Ace, having written : a Reverse Polish Parser. If anyone has one, please let me know via : Email. : Gary. You probably already know this but just in case you dont, the HP 48 calculator is a RPN calculator with an amazingly large forth-like vocabulary. It's not forth, but it has very much the flavor of forth. Barry From: pmccarth@rpc.unb.ca (Patrick McCarthy) Subject: Re: Anyone using FORTH INC chipFORTH ? Date: 3 Apr 1996 16:52:03 GMT Message-ID: <4juabj$6q8@sol.sun.csd.unb.ca> References: <4jm9c1$h5l@netnews.hinet.net> Keywords: chipFORTH In article <4jm9c1$h5l@netnews.hinet.net>, awtech@ms4.hinet.net (awtech) wrote: > >I am considering buying the FORTH INC chipFORTH 80188/186 >Development Suite and would like to here any comments or gripes you may >have. The package cost about $1995 and you could save me some pain if >you know that I should get someting else for my AMD E88 work. >I am not the FORTH expert, and we do not have much FORTH people in TAIWAN. >Is chipFORTH easy to build and have enougth documents for FORTH begineer ? > >Thanks in advance. > >------------------------------------------------------------------- >Kuo, Wu Shun ,Hardware Engineer,All-Win Tech Incorporated (Taiwan), >FAX: 886-2-2989467 awtech@ms4.hinet.net.tw > We have used chipForths for 6811, 8051, 6816, and TMS320C31 but not the 80188/186 flavour. Right know I am actively using the 6811 and TMS320C31 versions on projects. chipForths are all similar in that they are built upon a standard polyForth base. Only the chip specific parts change. We're in New Brunswick, Canada which is not exactly a hotbed of Forth activity either. Especially back about 10 years ago, when I got our first polyForth, I was not a very experienced Forth user either. Forth Inc. is a professional company selling (and using) professional products. Their on screen and paper documentation is ok and they have effective phone support. Gripes? None in particular. In my case I grumble every time I buy another chipForth version since it means I get yet another copy of polyForth along with the chip-specific software. However, it's still well worth it, especially since it means the development environment is always the same. One thing to be aware of is that chipForth is more complex than a regular Forth (including polyForth). Basically the heads are kept on the host while the code being run is on the target 80188/186 board. But you can define and run words that run on the host too. Vocabularies are used to keep things straight but it's something to get used to. In your situaution I recommend getting a commercial software package that ius supported by the vendor. I am aware of only one other vendor that may also have a product that meets these requirements, MPE with their Umbilical Forth. I don't know of they make a version for the 80188/186. Ray St-Laurent rstlaure@rpc.unb.ca (I'm using someone else's account because I inadvertantly erased the original posting from mine) From: bnilsen@wco.com (Byron Nilsen) Subject: Re: "Show-Tell-Straight-Narrow-" Date: 3 Apr 1996 19:02:44 GMT Message-ID: <4jui0k$9ra@news.wco.com> References: W.Baden (wilbaden@netcom.com) wrote: : : SHOW AND TELL, STRAIGHT AND NARROW, DON'T MUMBLE AND DON'T SHOUT. : [clip] : Procedamus in pace. Wil Baden Costa Mesa, California -- Very worthy points made in the above essay. Here's my 2 centsworth: -- constant THIS WRITERS FRUSTRATION WITH... variable CONSISTENCY AND MAINTAINABILITY OF SOURCE CODE...so... create AN EPISTLE TO THE COMP.LANG.FORTHIANS : "GOOD-CODE" ( - or better ) \ Wil Baden's latest essay makes lots of sense! Executable code should be confined \ Leaving lots of room here for remarks to the left side of the page. \ that help explain the proceedings, So the reader knows what (and where) \ so someone other than the programmer the "important" stuff always is. \ can at least try to understand it. ; : DEFINITIONS ( like this - ) \ Should be thought of as "paragraphs"! Paragraphs have CAPITALIZED heads. \ As we all learned in grammar school. This was called "rubrication" \ This emphasizes the beginning of by ancient bible-scripting monks. \ a singular literary construction. ; : TEXT-BODY ( as shown - ) \ Should be lower (or mixed) case text! We no longer compose programs on \ Lower case text is "friendlier" to punch-cards or teletype machines. \ the readers eye than ALL-CAPITALS. Or, for that matter - in "blocks". \ "With freedom comes responsibility!" ; : ALIGNMENT ( of text - ) \ Too often ignored (sad hangover from blocks) Telephone book "white pages" are not \ Those relentlessly tidy vertically- very interesting, but they do yield \ aligned columns are damn boring, but necessary information efficiently. \ familiar, consistant, and reliable! ; : STACK-NOTES ( here's one ) \ Need to be included with every definition! Even if it's "nothing-in nothing-out \ Visual consistency as an aid to the stack-note preserves the visual \ reading comprehension, can't be consistency of the "paragraph". \ overemphasized! ; : SOURCE-CODE ( even Forth ) \ Should be informative, not exciting! Once it's written and debugged, \ *Maintainability* is the best I can't imagine anything more boring \ legacy a "legitimate" programmer than my own code. - Well, yes I can: \ can create. Consistent presentation Someone elses! \ (literally) helps make it happen! ; ...end-edit compile curse re-edit recompile link load run curse re-edit... |--|====== Byron Nilsen ======|--|* Analog and Digital Circuit Design *|--| |\/| * R. W. LABORATORIES * |\/|* Embedded Processor Systems *|\/| |/\|Industrial Instrumentation|/\|* Forth Language Applications *|/\| |--|====== And Controls ======|--|(finger bnilsen@wco.com for PGP key)|--| Thought for the day: "I have no respect for a man who can think of only one way to spell a word." From: dpsm@en.com (Dale P. Smith) Subject: Re: LaTeX package to typeset Forth Date: Wed, 03 Apr 1996 20:43:51 GMT Message-ID: <3162e1d7.11583627@news.en.com> References: rj@eli.wariat.org (Robert J. Brown) wrote: >>>>>> "Zsoter" == Zsoter Andras writes: > > Zsoter> Does any have or does anybody know about a LaTeX package > Zsoter> (.sty or the like) to typeset Forth programs? > >You could look at the "spitery web" literate programming toolkit. It >usually comes with a complete TeX distribution as part of the contrib >stuff. This toolkit makes it fairly easy to write typesetters for any >programming language. I do not think there is a Forth variant yet, >but it shouldn't be too difficult to write. I have been playing around with noweb for a little bit. It doesn't do any pretty printing of code, which is probly best for Forth because you create your own custom language to fit your problem. >----------- "... And the men went up and viewed Ai." [Jos 7:2] ----------- >Robert Jay Brown III rj@eli.wariat.org http://eli.wariat.org 1 847 705-0370 >Elijah Laboratories Inc; 759 Independence Drive; Suite 5; Palatine IL 60074 Say Hi to Zbig! Dale Dale P. Smith dpsm@en.com home dpsm@lubrizol.com work From: gordon@charlton.demon.co.uk (Gordon Charlton) Subject: Re: CRC implementation Date: Thu, 04 Apr 1996 01:41:21 +0100 Message-ID: References: <4jt02i$2nq@ns2.ryerson.ca> X-NNTP-Posting-Host: charlton.demon.co.uk In article <4jt02i$2nq@ns2.ryerson.ca>, jverne@acs.ryerson.ca (John Verne - CNED/F94) wrote: }Homework question! }I'm a bit stumped on how to implement a CRC in forth... }Any ideas/pointers (an example in ANY language would help) ? }thanks }Jon D. Verne There is some CRC code in the Forth Scientific Library. (I should know ;-) Gordon... From: Andrew McKewan Subject: Re: Win32Forth question Content-Type: text/plain; charset=us-ascii Message-ID: <316297A7.5452@netcom.com> Content-Transfer-Encoding: 7bit References: <4jtpd4$drd@newsbf02.news.aol.com> Mime-Version: 1.0 Date: Wed, 3 Apr 1996 15:22:15 GMT X-Mailer: Mozilla 2.0 (WinNT; I) Regnirps wrote: > > I can't find much documentation, so can anybody tell me how to read/write > I/O space? > > Charlie Springer You're not going to like this one: Write a device driver. In Win32, all user-mode applications run in protected mode and the operating system will not allow access to physical memory, I/O, interrupts and other "privileged" instructions. There is a toolkit called "WinRT" from Blue Water Systems that allows I/O, memory and interrupts from any Win32 program, but there is some runtime overhead (I haven't used it). http://www.bluewatersystems.com/ I haven't written a VXD (Windows 95 device driver) but an NT driver for simple port I/O (pc@, pc!) would be fairly simple (starting from one of Microsoft's examples), but they get very complicated when handling interrupts, DMA, etc. You will need the DDK which is part of the MSDN subscription ($500/yr) and a C compiler. Looks like DOS will be around for a while for the hardware hackers! Andrew McKewan From: aph@atml.co.uk (Andrew Haley) Subject: Re: Win32Forth question Date: 4 Apr 1996 09:39:58 GMT Message-ID: <4k05de$cvm@gatekeeper.atml.co.uk> References: <4jtpd4$drd@newsbf02.news.aol.com> <316297A7.5452@netcom.com> Andrew McKewan (mckewan@netcom.com) wrote: : Regnirps wrote: : > : > I can't find much documentation, so can anybody tell me how to read/write : > I/O space? : > : > Charlie Springer : You're not going to like this one: Write a device driver. : In Win32, all user-mode applications run in protected mode and the operating : system will not allow access to physical memory, I/O, interrupts and other : "privileged" instructions. Something which might be fun is a Forth VxD. Console I/O could be performed via the debugger terminal stream. Has anyone tried this? It would certainly make writing I/O drivers a lot easier. Andrew. From: bradford@maccs.mcmaster.ca (Brad Rodriguez) Subject: Re: CRC implementation Date: 4 Apr 1996 12:15:33 GMT Message-ID: <4k0eh5$kra@church.dcss.McMaster.CA> References: <4jt02i$2nq@ns2.ryerson.ca> Wil Baden gave an excellent talk on calculating CRCs some years ago at a FORML conference (I believe it was 1991 but I'll have to check). Proceedings of the FORML conference are, of course, available from the Forth Interest Group. :-) (Or, since you're in the area, Jon, you can borrow my copy.) Brad Rodriguez bj@headwaters.com Computers on the Small Scale Contributing Editor, The Computer Journal... http://www.psyber.com/~tcj Director, Forth Interest Group........... http://www.forth.org/fig.html 1996 Rochester Forth Conference: June 19-22 in Toronto, Ontario http://maccs.dcss.mcmaster.ca/~ns/96roch.html From: rhh@sunnyboy.lht.rwth-aachen.de (Robert Hoeller) Subject: Re: LaTeX package to typeset Forth Date: 04 Apr 1996 12:33:08 GMT Message-ID: References: Reply-To: rhh@lht.rwth-aachen.de In-reply-to: h9290246@hkuxa.hku.hk's message of Mon, 1 Apr 1996 06:00:52 GMT >>>>> " " == Zsoter Andras writes: > Does any have or does anybody know about a LaTeX package (.sty > or the like) to typeset Forth programs? There is a package for TeX typesetting of programming sources called TGRIND. Its kind of a port from the older VGRIND which was based upon TROFF instead of TeX. The program reads a universal language description file and is therefor suitable for great variety of languages, including Forth. The only problem with formatting Forth is that TGRIND assumes special characters not to be part of a word-name as it works in C :-(. I once ported the stuff to linux but it should work under DOS too. There are some bugs which I didn't fix (too lazy -- usually it works). If this is what you were looking for, send me line and I will look for the sources. ciao robert From: MABS85B@prodigy.com (Leo Wong) Subject: 0123 Forth Date: 4 Apr 1996 13:37:19 GMT Message-ID: <4k0jaf$1sbs@usenetp1.news.prodigy.com> \ I hope now and then to post easy ANS Forth programs \ that beginners may study and criticize. \ greet the computer, and be greeted in turn : I'M ( 'ccc' -- ) 0 PARSE CR ." Hello, " TYPE CR ; \ Leo Wong From: MABS85B@prodigy.com (Leo Wong) Subject: Re: 0123 Forth Date: 5 Apr 1996 13:57:34 GMT Message-ID: <4k38se$ff0@usenetp1.news.prodigy.com> References: <4k0jaf$1sbs@usenetp1.news.prodigy.com> \ sum of the squares between two limits \ adapted from Moore and Leach, FORTH - A Language for Interactive \ Computing (Mohasco Industries, Inc., 1970) : SPIN ( x1 x2 x3 -- x3 x2 x1 ) SWAP ROT ; : SHIFT ( lower_limit higher_limit -- 0 higher_limit+1 lower_limit ) 1+ 0 SPIN ; : SQUARED ( n -- n*n ) DUP * ; : SUM-OF-SQUARES ( lower_limit higher_limit -- sum_of_squares ) SHIFT DO I SQUARED + LOOP ; \ calculate and display sum of squares : SUMSQ ( lower_limit higher_limit -- ) SUM-OF-SQUARES U. ; \ Leo Wong From: "James P. Meyer" Subject: Re: WTB: Jupiter Ace Date: Fri, 5 Apr 1996 11:30:25 -0500 Message-ID: References: <4jp2uf$aqh@info-server.surrey.ac.uk> Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII In-Reply-To: On Wed, 3 Apr 1996, Julian V. Noble wrote: > As one of the early purchasers of a Jupiter Ace, and --to my knowledge-- > the only one who ever designed a math coprocessor (AMD 9511) add-on board > for same, let me beg anyone who wants to emulate the Ace's Forth-in-ROM > NOT to follow the Jupiter Cantabs floating point conventions. >....... > out of the Ace was a poor decision--especially since, as I understand it, > the Ace's designers were the same people who did the ZX81's ROM Basic. > After all, if it can be done with an interpretive Basic, Forth should > use _less_ memory, right? I've never seen the insides of the Jupiter Ace, but the outsides bear a strong family resembalance to the Sinclair ZX-80/81. Is there a chance that the ROM is the only difference between the machines? In other words, if you posted the contents of a Jupiter's ROM, could I burn a replacement for my TS-1000 that would turn it into an Ace? How about posting the ROM contents anyway, just in case. Jim "I hope...I hope...I hope" Meyer From: Andy Kirby Subject: Re Re Win32Forth 3.1 Released!! or Taygeta where? Date: 5 Apr 1996 16:06:51 GMT Message-ID: <4k3ger$lsh@mulgave.octacon.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 1.22 (Windows; I; 16bit) To: A.Kirby@cyberdev.octacon.co.uk I have tried all the tayfgeta adresses from Tom Zimmer's post and don't get any reply. it is as if taygeta does'nt exist. Although from all the talk of it i'm sure it must. I don't have any problems accessing other sites. Does any one know of any mirror's in the UK or mybe even Europe ?? Cheers Le Kirby (A.Kirby@cyberdev.octacon.co.uk) From: "James P. Meyer" Subject: Forth on a DSP chip? Date: Fri, 5 Apr 1996 11:45:38 -0500 Message-ID: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII It would be fun to write a version of Forth to run on the Analog Devices "EZ-KIT lite" DSP demo single board for their DSP-21xx series of chips. Has anybody already done this? Or will I be "going bravely where no one has gone before"? Jim From: Brad Rodriguez Subject: Re: The ideal Forth for an 8-bit processor Date: 5 Apr 1996 16:09:35 GMT Message-ID: <4k3gjv$mrf@news.bellglobal.com> References: <4jmtsb$1vg@whidbey.whidbey.com> <4jojf4$nvt@news.bellglobal.com> <4k0o8v$10r@columbia.acc.brad.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 1.1PE (Windows; I; 16bit) cdahello@comp.brad.ac.uk (xian the desk lisard) wrote: [re. the author of a 6502 ANS Forth] >wasn't bruce mcfarling, was it? Yes. Thanks. -- Brad Rodriguez bj@headwaters.com Computers on the Small Scale Contributing Editor, The Computer Journal... http://www.psyber.com/~tcj Director, Forth Interest Group........... http://www.forth.org/fig.html 1996 Rochester Forth Conference: June 19-22 in Toronto, Ontario http://maccs.dcss.mcmaster.ca/~ns/96roch.html From: Brad Rodriguez Subject: Cheap airfares to Toronto? Date: 5 Apr 1996 16:33:16 GMT Message-ID: <4k3i0c$mrf@news.bellglobal.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 1.1PE (Windows; I; 16bit) For those planning to attend the Rochester conference: I just saw an ad for TWA's new service to Toronto. Evidently they are offering heavily discounted rates from most U.S. cities. Call your travel agent soon; sales like these usually end quickly! (If anyone hears of any other airline promotions, please post a message here! Thanks.) -- Brad Rodriguez bj@headwaters.com Computers on the Small Scale Contributing Editor, The Computer Journal... http://www.psyber.com/~tcj Director, Forth Interest Group........... http://www.forth.org/fig.html 1996 Rochester Forth Conference: June 19-22 in Toronto, Ontario http://maccs.dcss.mcmaster.ca/~ns/96roch.html Date: 05 Apr 1996 10:13:00 +0100 From: All@business.forth-ev.de (Wolfgang Allinger) Message-ID: <66H7KnAr7QB@business.forth-ev.de> References: <65m5d-ZM7QB@business.forth-ev.de> Subject: Re: Spytrace package for PFE available for beta X-Charset: ISO-8859-1 On 01 Apr 96 in article (Robert J. Brown) wrote: snipp---- >I guess I could put them in my anon ftp area. Which LMI Forth are >you using? I'm using LMI's PC/FORTH, UR/FORTH and 80386 UR/FORTH Thanks and good bye Wolfgang -- FORTHing @ work Cheap Fast Good ...pick any two of them Dipl.-Ing. Wolfgang Allinger Brander Weg 6 Voice/FAX [+49] [0] 212 / 66 8 11 D-42699 SOLINGEN eMail: all@business.forth-ev.de GERMANY ## CrossPoint v3.02 R ## From: MABS85B@prodigy.com (Leo Wong) Subject: Re: 0123 Forth Date: 5 Apr 1996 21:03:44 GMT Message-ID: <4k41rg$1i06@usenetp1.news.prodigy.com> References: <4k0jaf$1sbs@usenetp1.news.prodigy.com> <4k38se$ff0@usenetp1.news.prodigy.com> \ greatest common divisor : UMOD ( u1 u2 - remainder) 0 SWAP UM/MOD DROP ; : EUCLID ( u1 u2 - gcd ) ?DUP IF TUCK UMOD RECURSE THEN ; : GCD ( u1 u2 -- ) \ display greatest common divisor EUCLID ." The greatest common divisor is " U. ; \ Leo Wong From: tames@alliedtelesyn.com Subject: Wanted: Forth on the I960 Date: 5 Apr 1996 22:26:50 GMT Message-ID: <4k46na$rk6@gateway.centre.com> Keywords: forth, 960 Does anyone have a version of forth that runs on an Intel 960? Thanks, Tim Ames tames@alliedtelesyn.com From: skip@taygeta.com (Skip Carter) Subject: taygeta was offline Date: 5 Apr 96 22:53:33 GMT Message-ID: <3165a46d.0@mail.itvcorp.com> Reply-To: skip@taygeta.com (Skip Carter) Taygeta was offline for the past 4 or 5 days but is back now. The problem turned out to be a bad ethernet transceiver. Skip -- Everett (Skip) Carter Phone: 408-641-0645 FAX: 408-394-5561 Taygeta Scientific Inc. INTERNET: skip@taygeta.com 1340 Munras Ave., Suite 223 UUCP: ...!uunet!taygeta!skip Monterey, CA. 93940 WWW: http://www.taygeta.com/skip.html From: Kendall Subject: Re: WTB: Jupiter Ace Date: Fri, 5 Apr 1996 23:44:25 +0100 Message-ID: References: <4jp2uf$aqh@info-server.surrey.ac.uk> X-NNTP-Posting-Host: kendalls.demon.co.uk MIME-Version: 1.0 In article , "James P. Meyer" writes > How about posting the ROM contents anyway, just in case. Sorry - this doesn't appear to have been said... Don't post binaries to CSS! Phil -- Philip Kendall all@kendalls.demon.co.uk pak21@cam.ac.uk From: skip@taygeta.com (Skip Carter) Subject: Re: CRC implementation Date: 5 Apr 96 23:02:48 GMT Message-ID: <3165a698.0@mail.itvcorp.com> References: <4jt02i$2nq@ns2.ryerson.ca> Reply-To: skip@taygeta.com (Skip Carter) In article <4jt02i$2nq@ns2.ryerson.ca>, jverne@acs.ryerson.ca (John Verne - CNED/F94) writes: |> Homework question! |> |> I'm a bit stumped on how to implement a CRC in forth... I'd like to have an |> address & count on the stack, and get the same, with a n-degree CRC |> The Forth Scientific Library algorithm #44 implements several CRC algorithms, including CCITT, XMODEM and X.25 CRCs. Look on taygeta at ftp://taygeta.com/pub/Forth/Scientific for all the code -- Everett (Skip) Carter Phone: 408-641-0645 FAX: 408-394-5561 Taygeta Scientific Inc. INTERNET: skip@taygeta.com 1340 Munras Ave., Suite 223 UUCP: ...!uunet!taygeta!skip Monterey, CA. 93940 WWW: http://www.taygeta.com/skip.html From: linkcom@moldenett.no (Pal Nyland) Subject: Who needs the Forth text interpreter? Date: 6 Apr 1996 00:56:36 GMT Message-ID: <4k4fg4$cqt@ulke.hiMolde.no> There was this idea that came from Stoic (a Forth-like language). Stoic does not interpret the input stream. Instead all text input is compiled. Compiled code that is not part of a definition is executed and then forgotten. Sounds like a good idea? I think it is a good idea. In fact, I have thought of it as a good idea for a long time, but have never had the time (nor nerve) to implement the concept. As it turned out, I used only a few hours the other night to convert my Forth text interpreter into a compiler. It still looks an feels like an interpreter, but it is a compiler. So what? Well, I can now forget about state-smart words. I can forget the problem of CHAR versus [CHAR], .( versus ." etc. I have to keep ['] though, as the original behaviour of ' (tick) still seems to be useful. There are no "compile-only" words anymore. IF..ELSE..THEN, BEGIN..WHILE..REPEAT, etc. may now be used outside colon definitions. Implementation: The interpreter compile to a buffer in the code space (code segment for xxx86).Each word is compiled and immediatly executed (if the control-flow stack is empty). A word is compiled by executing its compile-time semantics. If the control-flow stack change, the Interpreter Compile Buffer (ICB) will not be executed until the control-flow stack is empty. Following execution, the compilation pointer for the ICB is reset to the start of the ICB. example: 1 2 > if ." true" else ." false" then \ / \ / \ / \--------- compile -----------/ execute C E C E C E C-compile, E-execute This single-state interpreter/compiler is still new to me, and I have not yet evaluated every implication of the change. I have a good feeling, though. Any comments? Regards Pal Nyland Linkcom Business Development AS N-6400 Molde Norway linkcom@moldenett.no From: Tom Zimmer Subject: Re: Forth From C Date: Fri, 05 Apr 1996 10:07:57 -0600 Message-ID: <3165455D.B02@ix.netcom.com> References: <315FE6BC.167EB0E7@paisley.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-NETCOM-Date: Fri Apr 05 8:04:56 AM PST 1996 X-Mailer: Mozilla 2.0 (WinNT; I) Robert M Boyce wrote: > > I know this has probably been done a thousand times before, but what is > the best way to call Forth from C. > > In particular suppose an event loop is running, and one wishes this > event to loop to start up the Forth interpreter, Process some command > and then return to the C event loop. This event loop has been started > from Forth and is a child process of the Forth System. I believe you would just want to use a normal Windows Callback procedure like is used to handle Windows Messages. Your Forth must provide support for that kind of operation, since so many of the Windows interface functions require callbacks. You might contact Forth Inc., the US supporters for ProForth. Tom Zimmer From: h9290246@hkuxa.hku.hk (Zsoter Andras) Subject: Re: "Show-Tell-Straight-Narrow-" Message-ID: References: Date: Fri, 5 Apr 1996 15:23:53 GMT "Elizabeth D.Rather" (erather@forth.com) wrote: >Also, a vertical style with comments on every line (shades of assembler!) >tend to emphasize the trivial and omit the essential: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > >: FOO ( n -- m ) \ Transforms n to m > X \ Get address of X > + \ Add n to X > @ \ Fetch content of (X+n) >; Exactly. Unfortunately reading a some of other people's Forth code [even recommendations is books :-( ] I have adapted this style and I have to struggle to get rid of it. What makes reasonably large programs readable is the separation of comments from the code. When I went through some parts of the Linux kernel sources I got two points: 1.) Comments always come BEFORE the code and not in the middle of it. Usually a block of comments before each function (before each word in Forth) or block of code (C functions tend to be much bigger than Forth words) which explains what is going on inside the block of code is better than commenting line by line. 2.) Don't overcomment! You can safely assume that the reader of your program will be another programmer who knows what the ++ and -- operrators [or in Forth simple words like 1+, SWAP or OVER] are for, you don't have to explain such things. >But, no one has told us what this is all about! The important commentary >is What the word does and How to use it (appropriate context & arguments). >If definitions are kept short and simple (as they should be), their internal >logic will be clear. I agree a million times! Line by line commenting is often abused to replace explanations. It is much easier to write: SWAP \ Exhange TOS with the second item on the stack than to think about the important points in the algoritms you are implementing and to give a clue to the reader what the whole stuff is for. Also this style gives the false satisfaction that you have written more characters of comments than code, so your program is well documented -- as if comments would have to be measured by weight. In fact this kind of commenting is just noise. > >Ok, enough block-bashing! Files pre-existed blocks for some years. Chuck >consciously rejected file organization for Forth for a variety of good reasons. >Among them, the same reasons for which Western Civ. rejected scrolls 1,000+ years >ago. Well, if you don't want to be compatible with the rest of the world that is OK. I love blocks but you cannot use them for anything what is not Forth-related. >confusing a poor implementation with a poor technology. We have offered text file >support along with polyFORTH for quite a while now, but given the choice none of >our own programmers (and few of our customers) prefer them given the extensive >programming aids (browsing tools, X-refs, etc.) associated with blocks as well as >the extra level of modularity and control they provide. > But you are reinventing the wheel! E.g. on my Linux box I have editors for text files, grep, awk, etc. to process their contents and only God knows what else. To use blocks in such an environment would mean to limit myself to the tools either made by myself ore provided by the Forth community (as opposed to the rest of the world). I do seriously believe that Forth has its place in grown up environments like Un*x, VMS, or Windows NT. If there are already excellent tools on those platforms we should not try to replace but strive for making the best use of them. Andras From: regnirps@aol.com (Regnirps) Subject: Re: Re Re Win32Forth 3.1 Released!! or Taygeta where? Date: 5 Apr 1996 22:09:41 -0500 Message-ID: <4k4n9l$s3f@newsbf02.news.aol.com> References: <4k3ger$lsh@mulgave.octacon.co.uk> Reply-To: regnirps@aol.com (Regnirps) taygeta seems to be on and off. Yahoo can direct you there with www.taygeta.com/Forth.html but it has to be running! There is a "Bremen mirror", wherever that is. From: Dallas Legan Subject: Re: Who needs the Forth text interpreter? Date: Fri, 5 Apr 1996 20:27:37 -0800 Message-ID: References: <4k4fg4$cqt@ulke.hiMolde.no> Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII In-Reply-To: <4k4fg4$cqt@ulke.hiMolde.no> PN>> PN>> From linkcom@moldenett.noFri Apr 5 19:11:05 1996 PN>> Date: 6 APR 1996 00:56:36 GMT PN>> From: Pal Nyland PN>> Newsgroups: comp.lang.forth PN>> Subject: Who needs the Forth text interpreter? PN>> PN>> There was this idea that came from Stoic (a Forth-like language). Stoic does PN>> not interpret the input stream. Instead all text input is compiled. Compiled PN>> code that is not part of a definition is executed and then forgotten. PN>> PN>> Sounds like a good idea? PN>> PN>> I think it is a good idea. PN>> PN>> In fact, I have thought of it as a good idea for a long time, but have never PN>> had the time (nor nerve) to implement the concept. PN>> PN>> As it turned out, I used only a few hours the other night to convert my Forth PN>> text interpreter into a compiler. It still looks an feels like an interpreter, PN>> but it is a compiler. PN>> PN>> So what? PN>> PN>> Well, I can now forget about state-smart words. PN>> PN>> I can forget the problem of CHAR versus [CHAR], .( versus ." etc. PN>> I have to keep ['] though, as the original behaviour of ' (tick) still seems PN>> to be useful. PN>> PN>> There are no "compile-only" words anymore. IF..ELSE..THEN, PN>> BEGIN..WHILE..REPEAT, etc. may now be used outside colon definitions. PN>> PN>> PN>> Implementation: PN>> PN>> The interpreter compile to a buffer in the code space (code segment for PN>> xxx86).Each word is compiled and immediatly executed (if the control-flow PN>> stack is empty). A word is compiled by executing its compile-time PN>> semantics. If the control-flow stack change, the Interpreter Compile Buffer PN>> (ICB) will not be executed until the control-flow stack is empty. Following PN>> execution, the compilation pointer for the ICB is reset to the start of the PN>> ICB. PN>> PN>> example: PN>> PN>> 1 2 > if ." true" else ." false" then PN>> \ / \ / \ / \--------- compile -----------/ execute PN>> C E C E C E C-compile, E-execute PN>> PN>> PN>> PN>> This single-state interpreter/compiler is still new to me, and I have not yet PN>> evaluated every implication of the change. I have a good feeling, though. PN>> PN>> PN>> Any comments? PN>> PN>> PN>> PN>> Regards PN>> PN>> Pal Nyland PN>> Linkcom Business Development AS PN>> N-6400 Molde PN>> Norway PN>> PN>> linkcom@moldenett.no PN>> PN>> I experimented with something along these lines with the HES/Tom Zimmer VICForth system (VIC-20) I dug out a year or so ago and started playing around with some. ("The great general knows how to use both great and small forces" Sun Tzu paraphrased from somewhere in "The Art of War") One of the inspirations for my thinking was an article on "PISTOL" (Portably Implimented STack Oriented Language), so I dubbed my system "Zipgun". (Possibly no safer then one.) Another of my inspirations was the presentation Wil Baden gave to Orange County FIG on interpreted flow control. I opted not to follow Wil's plan because the VICForth was stored in ROM and not readily subject to revision, and the limited 32K of RAM placed a premium on useing as much predefined code from the ROM as possible - hence not haveing if, else, while etc. redefined. (But Wil's presentation planted the basic idea.) Instead I did much as you describe, I in fact used one of the edit/compile block buffers for several reasons for the compile buffer. To handle words that use text input, I borrowed from REXX the " " notation for shelling out to the surrounding OS, using basicly the techniques of Don Taylors FD article from days of old on instream macros - perhaps you handle this more gracefully. Some may object to borrowing syntax/notation from other languages, but I have always felt this was one of the advantages of an extensable language - the ability to borrow good ideas when you see them. (I also don't know how an extensible language could ever become obsolete, regardless of Clifford Stolls comments that created such a stir here a few months back. adaptability = obsolescenc??) Notations for more recent versions of Forth than FIG for this seem a bit excessively wordy to me, and this is used in other areas of programming. The " " notation is also usefull elsewhere than compiled keyboard input, and so definitly swings the other from redefining words already in ROM. Putting the compile buffer in an edit block allowed me to look at the instream macros with little trouble while working things out. Yet to be worked out is the obvious extension to a history buffer, but I think the obvious might not be the most Forthian route at this point. Another route might be a word 'history' (# -- ) that lists the last # definitions NUMBERED from the end of the dictionary, with !! or $! (# -- ) to execute one of them by this numbering, and perhaps a word ;! to complete compilation and immediately execute the word, therby eliminating the need for all this stuff. These things might also be accompanied by 'unlink' and more vocabulary manipulation tools ( or in this "context" more "history" manipulation) - a few that come to my mind are "pred" and "succ" and build up some with these. Another thing that comes to my mind is that in the FIG Forth (VICForth) uses the "width" to define words but not for "find" (or more properly "-find" in FIG) - this is probably for performance considerations, but it complicates what would otherwise be straightforward ability to use contractions for words, which in turn drives the tempation to use obscure contractions, acronyms or symbols instead of well chosen natural language words for word names. (or to have them nameless ;-)) My bottomline conclusion is that all effort should be made to make the simple act of defining words and manipulating them inteactively from the keyboard should be made. In my ideally conceived programming environment, the process of exploring interactively from the keyboard and prompt could then be captured by a decompiler, such as Wil Baden has developed, to a file or blocks or whatever and documented and saved. Regards Dallas E. Legan P.O. Box 2099 Downey, CA 90242 U.S.A. (310) 862 - 4854 dlegan@heart.engr.csulb.edu aw585@lafn.org delii@sc.liberty.com From: mhx@IAEhv.nl (Marcel Hendrix) Subject: Re: Who needs the Forth text interpreter? Date: 6 Apr 1996 13:21:17 +0200 Message-ID: <4k5k3d$qbm@iaehv.IAEhv.nl> References: <4k4fg4$cqt@ulke.hiMolde.no> (Pal Nyland) wrote Re: Who needs the Forth text interpreter? > There was this idea that came from Stoic (a Forth-like language). Stoic does > not interpret the input stream. Instead all text input is compiled. Compiled > code that is not part of a definition is executed and then forgotten. > > Sounds like a good idea? A very good idea, and frequently discussed in clf (but never put in the FAQ because we don't have a moderator). > I think it is a good idea. The problem is with the implementation. [ clear discussion of implementation deleted ] You introduce a new (to me) idea: to compile and execute single words, not complete lines, and to use the control flow stack to check when execution is allowed. > This single-state interpreter/compiler is still new to me, and I have not yet > evaluated every implication of the change. I have a good feeling, though. > Any comments? What about this: HEX 10 S" DECIMAL 4 6 + . " EVALUATE . . It leads to nested ICB's (and nested user variables). You probably agree that [ and ] are useful words, but they might not work in your setup ( 3 IF [ 1 4 + ] LITERAL THEN . ). There is also a subtle "problem" with words that read or try to change the inputstream. In Forth you can't type: BL WORD foo COUNT TYPE (The system probably prints TYPE ). Your new Forth nicely types foo . However, you still must compile it like this: : FOO BL WORD COUNT TYPE ; FOO foo because : FOO BL WORD foo COUNT TYPE ; will fail. I did look into this compile buffer approach once. When it works it is possible to design very small interactive target compilers (my TMS320C30 dsp with only 16 K RAM, my little ARM with 256 K). I did not succeed in making it look like Forth, so I quickly abandoned the idea. Christophe Lavarenne (sp?) may have more balanced ideas about this subject. He held a talk on Euroforth '92, his proposed system should be ready by now. -marcel mhx@IAEhv.nl :: http://www.IAEhv.nl/users/mhx From: wilbaden@netcom.com (W.Baden) Subject: Re: 0123 Forth Message-ID: References: <4k0jaf$1sbs@usenetp1.news.prodigy.com> <4k38se$ff0@usenetp1.news.prodigy.com> Date: Fri, 5 Apr 1996 21:02:02 GMT \ Applying Occam's Razor, Show, Tell, and Don't Mumble: ( Sum of the squares between two limits. ( Adapted from Moore and Leach, FORTH - A Language for Interactive ( Computing (Mohasco Industries, Inc., 1970) : SQUARED DUP * ; ( number -- number**2 ) : SUM-OF-SQUARES ( lower_limit higher_limit -- sum_of_squares ) 1+ SWAP ( higher_limit+1 lower_limit) 0 ROT ROT ( sum higher_limit+1 lower_limit) DO ( sum) I SQUARED + LOOP ; ( Calculate and display sum of squares. ) : SUMSQ ( lower_limit higher_limit -- ) SUM-OF-SQUARES U. ( ) ; From: "Bruce R. McFarling" Subject: Re: Forth and AI Date: 6 Apr 1996 13:27:15 GMT Message-ID: <4k5rfj$kkk@seagoon.newcastle.edu.au> References: <4j93es$62@nadine.teleport.com> <4jckle$or8@news1.h1.usa.pipeline.com> <4jegvu$2ht@myst.plaza.ds.adp.com> <948@purr.demon.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 1.2N (Windows; I; 16bit) rj@eli.wariat.org (Robert J. Brown) wrote: >... >Introducing Forth words without names is supposed to be provided for >in ANS Forth by :NONAME, but my experience with PFE is that it doesn't >work quite right yet, apparently due to compiler security issues. > >... The code: >\ >\ : foo bar baz ; : moby ... ['] foo ... ; >\ >\ may be replaced by: >\ >\ : moby ... { bar baz } ... ; What is this going to do when it hits Forth Scientific Project type notation for vectors, matrices, etc.? This is just a naming issue, of course, since I like the look of the underlying idea. If the intent is to define something inline that takes the place of ['] foo, why not : moby ... [: bar baz ;] ... ; ? Virtually, Bruce R. McFarling, Newcastle, NSW ecbm@cc.newcastle.edu.au From: jimbob@acpub.duke.edu (James P. Meyer) Subject: Re: WTB: Jupiter Ace Date: Sat, 06 Apr 1996 13:55:31 GMT Message-ID: <31667799.1929954@news.duke.edu> References: <4jp2uf$aqh@info-server.surrey.ac.uk> Kendall wrote: >In article e.edu>, "James P. Meyer" writes >> How about posting the ROM contents anyway, just in case. > >Sorry - this doesn't appear to have been said... > >Don't post binaries to CSS! > >Phil OK. How about e-mailing me the binary file? Jim From: Stephen Pelc Subject: Re: Who needs the Forth text interpreter? Date: Sat, 06 Apr 96 14:13:24 GMT Message-ID: <828800004snz@mpeltd.demon.co.uk> References: <4k4fg4$cqt@ulke.hiMolde.no> Reply-To: sfp@mpeltd.demon.co.uk X-NNTP-Posting-Host: mpeltd.demon.co.uk X-Mail2News-Path: mpeltd.demon.co.uk In article <4k4fg4$cqt@ulke.hiMolde.no> linkcom@moldenett.no "Pal Nyland" writes: > There was this idea that came from Stoic (a Forth-like language). Stoic does > not interpret the input stream. Instead all text input is compiled. Compiled > code that is not part of a definition is executed and then forgotten. ... > Any comments? This idea has been discussed and implemented several times. I believe there are papers by Christophe Lavarenne in EuroForth and EuroFORML proceedings. -- Stephen Pelc, sfp@mpeltd.demon.co.uk MicroProcessor Engineering - More Real, Less Time 133 Hill Lane, Southampton SO15 5AF, England tel: +44 1703 631441, fax: +44 1703 339691 From: linkcom@moldenett.no (Pal Nyland) Subject: Re: Who needs the Forth text interpreter? Date: 6 Apr 1996 14:43:16 GMT Message-ID: <4k5vu4$jt7@ulke.hiMolde.no> References: <4k4fg4$cqt@ulke.hiMolde.no> In message <4k5k3d$qbm@iaehv.IAEhv.nl> - mhx@IAEhv.nl (Marcel Hendrix) writes: :> :> (Pal Nyland) wrote Re: Who needs the Forth text :>interpreter? :> :>> There was this idea that came from Stoic (a Forth-like language). Stoic does :>> not interpret the input stream. Instead all text input is compiled. Compiled :>> code that is not part of a definition is executed and then forgotten. :>> :>> Sounds like a good idea? :> :>A very good idea, and frequently discussed in clf (but never put in the FAQ :>because we don't have a moderator). :> :>> I think it is a good idea. :> :>The problem is with the implementation. :> :>[ clear discussion of implementation deleted ] :> :>You introduce a new (to me) idea: to compile and execute single words, :>not complete lines, and to use the control flow stack to check when :>execution is allowed. :> :>> This single-state interpreter/compiler is still new to me, and I have not yet :>> evaluated every implication of the change. I have a good feeling, though. :> :>> Any comments? :> :>What about this: HEX 10 S" DECIMAL 4 6 + . " EVALUATE . . :>It leads to nested ICB's (and nested user variables). :>You probably agree that [ and ] are useful words, but they might not work :>in your setup ( 3 IF [ 1 4 + ] LITERAL THEN . ). :> :>[deleted] :> :>-marcel :>mhx@IAEhv.nl :: http://www.IAEhv.nl/users/mhx Yes, ( HEX 10 S" DECIMAL 4 6 + . " EVALUATE . ) does not work as expected. Neither does ( 3 IF [ 1 4 + ] LITERAL THEN . ). This does not worry me much because the above exapmples did not work in the first place. Nested ICB's is not complex to implement, and would cure the above problems. The problem of altered BASE worry me even less because this problem is already well known and not caused by behaviour of the interpreter - sorry, compiler. However, I am pleased to report that I still have not found any adverse side effects of removing the interpretive state. I have recompiled my Forth system using my Forth metacompiler, and I have recompiled my forth metacompiler using my Forth system. No part of the existing code seem to think anything unusual is going on. Even a few application programs have been recomiled without change. It is hard to believe, but it seems that i have added functionality to my Forth system by removing complexity. Sounds familiar? From: wilbaden@netcom.com (W.Baden) Subject: Re: 0123 Forth Message-ID: References: <4k0jaf$1sbs@usenetp1.news.prodigy.com> <4k38se$ff0@usenetp1.news.prodigy.com> Date: Fri, 5 Apr 1996 23:56:20 GMT \ And now for the production version. :-) : SQUARE-SUM DUP DUP 1+ * SWAP 2* 1+ * 6 / ; ( n -- Sigma i**2 ) : SUM-OF-SQUARES ( lower_limit higher_limit -- sum_of_squares ) DUP SQUARE-SUM SWAP 1- SQUARE-SUM - ( sum_of_squares ) ; From: mhx@IAEhv.nl (Marcel Hendrix) Subject: Re: Writing an operating system Date: 6 Apr 1996 17:48:48 +0200 Message-ID: <4k63p0$dse@iaehv.IAEhv.nl> References: <4hncj3$7h9@iaehv.IAEhv.nl> <828635112.3640@abwillms.demon.co.uk> alaric@abwillms.demon.co.uk (Alaric B. Williams) wrote Re: Writing an operating system > mhx@IAEhv.nl (Marcel Hendrix) wrote: [ snip ] >>You would have to say in which way you want it to be different from, >>for instance, Linux. > >Well, it'd be best ot look at my Web pages about that, or join the >list and lurk awhile... it's kinda complex, and I've explained the >whole thing from scratch to too many people now! I'll write a simple >FAQ at some point. I visited your home page, but did not join the list. [ about Burgess' book 'Developing your own 32-bit Operating System' ] >But you miss the point. We're not just writing another kernel. We're > designing a philosophy. But .. a philosophy is best designed by a single person, comfortably seated in an ivory tower (IHMO I hasten to add). Writing the kernel is then done by a large population of enthusiasts that don't understand the philosophy at all but know everything about bits and bytes (Re "Linux" :-)). You're reversing the approach. If you succeed in designing a philosophy with a team of Forth hackers I've never seen a Forth hacker :-) [ .. ] >>It can be done, but it is a lot of work. Why do you think we should do it? > >Another put it far more nicely than I can: > >-------------8<------------------ > >There is a world of men and women who cherish the Machine as a pure >joy of elegance and beauty, who revel in it as a fascinating realm of >mathematics come alive. The wrold of blessed minds needs a fresh block >of silicon to hew and sculpt, a virgin plot to sow with the electron >seeds of ther Machine. For my part, I intend to make Argon this >sophisticated new power. > >Matt McNaughton, ARGON project mailing list maintainer > >-----------8<------------------ This answers the question why a single person would want too, and also why a group of people feeling like this will not succeed :-( > Convinced? See http://www.hardcafe.co.uk/Alaric/os/index.htm -marcel mhx@IAEhv.nl :: http://www.IAEhv.nl/users/mhx Date: 06 Apr 1996 17:26:00 +0100 From: joerg.staben@jrgforth.forth-ev.de (Joerg Staben) Message-ID: <66K-CiKV5VB@jrgforth.forth-ev.de> References: <4k0jaf$1sbs@usenetp1.news.prodigy.com> <4k38se$ff0@usenetp1.news.prodigy.com> <4k41rg$1i06@usenetp1.news.prodigy.com> Subject: Re: 0123 Forth X-Charset: ISO-8859-1 A great idea - those little programs! Please go on! Ciao Joerg Fotografieren und Forth programmieren ## CrossPoint v3.02 ## From: "Bruce R. McFarling" Subject: Re: The ideal Forth for an 8-bit processor Date: 6 Apr 1996 16:17:57 GMT Message-ID: <4k65fl$nht@seagoon.newcastle.edu.au> References: <4jmtsb$1vg@whidbey.whidbey.com> <4jojf4$nvt@news.bellglobal.com> <4k0o8v$10r@columbia.acc.brad.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 1.2N (Windows; I; 16bit) cdahello@comp.brad.ac.uk (xian the desk lisard) wrote: >thus spake Brad Rodriguez in comp.lang.forth... > >. I think someone on this group was working on an ANS Forth >. for the 6502, but my brain has just gone blank and I can't >. recall who. > >wasn't bruce mcfarling, was it? You know, it may have been -- it even may be -- i.e., present tense. At present, my real live functioning 6502 processors are on the Eastern side of the Pacific, and I'm on the Western, but I've started to make progress again on the Forth side. If finished in a releasable form, it will be for the ACE operating system on the Commodore 64 / 128 computers, so it would be called AceForth, unless someone already uses that name (BTW: is there another Forth already using that name?). And, yes, I would have made more progress to this date if I didn't constantly side-track myself into a different slang I call Nicl (which on alternate Tuesdays stands for Namespace Interpretor and Command Language) Virtually, Bruce R. McFarling, Newcastle, NSW ecbm@cc.newcastle.edu.au From: Marc de Groot Subject: Re: WTB: Jupiter Ace Date: Sat, 06 Apr 1996 10:21:45 -0800 Message-ID: <3166B639.5021@immersive.com> References: <4jp2uf$aqh@info-server.surrey.ac.uk> <31667799.1929954@news.duke.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 2.0 (WinNT; I) James P. Meyer wrote: > > Kendall wrote: > >Don't post binaries to CSS! > > > >Phil > > OK. How about e-mailing me the binary file? > > Jim Or, with Skip's assent, how about putting it on taygeta? -- ---- Marc de Groot | Immersive Systems, Inc. | http://www.immersive.com | Real VR for the net! "If you hold an empty oil can up to your ear, you can hear the freeway." From: Tom Zimmer Subject: Re: Re Re Win32Forth 3.1 Released!! or Taygeta where? Date: Fri, 05 Apr 1996 23:02:06 +0000 Message-ID: <3165A66E.3EB8@ix.netcom.com> References: <4k3ger$lsh@mulgave.octacon.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-NETCOM-Date: Fri Apr 05 10:51:01 PM CST 1996 X-Mailer: Mozilla 2.01 (Macintosh; I; PPC) Andy Kirby wrote: > > I have tried all the tayfgeta adresses from Tom Zimmer's post > and don't get any reply. it is as if taygeta does'nt exist. > > Although from all the talk of it i'm sure it must. I suppose you have tried all of these, but here they are again; http://www.taygeta.com/forth.html ftp://taygeta.com/pub/Forth/Win32For/w32for31.exe ftp://taygeta.com/pub/Forth/Win32For/w32for31.faq ftp://taygeta.com/pub/Forth/Win32For/w32for31.txt > I don't have any problems accessing other sites. I sometimes have trouble getting onto taygeta, you might try calculating the time difference between where you are and california. Then try to get taygeta at 2 AM to 5 AM california time. Things should be a little quieter then. > Does any one know of any mirror's in the UK or mybe even Europe ?? ftp://ftp.uni-bremen.de/pub/languages/programming/forth/Taygeta-Archive Skip lists this as the Bremen Mirror. Tom Zimmer From: vern_tallman@usa.pipeline.com Subject: Re: Wanted: Forth on the I960 Date: 7 Apr 1996 04:34:52 GMT Message-ID: <4k7glc$89a@news1.h1.usa.pipeline.com> References: <4k46na$rk6@gateway.centre.com> X-PipeUser: vern_tallman X-PipeHub: usa.pipeline.com X-PipeGCOS: (Vernon M. Tallman) If you can't locate one explicitly designed for the 960, you might try one of the versions written in C - UNTIL, ATLAST, CFORTH, HENCE4TH, THISFORTH, PFE... Some are easier to build than others. I've been successful building ATLAST & find it to be a nice package with lots of functionality that you can conditionally compile in - including floating point. I think all of these packages are available at the Taygeta site. Vern Tallman From: john@ucc.gu.uwa.edu.au (John "West" McKenna) Subject: Re: WTB: Jupiter Ace Date: 7 Apr 1996 04:54:25 GMT Message-ID: <4k7hq1$6a8@styx.uwa.edu.au> References: <4jp2uf$aqh@info-server.surrey.ac.uk> jvn@faraday.clas.Virginia.EDU (Julian V. Noble) writes: >If anyone is interested in the co-processor board, I can post its >schematic on taygeta, together with the sad story of its design and >the demise of the Jupiter Ace. It appeared in Larry Forsley's mag, >Definitions last year some time. I'd love to see it. I started an emulator some time ago, but never finished. I think I had it emulating Z80 (I pinched someone else's code for that, and fixed the bugs) and updating the display, but I never got keyboard input working. I'm not a programmer. All I had at the time was a ROM image. It was *great* fun trying to construct a description of the hardware from that - feeding the code through every disassembler I had to find which processor it used, seeing how the screen worked by guessing which routines drew on it. I even managed to calculate the processor clock speed from the length of the loop in BEEP (or whatever it was called). I bought one secondhand later, and it looks a great hacker's machine. Everything is out in the open in standard 74xx parts. Even without documentation, it is simple enough to understand how it works. John West From: Stephen Pelc Subject: Re: Winf32Forth Date: Sun, 07 Apr 96 06:31:09 GMT Message-ID: <828858669snz@mpeltd.demon.co.uk> References: <4k2560$3j2@newsbf02.news.aol.com> Reply-To: sfp@mpeltd.demon.co.uk X-NNTP-Posting-Host: mpeltd.demon.co.uk X-Mail2News-Path: mpeltd.demon.co.uk In article <4k2560$3j2@newsbf02.news.aol.com> regnirps@aol.com "Regnirps" writes: > Well, I guess I am hosed for the moment. ANy suggestions on downloading a > vanilla DOS or 3.1 Forth? I normally use my PC just for compiling C for > embedded micros and a PAL programmer, but I have a pair of 24 bit digital > I/O cards to drive a simulator. The cards are supposed to look like 82XX > or whatever the parallel chip is and I address them in the usual I/O space > like $2C0, etc. ANy ideas? ProForth for Windows will do this fine under W3.11 and W95. Under NT you will need to add a GenPort driver. For more details of PFW, please send me your postal address. -- Stephen Pelc, sfp@mpeltd.demon.co.uk MicroProcessor Engineering - More Real, Less Time 133 Hill Lane, Southampton SO15 5AF, England tel: +44 1703 631441, fax: +44 1703 339691 From: ahorne@aa.net (Art Horne) Subject: Re: Internet Resource List - Forth - Pointer and Plea Date: 7 Apr 1996 05:27:49 GMT Message-ID: <4k7jol$r76@Holly.aa.net> References: <4jbn0n$k9d@dfw-ixnews5.ix.netcom.com> <4jgrt4$598@Holly.aa.net><4jbn0n$k9d@dfw-ixnews5.ix.netcom.com> <4jgrt4$598@Holly.aa.net> <315E0247.B85@immersive.com> Reply-To: ahorne@aa.net In message <315E0247.B85@immersive.com> - Marc de Groot Sat, 30 Mar 1996 19:55:51 -0800 writes: :> :>Art Horne wrote: :>> :>> In message <4jbn0n$k9d@dfw-ixnews5.ix.netcom.com> - :>> ninapint@ix.netcom.com(Nina Pinto) writes: :>> :>We maintain a list of Forth-related Internet Resources at: :>> :>http://www.cera2.com/forth.htm :>> :>http://www.eg3.com/forth.htm :>> :>> Tried both URLs with no success. :>> :>> Art :> :>I tried both URLs this evening, and succeeded at accessing them. Perhaps it was a :>temporary failure somewhere... You're right. Thanks. I got on both of them, no problem. _________________________ Art Horne K6KFH ahorne@aa.net May the FORTH be with you _________________________ From: wtanksle@sdcc15.ucsd.edu (William Tanksley) Subject: Re: Forth and AI Date: Sat, 06 Apr 1996 18:24:46 -0500 Message-ID: <4k7nbu$l1c@sdcc12.ucsd.edu> References: <4j93es$62@nadine.teleport.com> <4jckle$or8@news1.h1.usa.pipeline.com> <4jegvu$2ht@myst.plaza.ds.adp.com> <948@purr.demon.co.uk> <4k5rfj$kkk@seagoon.newcastle.edu.au> "Bruce R. McFarling" wrote to us all: >rj@eli.wariat.org (Robert J. Brown) wrote: >>Introducing Forth words without names is supposed to be provided for >>in ANS Forth by :NONAME, but my experience with PFE is that it doesn't >>work quite right yet, apparently due to compiler security issues. >>... The code: >>\ : foo bar baz ; : moby ... ['] foo ... ; >>\ may be replaced by: >>\ : moby ... { bar baz } ... ; > What is this going to do when it hits Forth Scientific Project >type notation for vectors, matrices, etc.? This is just a naming issue, >of course, since I like the look of the underlying idea. If the intent is >to define something inline that takes the place of ['] foo, why not > : moby ... [: bar baz ;] ... ; This dicussion should lead to some VERY useful things. I had tried to get this same thing working in F-PC, but I stopped when it seemed to require too much knowledge of the internals. The names I had used were "-{" and "}-"; they look nice and allow for another naming convention: words that take an unnamed definition as argument begin with -. So: dup 4 < test \ set up the following conditional \ a little clearer than just placing it on \ the stack; allows the programmer to vary the \ order. -{ do i things loop }- -if -{ 4 - do i 4 + things loop }- -otherwise Of course, a similar naming convention could apply to yours as well-- probably something like a : prefix, so that :if and :otherwise would be equivalent to my -if and -otherwise. (I like that a little better than mine, actually.) Next we "need" to set up a basic lambda system, so that it's possible to build a true lambda-calculus. Here's a sample form: : complex ( real imag -- ) 2 lambdas -{ use-lambdas Form @ Polar = if ri>Polar then }- ; 3 4 location -is HomeBase Polar Form ! CR ." > " HomeBase . . > 45 5 Of course, that does no more than CREATE-DOES>, but it's just a sample. My point is that this can be partially acomplished fairly easily, without requiring that every word (or even every -{}-) support it. All the word "lambdas" has to do is allocate the given numbers of cells (I'm not going to do anything special for char or double) and store the TOS into them, returning the address; use-lambdas needs to record the address of that immediately and fetch all its contents at runtime. Of course, if you thought the distinction between compile-time and runtime was hard to grasp sometimes, try this-- there can be any number of 'compiletimes' within one word now! >Bruce R. McFarling, Newcastle, NSW -Billy From: "Bruce R. McFarling" Subject: Re: Comments about comments (was: "Show-Tell-Straight-Narrow-") Date: 7 Apr 1996 07:56:36 GMT Message-ID: <4k7sfl$e0e@seagoon.newcastle.edu.au> References: <4jui0k$9ra@news.wco.com> <31640D7C.5872@forth.com> <3164E823.4F4A@immersive.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 1.2N (Windows; I; 16bit) I dislike the one-dimensional vertical style as much as I dislike the one-dimensional horizontal style. If each word definition is analogous to a paragraph, then there is a level between the definition and the individual word which is analogous to a sentence. As each sentence is intended to convey a complete thought, there is a level between the individual words used and the definition that involves a 'complete stack thought'. This paragraph / sentence / word hierarchy is *not* an automatic part of spoken english, but is rather something we learn to create as we learn to compose written language. So, too, the composition of longer definitions into coherent stack activities is a learned skill ( or as, for a programming example, the composition of 'operator idioms' is a learned skill of APL). A qualification, here: the ability to re-use activies that have been defined as words implies that there should be more one-liner Forth definitions than there are one sentence paragraphs in a well composed text! But for a definition that is *not* a natural one liner, I find a well-composed, well-indented sequence of lines easier to read than a 'paragraph-style' string of activies that have been fit into as few lines as possible, *and* easier to read than an archaic assembler one instruction per line approach. There is something missing in the analogy to the well-composed paragraph: the thesis sentence! I think that on the line immediately below the naming and primary stack comment should come an explanation of what the word is trying to do ... because armed with that, it's a lot easier to monkey around with the definition itself if the definition doesn't work for you! Let's get serious: are you more likely to be looking at the source when everything works, or when something has failed? And, just as important, is it going to be more *important* to read the source when everything is working, or when something is broken? The code says in Forthese what the code does (unless your compiler is buggy 8-)# but if what it does isn't what it is supposed to do, which is more important? I am arguing that what it is supposed to do is more important when the two differ. So I guess what I am saying is the following: : foo ( n1 addr -- n0 ) \ Get n0 from addr, and store n1 at addr in its place \ DUP @ >R ! R> ; Noticing the obvious simplicity of automating the process of browsing a text file (or set of text files) for ": (" and viewing the string of lines until "\" appears is left as an exercise for the reader. Virtually, Bruce R. McFarling, Newcastle, NSW ecbm@cc.newcastle.edu.au From: "Bruce R. McFarling" Subject: Re: 0123 Forth Date: 7 Apr 1996 13:47:51 GMT Message-ID: <4k8h27$pa1@seagoon.newcastle.edu.au> References: <4k0jaf$1sbs@usenetp1.news.prodigy.com> <4k38se$ff0@usenetp1.news.prodigy.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 1.2N (Windows; I; 16bit) MABS85B@prodigy.com (Leo Wong) wrote: >\ sum of the squares between two limits >\ adapted from Moore and Leach, FORTH - A Language for Interactive >\ Computing (Mohasco Industries, Inc., 1970) > >: SPIN ( x1 x2 x3 -- x3 x2 x1 ) > SWAP ROT ; Is this a common name for this operation? It's one of the primitive is use, e.g., to define ROT, except I called it FLIP. : ROT ( x1 x2 x3 -- x2 x3 x1 ) \ ROTate the 3rd stack item to the top, pushing the top 2 items down \ SWAP FLIP ; I did it that way because I use the 6502 'Y' index register as a work register, and with the X-indexed data stack I can juggle two bytes lda W ldy sl,x ; it must be this order sta sl,x ; since no sty $aaaa,x is available sty W ; (same for W+1 and sh,x) more rapidly and with less code than I can juggle three items. Since I can use "FLIP" elsewhere, I decided to go with the space saving and pay for the extra subtroutine call and jump. But should I call it SPIN? Or SWAP3? Or something else? Virtually, Bruce McFarling, Newcastle, NSW ecbm@cc.newcastle.edu.au From: Tom Zimmer Subject: Re: Who needs the Forth text interpreter? Date: Sat, 06 Apr 1996 18:06:15 +0000 Message-ID: <3166B297.4EDA@ix.netcom.com> References: <4k4fg4$cqt@ulke.hiMolde.no> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-NETCOM-Date: Sat Apr 06 3:57:46 PM PST 1996 X-Mailer: Mozilla 2.01 (Macintosh; I; PPC) Dallas Legan wrote: > > I experimented with something along these lines with the HES/Tom Zimmer > VICForth system (VIC-20) I dug out a year or so ago and started > playing around with some. Wow, it is neat to know that there is at least one VIC-20 still running, and it is running Forth. Tom Zimmer P.S. Lets see now, what year was that? From: Tom Zimmer Subject: Re: Who needs the Forth text interpreter? Date: Sat, 06 Apr 1996 18:10:59 +0000 Message-ID: <3166B3B3.826@ix.netcom.com> References: <4k4fg4$cqt@ulke.hiMolde.no> <828800004snz@mpeltd.demon.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-NETCOM-Date: Sat Apr 06 4:02:30 PM PST 1996 X-Mailer: Mozilla 2.01 (Macintosh; I; PPC) Stephen Pelc wrote: > > In article <4k4fg4$cqt@ulke.hiMolde.no> linkcom@moldenett.no "Pal Nyland" writes: > > There was this idea that came from Stoic (a Forth-like language). Stoic does > > not interpret the input stream. Instead all text input is compiled. Compiled > > code that is not part of a definition is executed and then forgotten. > ... > > Any comments? > This idea has been discussed and implemented several times. I believe there > are papers by Christophe Lavarenne in EuroForth and EuroFORML proceedings. On the other hand, there is no problem with new people covering old ground, the process of discovery can be exciting, whether you are the first to discover it or not. I think we old geezers need to watch out though, when we start covering old ground because we forgot we had covered it before. Lets see now, what was my name? From: ecbm@cc.newcastle.edu.au Subject: Re: Writing an operating system Date: 7 Apr 96 23:13:29 +1000 Message-ID: <1996Apr7.231329.1@cc.newcastle.edu.au> References: <4hncj3$7h9@iaehv.IAEhv.nl> <828635112.3640@abwillms.demon.co.uk> While going through this thread earlier this week (I had saved the articles to a text file, and was moving it from shell to hard disk), my perspective on the question changed. I was thinking about an interpreter implementation when I first saw the ~vocablist~word proposal, and read it in that light. When I say the proposal again, I was thinking about namespaces. In terms of namespaces, the forth vocabulary tools, whether fig, F79, ANS vocbaulary word builder words, or whatever, are primarily focused on bringing vocabularies into context. Indeed, one of the strengths of the better Forth vocabulary systems is the ability to bring multiple vocabularies into context in a general but controlled way. As a namespace question, what is the ~ proposal about (in addition to the seperator character question and the persistent store questions)? Even though bringing a namespace into context is a powerful idea, there may be occasions where it is preferable to be able to explicitly refer to the source namespace. Seen in this light, the most natural forth implemention would seem to be not an extension of the interpreter to support explicit namespace reference, but rather a word that supports explicit namespace reference. For this, seems to be a natural dataflow: "I'm going to make an explicit reference; it's to this location; and it's this item." As a bonus, whatever the hierarchical seperator used in -- as long as it is *not* space -- it will be collected in a single name string, and there will be no ambiguity if the hierarchical seperator also appears in normal forth words, since those will always be in the second rather than the first name string following the handler word. Given this last point, / is a perfectly fine seperator, and I don't see anything wrong with ~ as the name of the namespace-handler: ~ /file-systems/minix/ open And, of course, by using the slash for the explicit namespace, the path is left open for URL reference to external explicit namespace reference. One issue I see in this type of approach is whether to make the external reference opaque or available to POSTPONE ' ['] etc. I honestly don't see how to make the external reference available, except through external-reference extended versions, e.g. ~POSTPONE /file-systems/minix/ open But of course this is probably yet another case where a seasoned forth hand will prove me wrong. 8-)# In any event, it may be better to simplify before it starts and leave it opaque: to levae it so that, as at present, POSTPONE ' ['] etc. work on words in context, and if the words cannot be brought into context perhaps it is better not to try to give an xt style reference to the word, in which case the way to actually postponse the external reference is by evaluating ~ ... ... at the desired time. Maybe this fits into a message passing model that would fit the URL path alluded to above? (this is something for wiser heads than mine to remark upon.) Virtually, Bruce R. McFarling, Newcastle, NSW ecbm@cc.newcastle.edu.au will still be a normal forth word. From: Rehana Rodrigues Subject: Re: Reversible Forth? Date: 8 Apr 1996 01:58:52 GMT Message-ID: <4k9rss$ksj@usenet.srv.cis.pitt.edu> References: <828369021snz@apvpeter.demon.co.uk> Chris Jakeman wrote: > In an "April Fools' Day" item of the FIG UK magazine, Gordon Charlton >> > But seriously, has anyone tried writing a reversible Forth? > From : Anil Rodrigues via Rehana R: If I understand you right I am highly skeptical that such is possible. If X Y AND result in Z, then given Z and Y one cannot uniquely find X. Or am I out in left field ? Date: 07 Apr 1996 01:27:00 +0100 From: All@business.forth-ev.de (Wolfgang Allinger) Message-ID: <66P8A6q67QB@business.forth-ev.de> References: <4k3ger$lsh@mulgave.octacon.co.uk> <4k4n9l$s3f@newsbf02.news.aol.com> Subject: Re: Re Re Win32Forth 3.1 Released!! or Taygeta where? X-Charset: ISO-8859-1 On 05 Apr 96 in article <4k4n9l$s3f@newsbf02.news.aol.com> (Regnirps) wrote: >taygeta seems to be on and off. Yahoo can direct you there with >www.taygeta.com/Forth.html but it has to be running! There is a >"Bremen mirror", wherever that is. ^^^^^^ ^^^^^^^^ a City in the Northwest edge of Germany, nearby of the Northsea. I tried this mirror and it works. -- FORTHing @ work Cheap Fast Good ...pick any two of them Dipl.-Ing. Wolfgang Allinger Brander Weg 6 Voice/FAX [+49] [0] 212 / 66 8 11 D-42699 SOLINGEN eMail: all@business.forth-ev.de GERMANY ## CrossPoint v3.02 R ## From: h9290246@hkuxa.hku.hk (Zsoter Andras) Subject: Re: Forth and AI Message-ID: References: <4k7nbu$l1c@sdcc12.ucsd.edu> Date: Mon, 8 Apr 1996 11:24:57 GMT William Tanksley (wtanksle@sdcc15.ucsd.edu) wrote: > >>>\ may be replaced by: > >>>\ : moby ... { bar baz } ... ; > >> What is this going to do when it hits Forth Scientific Project >>type notation for vectors, matrices, etc.? This is just a naming issue, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >>of course, since I like the look of the underlying idea. If the intent is >>to define something inline that takes the place of ['] foo, why not With naming conventions we are in deep shit anyway. All the potentially useful short names '(', ',', '.', ':', ';', '#', '!', '?' '[' are used for something sometimes unnecessarily. How often do you type # , what justifies this horrible waste of a potentially useful name? The same holds to [ . I am happy that at least the standard does not reseve { and } for anything. Andras From: h9290246@hkuxa.hku.hk (Zsoter Andras) Subject: Re: Who needs the Forth text interpreter? Message-ID: References: <3166B3B3.826@ix.netcom.com> Date: Mon, 8 Apr 1996 11:28:58 GMT Tom Zimmer (ZForth@ix.netcom.com) wrote: >> This idea has been discussed and implemented several times. I believe there >> are papers by Christophe Lavarenne in EuroForth and EuroFORML proceedings. He also presented so of the ideas in the FORML conference last November. However I still don't see if an ANS Forth compliant system can be implemented that way. Executing defining words on the wrong place can mess things up. Well, probably a language without compilation and interpretation state would be cleaner, we just have to throw away almost all the old code. :-( Andras From: Mike Gill Subject: Help Please Fig Forth question from Forth beginner Date: 8 Apr 1996 14:31:09 GMT Message-ID: <4kb7vd$phg@soap.news.pipex.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 1.1 (Windows; I; 16bit) Anyone Help Please ! How can I assemble a number from a keyboard into a variable. There are commands for incrementing variables, but what I need is to tye a number at the keypad i.e. 123 and have 123 stored in the variable. Any advice appreciated Mike ak32@dial.pipex.com (UK) From: ecbm@cc.newcastle.edu.au Subject: Re: 0123 Forth Date: 9 Apr 96 00:33:25 +1000 Message-ID: <1996Apr9.003325.1@cc.newcastle.edu.au> References: <4k0jaf$1sbs@usenetp1.news.prodigy.com> <4k38se$ff0@usenetp1.news.prodigy.com> In article , wilbaden@netcom.com (W.Baden) writes: > \ And now for the production version. :-) > > : SQUARE-SUM DUP DUP 1+ * SWAP 2* 1+ * 6 / ; ( n -- Sigma i**2 ) > > : SUM-OF-SQUARES ( lower_limit higher_limit -- sum_of_squares ) > DUP SQUARE-SUM SWAP 1- SQUARE-SUM - ( sum_of_squares ) > ; Well, I wrote him about this, and here is his reponse (he quoted my message, so the most important part of that is here, too) ------------------------------------------------- From wilbaden@netcom.com Tue Apr 9 00:14:52 1996 Date: Mon, 08 Apr 1996 07:05:54 -0700 (PDT) From: "W.Baden" To: ecbm@cc.newcastle.edu.au Subject: "You're right" [ NB. Single '>' is me, no '>' is Wil Baden, and in square brackets is me talking now, as I am doing right now (though I guess that was obvious)] > I disagree! 8-)# > > I mean, I don't diagree with the code, I disagree that this is the > efficient way to layout the production code. At a bare minimum: > > : SQUARE-SUM ( n -- Sigma i**2) > DUP DUP 1+ * \ [1] n n(n+1) > SWAP 2* 1+ * \ [2] {n(n+1) * (2n+1)} > 6 / \ [3] "/6 > ; [Followed by a discussion of why, if it worked but was too slow, I would like things to have been broken down as above, and also pointing out that when the code was written, all this was known, so the comments are just information preservation, and don't require anything new] . . . I agree with you. I am condemned by my own rules. I violated "There should never be any doubt as to what's on the stack", "Everything worth saying about anything worth saying something about MUST be expressed in six or fewer pieces", "There should be a stack comment whenever something changes the nature or order of what's on the stack". But don't overlook the `:-)' at the end of the line. This was intended to be provocative. I'm grateful for your response. The most serious omission from my one-liner is a comment that explains what I'm doing. \ Compute: n(n+1)(2n+1)/6 Also `* 6 /' should be `6 */'. I would be most happy if you would post your response, this explication, and any further response you might have. -- Procedamus in pace. Wil Baden Costa Mesa, California -------------------------------------------------------- ... and so I did. I'll skip the part about posting my full response, because on second thought the rest of it was verbiage while I thought my way into Forth, and the above is the crucial point. Virtually, Bruce McFarling, Newcastle, NSW ecbm@cc.newcastle.edu.au From: MABS85B@prodigy.com (Leo Wong) Subject: Re: 0123 Forth Date: 8 Apr 1996 15:22:40 GMT Message-ID: <4kbb00$1mbc@usenetp1.news.prodigy.com> Joerg Staben (joerg.staben@jrgforth.forth-ev.de) wrote: > A great idea - those little programs! > > Please go on! Please, your turn. Also: anyone else? Seriously, I hope others will display some of their own Forth "pebbles". Wil Baden (wilbaden@netcom.com) wrote: > \ And now for the production version. :-) > > : SQUARE-SUM DUP DUP 1+ * SWAP 2* 1+ * 6 / ; ( n -- Sigma i**2 ) > > : SUM-OF-SQUARES ( lower_limit higher_limit -- sum_of_squares ) > DUP SQUARE-SUM SWAP 1- SQUARE-SUM - ( sum_of_squares ) > ; Wow! Includes an exercise in debugging. Thank you, Wil. Bruce R. McFarling" (ecbm@cc.newcastle.edu.au) wrote: > MABS85B@prodigy.com (Leo Wong) wrote: .. >> : SPIN ( x1 x2 x3 -- x3 x2 x1 ) >> SWAP ROT ; > Is this a common name for this operation? I doubt it. > But should I call it SPIN? or SWAP3? Or something else? I avoided FLIP because some people use it for >< . ROT probably fits best, but is taken ;-) . If SWAP ROT (or its CODE version) defines a useful word, then it should have a name. If it's best left as a phrase, then it should go nameless. I think if I were you I'd continue to say FLIP . The philo-forthical question is: What makes a good word? Leo From: linkcom@moldenett.no (Pal Nyland) Subject: Re: Who needs the Forth text interpreter? Date: 8 Apr 1996 16:28:29 GMT Message-ID: <4kberd$m1s@ulke.hiMolde.no> References: <3166B3B3.826@ix.netcom.com> In message - h9290246@hkuxa.hku.hk (Zsoter Andras) writes: :> :>Tom Zimmer (ZForth@ix.netcom.com) wrote: :>>> This idea has been discussed and implemented several times. I believe there :>>> are papers by Christophe Lavarenne in EuroForth and EuroFORML proceedings. :> :> He also presented so of the ideas in the FORML conference last November. :>However I still don't see if an ANS Forth compliant system can be implemented :>that way. Executing defining words on the wrong place can mess things up. :>Well, probably a language without compilation and interpretation state :>would be cleaner, we just have to throw away almost all the old code. :-( :> :>Andras :> :> By executing single words immediatly after compilation, Your old code does not notice any difference. A phrase like: ( VARIABLE TEST TEST OFF ), still work as expected. Even: ( VARIABLE TEST ' TEST EXECUTE OFF ) works. Regards Pal Nyland --- Pal Nyland Linkcom Business Development AS P.O. 197 N-6401 Molde Phone: +47 71215744 Fax: +47 71215717 Email: linkcom@moldenett.no From: flacy@crchha99.nortel.com (Mark Flacy) Subject: Re: Help Please Fig Forth question from Forth beginner Date: 08 Apr 1996 11:08:20 -0500 Message-ID: References: <4kb7vd$phg@soap.news.pipex.net> In-reply-to: Mike Gill's message of 8 Apr 1996 14:31:09 GMT In article <4kb7vd$phg@soap.news.pipex.net> Mike Gill writes: >Anyone Help Please ! > >How can I assemble a number from a keyboard into a variable. >There are commands for incrementing variables, but what I need is to tye a >number at the keypad i.e. 123 and have 123 stored in the variable. > >Any advice appreciated > >Mike >ak32@dial.pipex.com (UK) > How about 123 the_name_of_the_variable_that_you_want_to_store_into ! ? Or am I (more likely) missing the point? -- \ ---------------------------------------------------------------------- \ Mark A. Flacy | flacy@nortel.com | ESN 445-8347 \ | (214) 685-8347 | Department 2B51 \ ---------------------------------------------------------------------- \ Someday I may speak for Nortel. \ Someday pigs may howl at a full moon. \ Expect the latter to occur first. \ ---------------------------------------------------------------------- From: "Elizabeth D.Rather" Subject: Re: "Show-Tell-Straight-Narrow-" Date: Mon, 08 Apr 1996 09:52:13 -0700 Message-ID: <3169443D.3EC1@forth.com> References: <4jui0k$9ra@news.wco.com> <31640D7C.5872@forth.com> <828660822snz@tcontec.demon.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 2.01 (Win95; I) Paul E. Bennett wrote: > > In article <31640D7C.5872@forth.com> > erather@forth.com "Elizabeth D.Rather" writes: > > > Ok, enough block-bashing! Files pre-existed blocks for some years. Chuck > > consciously rejected file organization for Forth for a variety of good reasons. > > Among them, the same reasons for which Western Civ. rejected scrolls 1,000+ > > years > > ago. > > I think you will find that it is the other way around. During the time of the > first truly symbolic electronic computers (Collosus and Pilot) the storage was > hand written and in a block format (a page or card). Later we shunned blocks > when Paper Tape came about. But Punched Cards were also around at that time so > we did not forget block storage altogether. Following paper tape we managed to > store data on a Magnetic Tape (a block storage device) and other magnetic media > like Drum and Disc (also block storage devices). It's just that we now try and > fool ourselves that our block storage devices keep information in virtual paper > tapes. :) Paul may be entirely correct as to computer science history, but in the narrower sphere of storing program source, files were certainly in common use in Chuck's experience when he designed Forth. Moreover, a Forth block size and format (1024 bytes formatted for edition as 16x64) was conceived as independent of storage format (tape, disk or whatever) for portability purposes. Cheers, Elizabeth From: "Elizabeth D.Rather" Subject: Re: Comments about comments (was: "Show-Tell-Straight-Narrow-") Date: Mon, 08 Apr 1996 10:09:56 -0700 Message-ID: <31694864.7C07@forth.com> References: <4jui0k$9ra@news.wco.com> <31640D7C.5872@forth.com> <3164E823.4F4A@immersive.com> <4k7sfl$e0e@seagoon.newcastle.edu.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 2.01 (Win95; I) Bruce R. McFarling wrote: > ... If each word > definition is analogous to a paragraph, then there is a level > between the definition and the individual word which is analogous > to a sentence. As each sentence is intended to convey a complete > thought, there is a level between the individual words used and > the definition that involves a 'complete stack thought'. This > paragraph / sentence / word hierarchy is *not* an automatic part > of spoken english, but is rather something we learn to create as > we learn to compose written language. So, too, the composition > of longer definitions into coherent stack activities is a learned > skill ( or as, for a programming example, the composition of > 'operator idioms' is a learned skill of APL). In the original design of Forth (as well as our continuing practice) the definition is intended to be analogous to the sentence, and the block to the paragraph (a group of definitions/sentences devoted to a single "topic"). The overwhelming majority of defs (again, both in Chuck's early code and our today) are 1-3 lines long. Three blocks with their corresponding shadows reside neatly on a page (the next larger organizational structure). The comment lines (line 0) of 60 blocks forms a one-page index (and can be formatted on the terminal screen for browsing) and thus 60 blocks becomes analogous to a chapter. As we have developed our programming tools around this layered modularity, we find they support good program maintenance well. As I indicated previously, we are attempting to find the appropriate model for porting these concepts to text-file source, but are finding it more difficult. Cheers, Elizabeth From: "Elizabeth D.Rather" Subject: Re: Forth for windows - where to get? Date: Mon, 08 Apr 1996 10:17:28 -0700 Message-ID: <31694A28.2C46@forth.com> References: <31645C1A.1381@tir.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 2.01 (Win95; I) To: "Michael A. Losh" Michael A. Losh wrote: > I've also had an demo from Forth, Inc. of the ProForth for Windows. It > is a package that they sell and support developed by MPE in England. The > system was quite impressive and had additional tools that make writing > windows apps much easier. Their staff is very impressive as well, and > can offer live support if you need it. Forth, Inc. is on the Web at: > http://www.earthlink.net/~forth > I think their system is also 16-bit for Windows 3.1. Thanks for the nice words, but our web site's address is unfortunately changing to http://home.earthlink.net/~forth (the ...www... form is available during a transition period only). I think services do that just to confuse and harass their customers ;-( Cheers, Elizabeth From: "Bruce R. McFarling" Subject: Re: Forth and AI Date: 8 Apr 1996 17:10:46 GMT Message-ID: <4kbham$sfe@seagoon.newcastle.edu.au> References: <4j93es$62@nadine.teleport.com> <4jckle$or8@news1.h1.usa.pipeline.com> <4jegvu$2ht@myst.plaza.ds.adp.com> <948@purr.demon.co.uk> <4k5rfj$kkk@seagoon.newcastle.edu.au> <4k7nbu$l1c@sdcc12.ucsd.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 1.2N (Windows; I; 16bit) wtanksle@sdcc15.ucsd.edu (William Tanksley) wrote: >"Bruce R. McFarling" wrote to us all: well, I asked: >> What is this going to do when it hits Forth Scientific Project >> type notation for vectors, matrices, etc.? This is just a naming >> issue, of course, since I like the look of the underlying idea. >> If the intent is to define something inline that takes the place >> of ['] foo, why not >> : moby ... [: bar baz ;] ... ; > This dicussion should lead to some VERY useful things. I had tried > to get this same thing working in F-PC, but I stopped when it seemed > to require too much knowledge of the internals. > The names I had used were "-{" and "}-"; they look nice and allow for > another naming convention: words that take an unnamed definition as > argument > begin with -. So: >Next we "need" to set up a basic lambda system, so that it's possible to >build a true lambda-calculus. Here's a sample form: >: complex ( real imag -- ) > 2 lambdas -{ use-lambdas > Form @ Polar = if ri>Polar then > }- > ; How this will look if it is an example that is doing something with vector operations: perhaps building a vector of xt's for some table-driven execution, where, for example, 'default' is a particular index into the table. If we start putting -{ foo bar }- on the same page with vector expressions like table{ default } I forsee confusion. And I've looked at the matrix stuff in the FSL, and like it, and am going to use it, and the likelihood that I will rewrite it for a different vector notation is nil or negligable. That said, I have no particular brief for [: ;] -- they are just the first thing that came to mind. Somebody say whether or not they are evocative of what is going on: : complex ( real imag -- ) 2 lambdas [: use-lambdas Form @ Polar = if ri>Polar then ;] ; The visual problem (which I just notice -- amazing how leaving foo and bar behind reveals hidden problems) is that visually [: looks like use-lambdas is the name, when what is needed is to convey that there is no name. Perhaps :[ use lambdas Form @ Polar = if ri>Polar then ]; and I also just noticed that only the first character in the :[ ]; sequence requires shifting, which for me would reduce typos. (Or aren't we supposed to consider typos when we make a new name?) Of course, these are particularly severe looking frowny faces, but I *know* we are supposed to pretend we don't notice that when considering a serious question like this. Virtually, Bruce R. McFarling, Newcastle, NSW ecbm@cc.newcastle.edu.au From: smurf@noris.de (Matthias Urlichs) Subject: Re: 0123 Forth Date: 8 Apr 1996 19:46:59 +0200 Message-ID: <4kbjej$glb@work.smurf.noris.de> References: <4kbb00$1mbc@usenetp1.news.prodigy.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit In comp.lang.forth, article <4kbb00$1mbc@usenetp1.news.prodigy.com>, MABS85B@prodigy.com (Leo Wong) writes: > Joerg Staben (joerg.staben@jrgforth.forth-ev.de) wrote: > > MABS85B@prodigy.com (Leo Wong) wrote: > .. > >> : SPIN ( x1 x2 x3 -- x3 x2 x1 ) > >> SWAP ROT ; > > Is this a common name for this operation? > I doubt it. > I tend to use words named '%###' (###: digits showing former stack positions) for this kind of thing, possibly appended with "-###" to show the stack positions which were dropped if that isn't obvious. For instance, I would use : %123 SWAP ROT ; for SPIN (the TOS is number one). TUCK ( x1 x2 -- x2 x1 x2 ) I'd name %121, and its inverse %-3. IMHO this convention is a win because stack permutations are damn difficult to get right if you have something entirely different in mind at the moment, and to come up with distinctive names for the beasts (I never can remember whether ROT fetches the third item up or tucks the first item two down (it's the former; -ROT usually does the latter)), so I just write %213 and %132 for them. -- Coming together is a beginning; keeping together is progress; working together is success. -- Matthias Urlichs \ XLink-POP Nürnberg | EMail: urlichs@smurf.noris.de Schleiermacherstraße 12 \ Unix+Linux+Mac | Phone: ...please use email. 90491 Nürnberg (Germany) \ Consulting+Networking+Programming+etc'ing 42 PGP: 1B 89 E2 1C 43 EA 80 44 15 D2 29 CF C6 C7 E0 DE Click here. From: skip@taygeta.com (Skip Carter) Subject: Re: WTB: Jupiter Ace Date: 8 Apr 96 18:48:37 GMT Message-ID: <31695f85.0@mail.itvcorp.com> References: <4jp2uf$aqh@info-server.surrey.ac.uk> <31667799.1929954@news.duke.edu> <3166B639.5021@immersive.com> Reply-To: skip@taygeta.com (Skip Carter) In article <3166B639.5021@immersive.com>, Marc de Groot writes: |> James P. Meyer wrote: |> > |> > Kendall wrote: |> > >Don't post binaries to CSS! |> > > |> > >Phil |> > |> > OK. How about e-mailing me the binary file? |> > |> > Jim |> |> Or, with Skip's assent, how about putting it on taygeta? |> By all means, ftp it to taygeta (now that the faulty ethernet transceiver has been replaced). All incoming code should be placed in pub/incoming or pub/incoming/forth with a separate "readme" file. I will then move it to the appropriate location for public access. BTW if you are going to be e-mailing binary files around, you should uuencode them to ASCII first. You can get Forth sources for UUENCODE/UUDECODE from taygeta. -- Everett (Skip) Carter Phone: 408-641-0645 FAX: 408-394-5561 Taygeta Scientific Inc. INTERNET: skip@taygeta.com 1340 Munras Ave., Suite 223 UUCP: ...!uunet!taygeta!skip Monterey, CA. 93940 WWW: http://www.taygeta.com/skip.html From: rj@eli.wariat.org (Robert J. Brown) Subject: Re: Forth and AI Date: 08 Apr 1996 06:28:12 GMT Message-ID: References: <4j93es$62@nadine.teleport.com> <4jckle$or8@news1.h1.usa.pipeline.com> <4jegvu$2ht@myst.plaza.ds.adp.com> <948@purr.demon.co.uk> <4k5rfj$kkk@seagoon.newcastle.edu.au> In-reply-to: "Bruce R. McFarling"'s message of 6 Apr 1996 13:27:15 GMT >>>>> "Bruce" == Bruce R McFarling writes: Bruce> rj@eli.wariat.org (Robert J. Brown) wrote: >> ... Introducing Forth words without names is supposed to be >> provided for in ANS Forth by :NONAME, but my experience with >> PFE is that it doesn't work quite right yet, apparently due to >> compiler security issues. >> >> ... The code: \ \ : foo bar baz ; : moby ... ['] foo ... ; \ \ >> may be replaced by: \ \ : moby ... { bar baz } ... ; Bruce> What is this going to do when it hits Forth Scientific Bruce> Project type notation for vectors, matrices, etc.? This is Bruce> just a naming issue, of course, since I like the look of Bruce> the underlying idea. If the intent is to define something Bruce> inline that takes the place of ['] foo, why not Bruce> : moby ... [: bar baz ;] ... ; I like that notation, except that my own convention for square bracket notation puts the modified outsied the bracket rather than inside, and I prefer symetrical bracket pairs, which would look like this: : moby ... :[ bar baz ]: ... ; -- ----------- "... And the men went up and viewed Ai." [Jos 7:2] ----------- Robert Jay Brown III rj@eli.wariat.org http://eli.wariat.org 1 847 705-0370 Elijah Laboratories Inc; 759 Independence Drive; Suite 5; Palatine IL 60074 ----- M o d e l i n g t h e M e t h o d s o f t h e M i n d ------ From: Bernd Paysan Subject: Re: Forth and AI Date: Sat, 06 Apr 1996 23:29:51 +0200 Message-ID: <3166E24F.4B9A35F1@informatik.tu-muenchen.de> References: <4j93es$62@nadine.teleport.com> <4jckle$or8@news1.h1.usa.pipeline.com> <4jegvu$2ht@myst.plaza.ds.adp.com> <948@purr.demon.co.uk> <4k5rfj$kkk@seagoon.newcastle.edu.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 3.0b2 (X11; I; Linux 1.3.83 i486) Bruce R. McFarling wrote: > > rj@eli.wariat.org (Robert J. Brown) wrote: > >... > >Introducing Forth words without names is supposed to be provided for > >in ANS Forth by :NONAME, but my experience with PFE is that it doesn't > >work quite right yet, apparently due to compiler security issues. > > > >... The code: > >\ > >\ : foo bar baz ; : moby ... ['] foo ... ; > >\ > >\ may be replaced by: > >\ > >\ : moby ... { bar baz } ... ; > > What is this going to do when it hits Forth Scientific Project > type notation for vectors, matrices, etc.? This is just a naming issue, > of course, since I like the look of the underlying idea. If the intent is > to define something inline that takes the place of ['] foo, why not > > : moby ... [: bar baz ;] ... ; The { ... } is also used for local variables. Looks like there are too few different bracket/braces/parentesis style characters in the ASCII character set ;-). The idea of [: and ;] is good, however. -- Bernd Paysan "Late answers are wrong answers!" http://www.informatik.tu-muenchen.de/~paysan/ From: gordon@charlton.demon.co.uk (Gordon Charlton) Subject: Re: Reversible Forth? Date: Mon, 08 Apr 1996 20:36:13 +0100 Message-ID: References: <828369021snz@apvpeter.demon.co.uk> <4k9rss$ksj@usenet.srv.cis.pitt.edu> X-NNTP-Posting-Host: charlton.demon.co.uk In article <4k9rss$ksj@usenet.srv.cis.pitt.edu>, Rehana Rodrigues wrote: }Chris Jakeman wrote: } }> In an "April Fools' Day" item of the FIG UK magazine, Gordon Charlton }>> }> But seriously, has anyone tried writing a reversible Forth? }> }From : Anil Rodrigues via Rehana R: }If I understand you right I am highly skeptical that such is }possible. }If X Y AND result in Z, }then given Z and Y one cannot uniquely find X. }Or am I out in left field ? } IIRC (and it was a long time ago) Psychic Forth used an extra stack, demominated the History Stack, to record such information as was necessary to reconstruct previous states when running backwards. In your example AND would place Z on the Data Stack, and X and Y on the History Stack. The problem is that the History Stack tends to grow very large. This can be overcome by restricting the running backwards facility to jumping to marked points in the code, and pruning anything from the History Stack that is not necessary to return to a marked point in the code. There are a set of problems that are greatly simplified by this facility - those where the most desirable course of action cannot be determined in advance. Consider the quizshow game where one either takes the money or opens the box. The ideal approach is to elect to open the box, and if the prize therein is not desirable to travel back in time to the point before the decision was made and elect to take the money instead. Psychic Forth allows this. Gordon. From: MABS85B@prodigy.com (Leo Wong) Subject: Forth & Farming Date: 8 Apr 1996 20:07:57 GMT Message-ID: <4kbrmt$pn0@usenetp1.news.prodigy.com> Did I once say that Forth was computer husbandry? This paragraph from David Ehrenfeld, Beginning Again: People & Nature in the New Millennium (ISBN 0-19-507812-8) may be relevant: Sustainable agriculture has the potential of being presented to farmers the way computer hardware and software are often presented: as a user-friendly package whose technology does not have to be understood. The temptations to present it this way will be great. After all, as anyone who has tried to understand the mathematics of pest population dynamics or the economics of market systems is likely to agree, sustainable agriculture is not a simple business. But difficult as it may be, the designers of the new agriculture will have to resist the temptation to prepare simplified user-manuals that don't offer serious explanations of what is going on and that don't encourage farmers to modify and improve the system in light of their own practical experience. The experts should welcome the challenge to communicate with farmers in a reciprocal fashion, for once the method of the exchange has been worked out, research and discovery will proceed at a faster rate. And without this kind of communication we are bound to fail, much as modern medicine fails when it treats the patient as a consumer who has no right to participate in the design of his or her own recovery. No technology that treats the farmer as the last and bottom link in a hierarchically organized, expert-dominated chain of transmitted wisdom has a chance of success. Leo From: bouma@cs.purdue.edu (Bill Bouma) Subject: Re: Who needs the Forth text interpreter? Date: 8 Apr 1996 16:01:56 -0500 Message-ID: <4kbus4$8uu@deneb.cs.purdue.edu> References: <4k4fg4$cqt@ulke.hiMolde.no> In article <4k4fg4$cqt@ulke.hiMolde.no>, linkcom@moldenett.no (Pal Nyland) writes: |> Well, I can now forget about state-smart words. |> |> I can forget the problem of CHAR versus [CHAR], .( versus ." etc. |> I have to keep ['] though, as the original behaviour of ' (tick) still seems |> to be useful. |> |> There are no "compile-only" words anymore. IF..ELSE..THEN, |> BEGIN..WHILE..REPEAT, etc. may now be used outside colon definitions. On the surface, it looks like a good idea, but you really don't gain anything. I have experimented with this and there are a lot of tradeoffs. It doesn't really make Forth better, it just makes it different. For instance, what good are IF..ELSE..THEN on the command line? It doesn't work as a read time conditional since you automatically compile the whole thing before evaluation. Now you have certain words that behave differently inside/outside the construct, because you run words outside immediately, but you compile them when inside. |> This single-state interpreter/compiler is still new to me, and I have not yet |> evaluated every implication of the change. I have a good feeling, though. |> |> Any comments? A couple of times I have tried this and then gone back to the "normal" way. This last time I was going to write down all the things I didn't like about it, so that the next time I was tempted, I could refer back. But then I thought, 'Naaaa, I'll just remember it is a bad idea and not try it again.' -- Bill http://www.cs.purdue.edu/people/bouma -- The worm gets the late bird. From: flacy@crchha99.nortel.com (Mark Flacy) Subject: Re: Reversible Forth? Date: 08 Apr 1996 15:52:04 -0500 Message-ID: References: <828369021snz@apvpeter.demon.co.uk> <4k9rss$ksj@usenet.srv.cis.pitt.edu> In-reply-to: gordon@charlton.demon.co.uk's message of Mon, 08 Apr 1996 20:36:13 +0100 In article gordon@charlton.demon.co.uk (Gordon Charlton) writes: >IIRC (and it was a long time ago) Psychic Forth used an extra stack, >demominated the History Stack, to record such information as was necessary >to reconstruct previous states when running backwards. > >In your example AND would place Z on the Data Stack, and X and Y on the >History Stack. > >The problem is that the History Stack tends to grow very large. This can be >overcome by restricting the running backwards facility to jumping to marked >points in the code, and pruning anything from the History Stack that is not >necessary to return to a marked point in the code. > >There are a set of problems that are greatly simplified by this facility - >those where the most desirable course of action cannot be determined in >advance. > >Consider the quizshow game where one either takes the money or opens the >box. The ideal approach is to elect to open the box, and if the prize >therein is not desirable to travel back in time to the point before the >decision was made and elect to take the money instead. Psychic Forth allows >this. > >Gordon. > > Ouch! Let go of my leg! -- \ ---------------------------------------------------------------------- \ Mark A. Flacy | flacy@nortel.com | ESN 445-8347 \ | (214) 685-8347 | Department 2B51 \ ---------------------------------------------------------------------- \ Someday I may speak for Nortel. \ Someday pigs may howl at a full moon. \ Expect the latter to occur first. \ ---------------------------------------------------------------------- From: linkcom@moldenett.no (Pal Nyland) Subject: Re: Who needs the Forth text interpreter? Date: 8 Apr 1996 23:09:21 GMT Message-ID: <4kc6b1$oq2@ulke.hiMolde.no> References: <4k4fg4$cqt@ulke.hiMolde.no> In message <4kbus4$8uu@deneb.cs.purdue.edu> - bouma@cs.purdue.edu (Bill Bouma) writes: :> :> :>In article <4k4fg4$cqt@ulke.hiMolde.no>, linkcom@moldenett.no (Pal Nyland) writes: :>|> Well, I can now forget about state-smart words. :>|> :>|> I can forget the problem of CHAR versus [CHAR], .( versus ." etc. :>|> I have to keep ['] though, as the original behaviour of ' (tick) still seems :>|> to be useful. :>|> :>|> There are no "compile-only" words anymore. IF..ELSE..THEN, :>|> BEGIN..WHILE..REPEAT, etc. may now be used outside colon definitions. :> :>On the surface, it looks like a good idea, but you really don't gain :>anything. I have experimented with this and there are a lot of tradeoffs. :>It doesn't really make Forth better, it just makes it different. :> :>For instance, what good are IF..ELSE..THEN on the command line? It :>doesn't work as a read time conditional since you automatically compile :>the whole thing before evaluation. Now you have certain words that :>behave differently inside/outside the construct, because you run words :>outside immediately, but you compile them when inside. :> Yes, there are certain words that parse the input stream. When I think of the command line as all source code that is not part of colon or code definitions, I see many uses for IF..ELSE..THEN. :> :>|> This single-state interpreter/compiler is still new to me, and I have not yet :>|> evaluated every implication of the change. I have a good feeling, though. :>|> :>|> Any comments? :> :>A couple of times I have tried this and then gone back to the "normal" :>way. This last time I was going to write down all the things I didn't :>like about it, so that the next time I was tempted, I could refer back. :>But then I thought, 'Naaaa, I'll just remember it is a bad idea and not :>try it again.' :>-- :>Bill :>http://www.cs.purdue.edu/people/bouma -- The worm gets the late bird. I would be very interested if someone do remember why a compiling interpreter might be a bad idea. However, I still claim to have gained an advantage in not having to teach my kids two ways to print immediate strings. cr .( Hello ) : HELLO ( -- ) cr ." Hello" ; When iquired I can now tell my children to use dot-quote whithout first asking whether they want to print a string from the command line or from inside a word. And I think I can get away with this without beeing a state-smart-ass. Some points in favour of the compiling interpreter: - The outer interpreter is simpler (no more switching between compiling and interpreting). - State-smart words are gone. - Control structures on the command line is very velcome for embedded systems which are running from ROM, particulary if that system does not have a colon-compiler. - the added complexity of the compile buffer is very small. Regards Pal Nyland --- Pal Nyland Linkcom Business Development AS P.O. 197 N-6401 Molde Phone: +47 71215744 Fax: +47 71215717 Email: linkcom@moldenett.no From: gordon@charlton.demon.co.uk (Gordon Charlton) Subject: Re: Comments about comments (was: "Show-Tell-Straight-Narrow-") Date: Tue, 09 Apr 1996 00:48:23 +0100 Message-ID: References: <4jui0k$9ra@news.wco.com> <31640D7C.5872@forth.com> <3164E823.4F4A@immersive.com> <4k7sfl$e0e@seagoon.newcastle.edu.au> <31694864.7C07@forth.com> X-NNTP-Posting-Host: charlton.demon.co.uk In article <31694864.7C07@forth.com>, "Elizabeth D.Rather" wrote: }As I indicated previously, we are attempting to find the appropriate }model for porting these concepts to text-file source, but are finding }it more difficult. Can't resist this one... As you have pointed out to us, blocks are primarily let down by ill-considered editors. Text files are, internally, a sequence of characters delineated by CRs (or CR/LFs etc), and as such are convenient for printing on continuous feed paper. That does not mean they have to be displayed as such on a computer screen. Surely the best approach is to figure out how you would like code displayed whilst developing it, and write an editor around that. Sure - save the code to disk as a text file if that makes the world happy - it shouldn't hinder layered modularity, and will release programmers from the fixed size of modules determined by the block structure. Gordon. (Just what the world needs - another amateur who knows it all. :-) From: Tom Zimmer Subject: Re: Winf32Forth Date: Sun, 07 Apr 1996 19:10:39 +0000 Message-ID: <3168132F.6055@ix.netcom.com> References: <4k2560$3j2@newsbf02.news.aol.com> <828858669snz@mpeltd.demon.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-NETCOM-Date: Sun Apr 07 6:02:04 PM PDT 1996 X-Mailer: Mozilla 2.01 (Macintosh; I; PPC) Stephen Pelc wrote: > > In article <4k2560$3j2@newsbf02.news.aol.com> regnirps@aol.com "Regnirps" writes: > > Well, I guess I am hosed for the moment. ANy suggestions on downloading a > > vanilla DOS or 3.1 Forth? I normally use my PC just for compiling C for > > embedded micros and a PAL programmer, but I have a pair of 24 bit digital > > I/O cards to drive a simulator. The cards are supposed to look like 82XX > > or whatever the parallel chip is and I address them in the usual I/O space > > like $2C0, etc. ANy ideas? > ProForth for Windows will do this fine under W3.11 and W95. Under > NT you will need to add a GenPort driver. Actually, any Forth or C, or Pascal, or Basic should be able to do this under Windows 3.1 or Windows95, since they don't provide any protection from user access to the hardware. The most difficult problem Microsoft faces, is how to get their developers to modify existing programs to run under WindowsNT, which does protect itself from user access to hardware. And it does it in such a way, that no programmer in his (or her) right mind would want to access hardware after finding out what they have to do to access it. (did I just call all porgrammers insane?) So Microsoft in all it's wisdom has decided to develop a new common driver development system that will be common to both Windows95 and WindowsNT. The only question is will it be more difficult than the current driver development systems, or easier. I will let you guess. Tom Zimmer From: jcomeau@world.std.com (John O Comeau) Subject: Re: Reversible Forth? Message-ID: References: <828369021snz@apvpeter.demon.co.uk> Date: Tue, 9 Apr 1996 01:08:19 GMT Chris Jakeman (cjakeman@apvpeter.demon.co.uk) wrote: : Exploring this idea could be entertaining - but before I do, has anyone : else tried it in Forth or any other environment? I've never written such a thing but many editors use a journal file to allow "undo" to backtrack through your edits. You might consider something along those lines. - John -- jcomeau@world.std.com aka John Otis Lene Comeau Home page: http://world.std.com/~jcomeau/ Disclaimer: Don't risk anything of value based on my advice. Witty signature: (under construction) From: Dallas Legan Subject: Re: Forth & Farming Date: Tue, 9 Apr 1996 02:43:33 -0700 Message-ID: References: <4kbrmt$pn0@usenetp1.news.prodigy.com> <3169D5E7.70DB@tir.com> Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII In-Reply-To: <3169D5E7.70DB@tir.com> MAL>> MAL>> From mlosh@tir.comTue Apr 9 02:34:05 1996 MAL>> Date: Mon, 08 APR 1996 23:13:43 -0400 MAL>> From: "Michael A. Losh" MAL>> Newsgroups: comp.lang.forth MAL>> Subject: Re: Forth & Farming MAL>> MAL>> Leo Wong wrote: MAL>> > MAL>> > Did I once say that Forth was computer husbandry? MAL>> > ... MAL>> MAL>> Back in the May/June 1993 issue of Forth Dimentions was a letter from MAL>> Glen Dixon where he relayed an anecdote from Utah's govoernor, Mike MAL>> Leavitt, where Mr. Leavitt's farming grandfather "made do with an old MAL>> tractor for years and years, while his neighbor... had to have the MAL>> latest time-saving farm implement. When asked about his philosophy, the MAL>> grandfather said, 'I like to stick with what's real and right.' Over MAL>> time, the neighbor went broke paying for his equipment, while Mike's MAL>> grandfather thrived." MAL>> MAL>> Glen Dixon felt that Forth was "real and right." So do I. I enjoy MAL>> ......... MAL>> Equally, there is also no doubt that many software managers would prefer MAL>> an agri-industry approach: dump in the proper ratio of chemicals, MAL>> energy, genetic technology, equipment, biomass, and labor (a decreasing MAL>> ........... MAL>> I could take the analogy further. Any other opinions out there? MAL>> -- MAL>> Mike Losh mlosh@tir.com MAL>> I understand, that during the Korean War, the American fighter plane that had the highest ratio of "kills" to "being shot down" against the MIG-15 was not the state of the art (for the time) F-86 Sabre Jet, but the F-51 Mustang, largely because the pilots were so experienced from WW II, and knew the capabilities of the plane so thoroughly. Regards, Dallas E. Legan P.O. Box 2099 Downey, CA 90242 U.S.A. (310) 862 - 4854 dlegan@heart.engr.csulb.edu aw585@lafn.org delii@sc.liberty.com From: wilbaden@netcom.com (W.Baden) Subject: Re: 0123 Forth Message-ID: References: <4k0jaf$1sbs@usenetp1.news.prodigy.com> <4k38se$ff0@usenetp1.news.prodigy.com> <1996Apr9.003325.1@cc.newcastle.edu.au> Date: Mon, 8 Apr 1996 17:16:48 GMT \ This version is for real. ( Compute n[n+1][2n+1] == Sigma i**2 ) : SQUARE-SUM ( n -- Sigma i**2 ) DUP DUP 1+ * >R ( R: n[n+1]) 2* 1+ ( 2n+1) R> 6 */ ( Sigma i**2 )(R: ) ; \ No one has yet mentioned the error in my SUM-OF-SQUARES. This \ error would have been caught by a stack comment. It's fixed here. ( Sum of squares from lower_limit to higher_limit ) : SUM-OF-SQUARES ( lower_limit higher_limit -- sum_of_squares ) SQUARE-SUM SWAP ( sum lower_limit) 1- SQUARE-SUM - ( sum_of_squares ) ; \ SQUARE-SUM is indented because it is not intended to be an end-user \ word here. >R is used to avoid modifying the stack. Everything \ between >R and R> is indented so I won't forget to clear the rack. -- Procedamus in pace. Wil Baden Costa Mesa, California From: h9290246@hkuxa.hku.hk (Zsoter Andras) Subject: Re-post: Test results Message-ID: Date: Mon, 8 Apr 1996 19:32:14 GMT Last time I have posted some test results comparing pfe, gforth and doof on a Linux box. Anton Ertl was so kind to warn me that there was a caching problem on my machine. After some checks I discovered that for whatever reason the external cache was disabled when I ran the tests. So here is an upgraded version of the results: Machine (486 DX2-66) under Linux. The tests are those that came with gforth, except that I have executed sieve 300 times. The numbers are the time values which appear on the output of Linux's time command in the user column: sieve[*] bubble fib matrix pfe-0.9.14 13.94 51.90 58.67 42.55 gforth-0.1beta 8.76 34.01 33.50 27.42 doof-0.1.0 3.94 17.31 15.32 11.57 (This one generates machine code.) For comparasion fib in C (compiled with gcc, unoptimized): 8.82. Andras PS: I still would be interested in seeing some more test which are STANDARD and will run UNCHANGED on all of the above systems. PS: I hope this time everything is all right! From: Peter Bishop Subject: Re: Reversible Forth? Date: Tue, 09 Apr 1996 12:12:14 GMT Message-ID: <527656335wnr@adelard.demon.co.uk> References: <828369021snz@apvpeter.demon.co.uk> Reply-To: pgb@adelard.demon.co.uk X-NNTP-Posting-Host: adpgb.demon.co.uk X-Broken-Date: Tuesday, Apr 09, 1996 12.12.14 X-Mail2News-Path: relay-4.mail.demon.net!post.demon.co.uk!adpgb.demon.co.uk In article: <828369021snz@apvpeter.demon.co.uk> Chris Jakeman writes: > > Hi, > > In an "April Fools' Day" item of the FIG UK magazine, Gordon Charlton > published ('93) an item entitled 'Psychic Programming', which described a > Forth that ran backwards! > > But seriously, has anyone tried writing a reversible Forth? > Yes indeed, the concept is a general one - an arbitrarily complex calculation can be performed reversibly (see original refs on Landauer 1968 and Bennett 1973). The main significance is that it is possible to perform computations without using energy (no this is NOT an April Fools joke). Provided you can compute, save the answer, and reverse, the energy consumed is - in principle - arbirtrarily small. The energy is related to the amount of information disorder (analogous to entropy) - if you can reverse the calculation there is no additional disorder and hence no heat.. The concept has already been used to produce a reversible LISP (Baker 92), and people are thinking about inherently reversible computer instruction sets (Storrs-Hall 92). MIT have a whole group working on reversible computing, and there are implementations of reversible VLSI logic. I have implemented a simple reversible language built on top of an existing FORTH. As with all such designs you have to save "garbage data" to reconstruct the reverse with AND and OR you have to save *everything*. I will leave the reversal of IF THEN and DO LOOP structures as an execise for the reader. It is quite fun to see it undoing commands right back to the beginning. Be warned though, the reversible version of my language was 25 times slower than a direct implementation. For those interested here is a bibliography of references on reverisble computing Peter Bishop, Adelard % -*- LaTeX -*- %* Last edited: Nov 8 10:51 1995 (cvieri) @PhDThesis{marg, AUTHOR = "N. H. Margolus", TITLE = "Physics and Computation", SCHOOL = "MIT Artificial Intelligence Laboratory", YEAR = 1988 } @Unpublished{bart, author = "Edward Barton", title = "A Reversible Computer Using Conservative Logic", year = 1978, note = "Term paper for 6.895 at MIT" } % Fairly detailed design. Appears not to be concerned with energy recovery. @ARTICLE{ben1, AUTHOR = "C. H. Bennett", TITLE = "Logical Reversibility of Computation", JOURNAL = "IBM Journal of Research and Development", VOLUME = 6, YEAR = 1973, PAGES = "525-532" } @ARTICLE{ben2, AUTHOR = "C. H. Bennett", TITLE = "Notes on the history of reversible computation", JOURNAL = "IBM Journal of Research and Development", VOLUME = 32, YEAR = 1988, NUMBER = 1, PAGES = "281-288" } @ARTICLE{ben3, AUTHOR = "C. H. Bennett", TITLE = "The Thermodynamics of Computation, a Review", JOURNAL = "International Journal of Theoretical Physics", VOLUME = 21, YEAR = 1982, NUMBER = 12, PAGES = "905-940" } @ARTICLE{ben4, AUTHOR = "C. H. Bennett", TITLE = "Time/Space Trade-offs for Reversible Computation", JOURNAL = "Society for Industrial and Applied Mathematics Journal on Computing", VOLUME = 18, YEAR = 1989, NUMBER = 4, PAGES = "766-776" } @ARTICLE{land1, AUTHOR = "R. Landauer", TITLE = "Irreversibility and Heat Generation in the Computing Process", JOURNAL = "IBM Journal of Research and Development", VOLUME = 5, YEAR = 1961, PAGES = "183-191" } @ARTICLE{land2, AUTHOR = "R. Landauer", TITLE = "Uncertainty Principle and Minimal Energy Dissipation in the Computer", JOURNAL = "International Journal of Theoretical Physics", VOLUME = 21, YEAR = 1982, NUMBER = "3/4", PAGES = "283-297" } @ARTICLE{land3, AUTHOR = "R. Landauer", TITLE = "Computation: A Fundamental Physical View", JOURNAL = "Found. Physics", VOLUME = 16, YEAR = 1986, PAGES = "260-266" } @ARTICLE{feyn, AUTHOR = "R. P. Feynman", TITLE = "Quantum Mechanical Computers", JOURNAL = "Foundations of Physics", VOLUME = 16, YEAR = 1986, NUMBER = 6 } @InProceedings{yk1, AUTHOR = "Younis, S. G. and Knight, Jr., T. F.", TITLE = "Practical Implementation of Charge Recovering Asymptotically Zero Power {CMOS}", BOOKTITLE = "Proceedings of the 1993 Symposium in Integrated Systems", PUBLISHER = "MIT Press", YEAR = 1993, PAGES = "234-250" } @InProceedings{yk2, AUTHOR = "Younis, S. G. and Knight, Jr., T. F.", TITLE = "Asymptotically Zero Energy Split-Level Charge Recovery Logic", BOOKTITLE = "International Workshop on Low Power Design", YEAR = 1994, PAGES = "177-182" } @InProceedings{yk3, AUTHOR = "Younis, S. G. and Knight, Jr., T. F.", TITLE = "Harmonic Resonant Rail Drivers for Adiabatic Logic", BOOKTITLE = "Proceedings of the 1995 Symposium on Advanced Research in VLSI", PUBLISHER = "MIT Press", YEAR = 1995 } @PhDThesis{you, AUTHOR = "S. G. Younis", TITLE = "Asymptotically Zero Energy Computing Using Split-Level Charge Recovery Logic", SCHOOL = "MIT Artificial Intelligence Laboratory", YEAR = 1994 } @MastersThesis{ress2, AUTHOR = "A. L. Ressler", TITLE = "The Design of a Conservative Logic Computer and a Graphical Editor Simulator", SCHOOL = "MIT Artificial Intelligence Laboratory", YEAR = 1981 } @Misc{ress1, AUTHOR = "A. L. Ressler", TITLE = "Practical Circuits Using Conservative Reversible Logic", HOWPUBLISHED = "Bachelor's thesis, MIT", YEAR = 1979 } @BOOK{max, AUTHOR = "J. C. Maxwell", TITLE = "Theory of Heat", PUBLISHER = "Longmans, Green \& Co.", ADDRESS = "London", EDITION = "4th", YEAR = 1875 } @BOOK{max2, EDITOR = "Harvey S. Leff and Andrew F. Rex", TITLE = "Maxwell's demon : entropy, information, computing", PUBLISHER = "Princeton University Press", ADDRESS = "Princeton, N.J.", SERIES = "Princeton series in physics", YEAR = 1990 } @ARTICLE{szi, AUTHOR = "L. Szilard", TITLE = "On the Decrease of Entropy in a Thermodynamic System by the Intervention of Intelligent Beings", JOURNAL = {Zeitschrift f\"{u}r Physik}, VOLUME = 53, YEAR = 1929, PAGES = "840-852", NOTE = "English translation in {\em Behavioral Science}, 9:301-310, 1964" } @UNPUBLISHED{fred1, AUTHOR = "E. F. Fredkin and T. Toffoli", TITLE = "Design Principles for Achieving High-Performance Submicron Digital Technologies", NOTE = "DARPA Proposal", YEAR = "1978", MONTH = "November" } @ARTICLE{fred2, AUTHOR = "E. F. Fredkin and T. Toffoli", TITLE = "Conservative Logic", JOURNAL = "International Journal of Theoretical Physics", VOLUME = 21, NUMBER = "3/4", YEAR = 1982, PAGES = "219-253" } @ARTICLE{likh, AUTHOR = "K. K. Likharev", TITLE = "Classical and Quantum Limitations on Energy Consumption in Computation", JOURNAL = "International Journal of Theoretical Physics", VOLUME = 21, NUMBER = "3/4", YEAR = 1982, PAGES = "311-325" } @INPROCEEDINGS{bak, AUTHOR = "H. G. Baker", TITLE = "{NREVERSAL} of Fortune --- The Thermodynamics of Garbage Collection", BOOKTITLE = "International Workshop on Memory Management", EDITOR = "Y. Bekkers", PUBLISHER = "Springer-Verlag", YEAR = 1992, PAGES = "507-524" } @UNPUBLISHED{shor, AUTHOR = "P. W. Shor", YEAR = "1994", TITLE = "Algorithms for Quantum Computation: Discrete Log and Factoring", NOTE = "To appear, ACM 1994 Symposium on the Theory of Computers" } @INPROCEEDINGS{ka, AUTHOR = "J. G. Koller and W. C. Athas", TITLE = "Adiabatic Switching, Low Energy Computing, and the Physics of Storing and Erasing Information", BOOKTITLE = "Physics of Computation Workshop", YEAR = 1992 } @INPROCEEDINGS{hin, AUTHOR = "R. T. Hinman and M. F. Schlecht", TITLE = "Recovered Energy Logic: A single Clock {AC} Logic", BOOKTITLE = "International Workshop on Low Power Design", YEAR = 1994, PAGES = "153-158" } @INPROCEEDINGS{denk, AUTHOR = "J. S. Denker and S. C. Avery and A. G. Dickinson and A. Kramer and T. R. Wik", TITLE = "Adiabatic Computing with the {2N-2N2D} Logic Family", BOOKTITLE = "International Workshop on Low Power Design", YEAR = 1994, PAGES = "183-187" } @INPROCEEDINGS{hall1, AUTHOR = "Hall, J. Storrs", TITLE = "An Electroid Switching Model for Reversible Computer Architectures", BOOKTITLE = "Physics and Computation", MONTH = "October", PAGES = "237-247", YEAR = 1992 } @INPROCEEDINGS{hall2, AUTHOR = "J. Storrs Hall", TITLE = "A Reversible Instruction Set Architecture and Algorithms", BOOKTITLE = "Physics and Computation", MONTH = "November", YEAR = 1994, PAGES = "128-134" } % Retractile cascades. Reverse branch (``Come-from'') instructions. @BOOK{ph1, AUTHOR = "D. A. Patterson and J. L. Hennessy", TITLE = "Computer Architecture: A Quantitative Approach", PUBLISHER = "Morgan Kaufmann", ADDRESS = "San Mateo", YEAR = 1990 } @BOOK{ph2, AUTHOR = "D. A. Patterson and J. L. Hennessy", TITLE = "Computer Organization \& Design: The Hardware/Software Interface", PUBLISHER = "Morgan Kaufmann", YEAR = "1993", ADDRESS = "San Mateo"} @BOOK{ph2b, AUTHOR = "D. A. Patterson and J. L. Hennessy", TITLE = "Computer Organization \& Design: The Hardware/Software Interface", PUBLISHER = "Morgan Kaufmann", YEAR = "1993", ADDRESS = "San Mateo", EDITION = "BETA", NOTE = "From Uncorrected Preliminary Manuscript" } @ARTICLE{way, AUTHOR = "Wayner, P.", TITLE = "Silicon in Reverse", JOURNAL = "Byte", MONTH = "August", YEAR = "1994", PAGES = "67-74" } @INPROCEEDINGS{merk, AUTHOR = "Ralph C. Merkle", TITLE = "Towards Practical Reversible Logic", BOOKTITLE = "Physics and Computation", MONTH = "October", YEAR = 1992, PAGES = "227-228" } @INPROCEEDINGS{horo, AUTHOR = "T. Indermaur and M. Horowitz", TITLE = "Evaluation of Charge Recovery Circuits and Adiabatic Switching for Low Power {CMOS} Design", BOOKTITLE = "Low Power Electronics", YEAR = 1994, PAGES = "102-103" } @BOOK{mips, AUTHOR = "Gerry Kane and Joe Heinrich", TITLE = "{MIPS RISC} Architecture", PUBLISHER = "Prentice Hall", YEAR = 1992, } @MastersThesis{vieri, AUTHOR = "Carlin J. Vieri", TITLE = "Pendulum: A Reversible Computer Architecture", SCHOOL = "MIT Artificial Intelligence Laboratory", YEAR = 1995 } @INPROCEEDINGS{sol, AUTHOR = "Paul M. Solomon and David J. Frank", TITLE = "Power Measurements of Adiabatic circuits by thermoelectric technique", BOOKTITLE = "Symposium on Low Power Electronics", YEAR = 1995, PAGES = "18-19"} @ARTICLE{chuang, AUTHOR = "Isaac L. Chuang and Yoshihisa Yamamoto", TITLE = "Quantum Bit Regeneration", JOURNAL = "(unknown journal)", MONTH = "September", YEAR = "1995"} @incollection{neu, AUTHOR = "J von Neumann", title = "(unknown chapter)", bookTITLE = "Theory of Self-Reproducing Automata", EDITOR = "Arthur Burks", PUBLISHER = "University of Illinois Press", YEAR = 1966, PAGE = 66} @ARTICLE{levine, AUTHOR = "Robert Y. Levine and Alan T. Sherman", TITLE = "A Note on Bennett's Time-Space Tradeoff for Reversible Computation", JOURNAL = "Society for Industrial and Applied Mathematics Journal on Computing", VOLUME = 19, YEAR = 1990, NUMBER = 4, PAGES = "673-677" } @InProceedings{LiV96a, author = "Ming Li and Paul M.~B. Vit\'anyi", title = "Reversible Simulation of Irreversible Computation", booktitle = "Proc. 11th IEEE Conference on Computational Complexity", year = 1996, address = "Philadelphia, Pennsylvania", month = may#" 24--27,", annote = {Shows that Bennett's algorithm is optimal among algs that work by saving checkpoints and undoing}, } @Article{LiV96b, author = "Ming Li and Paul M.~B. Vit\'anyi", title = "Reversibility and adiabatic computation: trading time and space for energy", journal = "Proc. Royal Society of London, Series A", year = 1996, volume = 452, pages = "1--21", annote = "Includes LiV96a results and shows you can also do optimal Kolmogorov compression before discarding data" } ---------------------------------------------------------- Peter Bishop, Adelard, 3 Coborn Rd, London E3 2DA, England Tel : +44-181-983-0219 Fax: +44-181-983-1845 Email: pgb@adelard.co.uk From: wilbaden@netcom.com (W.Baden) Subject: Re: 0123 Forth Message-ID: References: <4kbb00$1mbc@usenetp1.news.prodigy.com> <4kbjej$glb@work.smurf.noris.de> Date: Mon, 8 Apr 1996 20:23:06 GMT The great paradox of Forth is that the language depends on stack manipulation but the repertoire of stack operations is meagre. Meagre, but sufficient. Only the following are required: DROP DUP OVER ROT SWAP 2DROP 2DUP 2OVER 2SWAP >R R@ R> These are more than enough to do anything you want with the stack. The Standard optionally allows: NIP PICK ROLL TUCK /STRING 2ROT 2>R 2R@ 2R> Part of the Art of Forth is minimizing stack operations, in particular avoiding the optional ones. With most definitions this is not a problem. Forth is optimized for definitions with one to three arguments. Even three can often be a pain. But the majority of definitions don't need more. This is so for profane languages as well. Whenever something changes the order or nature of what's on the stack, a stack comment is necessary. With such a comment you don't need additional stack operations. These changes should be infrequent. Optimizing SWAP ROT or ROT ROT etc should be left to the compiler. : SUM-OF-SQUARES ( lower_limit higher_limit -- sum_of_squares ) 1+ SWAP ( higher_limit+1 lower_limit) 0 ROT ROT ( sum higher_limit+1 lower_limit) DO ( sum) I DUP * + LOOP ( sum_of_squares) ; Thanks to Standard Forth, for me to program fluently I also want to have available 3DUPÊ3DROP 4DUP 4DROP BOUNDS UNDER+ R! R+! disdaining only 2ROT and ROLL. The Ancient Grand Masters disdain all of these. The Standard has increased the number of basic words needing three or more arguments. For instance, if you're going to massage character strings the stigma on PICK should be removed for the sake of writing readable code. If you mix Forth with profane language, the disdained words will be very helpful. Local variables are not an option for me. Forth with local variables is Tiny C with Postfix Operators. Don't change the Forth language. Change the compiler. -- Procedamus in pace. Wil Baden Costa Mesa, California From: wbaguhn@nyx10.cs.du.edu (Will Baguhn) Subject: Re: Help Please Fig Forth question from Forth beginner Date: 9 Apr 1996 07:32:28 -0600 Message-ID: <4kdotc$2it@nyx10.cs.du.edu> References: <4kb7vd$phg@soap.news.pipex.net> In article <4kb7vd$phg@soap.news.pipex.net>, Mike Gill wrote: >Anyone Help Please ! > >How can I assemble a number from a keyboard into a variable. >There are commands for incrementing variables, but what I need is to tye a >number at the keypad i.e. 123 and have 123 stored in the variable. > >Any advice appreciated > >Mike >ak32@dial.pipex.com (UK) > I'm going to skip a lot of the detail. Basically, you fetch a keystroke and determine it's a valid digit in the current base. Multiply your "accumulator" by the current base. add the digit to the accumulator. that's it. backspacing is easily accomplished as well. take accumulator, divide it by the base. (this may only work in integer, but that's the only kind of system i use. ;) ) From: Mike Gill Subject: Re: Help Please Fig Forth question from Forth beginner Date: 9 Apr 1996 14:05:09 GMT Message-ID: <4kdqql$2f@soap.news.pipex.net> References: <4kb7vd$phg@soap.news.pipex.net> <4kdotc$2it@nyx10.cs.du.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 1.1 (Windows; I; 16bit) Thanks Will, This is the way that I have been trying to do it, but its nice to know that I am on the right track. Not being as yet Forth minded, I am probably doing something back to front. Mike From: Timothy Ressel,Non,HP,Unkn Subject: Home Automation Forth Date: 9 Apr 1996 14:22:06 GMT Message-ID: <4kdrqe$skn@canyon.sr.hp.com> Anyone interested in a Forth which is customized for home automation? It has some nice features which make it quick and easy to program in. For example, my dampered HVAC code took a day to write and debug. -- Timster From: mikc@gnu.ai.mit.edu (Mike Coughlin) Subject: Re: WTB: Jupiter Ace Date: 9 Apr 1996 13:34:23 GMT Message-ID: <4kdp0v$jm3@life.ai.mit.edu> References: <4jp2uf$aqh@info-server.surrey.ac.uk> In article , James P. Meyer wrote: > I've never seen the insides of the Jupiter Ace, but the outsides >bear a strong family resembalance to the Sinclair ZX-80/81. Is there a >chance that the ROM is the only difference between the machines? In >other words, if you posted the contents of a Jupiter's ROM, could I burn >a replacement for my TS-1000 that would turn it into an Ace? > > How about posting the ROM contents anyway, just in case. > The Jupiter ACE almost certainly does not use the same circuitry as the Sinclair ZX-80/81. When Sinclair was first producing the ZX-80, another company made a computer that was a copy of the Sinclair circuit. This resulted in a lawsuit which Sinclair won. Thus the ACE had to be made differently to avoid the same lawsuit. There was a Forth ROM made for the ZX-81/TS-1000 which appeared at the very end of the useful life of the machine. Its author did not make nearly enough money to pay for his efforts. This code is copyrighted and could not be posted without permission. But why try to resurect the Jupiter ACE? It was a poor design even for its time. It used a cassette tape for storage which is totally unreliable and exceedingly slow. It did not even have a RAM socket that could use 32kx8 static RAM chips which were not available at the time but which were annoumced and could be designed for. It would be much better to design a whole new board for a modern processor and scsi disk drives. This could be a very simple design and low cost since there would be no need to be compatable with any currently popular giant operating system. Such a project could also be properly documented for whatever purpose it was intended. Eventually we will have a real Forth chip to use in such a project, and it will make using something like a Z-80 completely silly. -- Michael Coughlin mikc@gnu.ai.mit.edu Cambridge, MA USA From: pete@minster.york.ac.uk (Pete Fenelon) Subject: Re: WTB: Jupiter Ace Message-ID: <829063871.13444@minster.york.ac.uk> Date: 9 Apr 1996 15:31:11 GMT References: <4jp2uf$aqh@info-server.surrey.ac.uk> <4kdp0v$jm3@life.ai.mit.edu> On 9 Apr 1996 13:34:23 GMT, Mike Coughlin wrote: > But why try to resurect the Jupiter ACE? It was a poor design > even for its time. Indeed -- but retrocomputing dictates that the cheesier the machine, the more desirable it is. pete (who last used the very nice Bradley Software ForthMacs system on an Atari ST in about 1990) -- Peter Fenelon - Research Associate - High Integrity Systems Engineering Group, Dep't of Computer Science, University of York, York, YO1 5DD (+44 1904 433388) Mail: pete.fenelon@minster.york.ac.uk & http://dcpu1.cs.york.ac.uk:6666/~pete/ From: toma@wu.cse.tek.com (Thomas Almy) Subject: Re: Reversible Forth? Date: 9 Apr 1996 16:49:55 GMT Message-ID: <4ke4fj$qsf@tekadm1.cse.tek.com> References: <4k9rss$ksj@usenet.srv.cis.pitt.edu> Reply-To: tom.almy@tek.com This sort of facility is not the joke one might first expect. I used a version of LISP back in 1972 that had a backtracking facility like this that was terrific for puzzle solving. It consisted of two functions. The first was an N-way branch which contained alternative actions, and the second was a "fail" function. When you executed "fail" the program would backtrack to the closest branch and take the next alternative. If it ran out of alternatives, then that branch would in turn fail and execution would go back to a previous branch. It looks alot like catch/throw (which is available in both ANS Forth and in Common Lisp) *however* it also undid side effects such as assignment to variables. In Forth this could be handled by new defining words for variables that need to be backtracked. These defining words would link all such areas together so that the branch could save the variables somewhere. -- Tom Almy -- tom.almy@tek.com Standard Disclaimers Apply, including: "Any ideas or opinions expressed here do not necessarily reflect the ideas or opinions of my employer." From: M.L.Gassanenko Subject: Re: 0123 Forth Date: 9 Apr 1996 20:42:08 +0400 Message-ID: X-Return-Path: ttpl!ttpl.iias.spb.su!mlg "Bruce R. McFarling" wrote: > MABS85B@prodigy.com (Leo Wong) wrote: ... > >: SPIN ( x1 x2 x3 -- x3 x2 x1 ) > > SWAP ROT ; > > Is this a common name for this operation? It's one of the > primitive is use, e.g., to define ROT, except I called it FLIP. > > : ROT ( x1 x2 x3 -- x2 x3 x1 ) > \ ROTate the 3rd stack item to the top, pushing the top 2 items down > \ > SWAP FLIP > ; .... > > But should I call it SPIN? Or SWAP3? Or something else? I call it REV ---from REVerse or REVolve. REV ( a b c -- c b a ) I have noticed that it can be used frequently---if you got used to it. (I mean that e.g. when I read about TUCK the 1st time, I could not mention cases where I could use it when I was writing a program. I mentioned them only re-reading my code. Later I got used to this word and now I mention cases where it can be used.) Another such word is UDUP ( a b -- a a b ) --- M.L.Gassanenko mlg@iias.spb.su gml@agspbu.spb.su From: Elizabeth Rather Subject: Re: Comments about comments (was: "Show-Tell-Straight-Narrow-") Date: 9 Apr 1996 16:54:22 GMT Message-ID: <4ke4nu$il4@argentina.it.earthlink.net> References: <4jui0k$9ra@news.wco.com> <31640D7C.5872@forth.com> <3164E823.4F4A@immersive.com> <4k7sfl$e0e@seagoon.newcastle.edu.au> <31694864.7C07@forth.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 1.12(Macintosh; I; 68K) X-URL: news:AD8F6457966837750@charlton.demon.co.uk gordon@charlton.demon.co.uk (Gordon Charlton) wrote: >Surely the best approach is to figure out how you would like code displayed >whilst developing it, and write an editor around that. Sure - save the code >to disk as a text file if that makes the world happy - it shouldn't hinder >layered modularity, and will release programmers from the fixed size of >modules determined by the block structure. Precisely what we did...the displayed/editable/modular form is called "blocks" ;-) Elizabeth D. Rather FORTH, Inc. Products and services for 111 N. Sepulveda Blvd. professional Forth programmers Manhattan Beach, CA 90266 since 1973. See us at: 310-372-8493/fax 318-7130 http://home.earthlink.net/~forth/ From: MABS85B@prodigy.com (Leo Wong) Subject: Re: 0123 Forth Date: 9 Apr 1996 16:58:36 GMT Message-ID: <4ke4vs$1la8@usenetw1.news.prodigy.com> \ size of an address unit, cell, character \ display the number of bits in an address unit \ see ANS Forth document for other query strings : ADDRESS>BITS ( -- ) S" ADDRESS-UNITS-BITS" ENVIRONMENT? IF U. ELSE ." Query not answered." THEN ; \ display the number of address units in a cell : CELL>ADDRESSES ( -- ) 1 CELLS U. ; \ display the number of address units in a character : CHAR>ADDRESSES ( -- ) 0 CHAR+ U. ; \ a counting tool : UNDER+ ( n1 n2 n3 -- n1+n3 n2 ) ROT + SWAP ; \ highest on-bit in x : HI-BIT ( x -- u ) 0 SWAP BEGIN ?DUP WHILE 1 RSHIFT 1 UNDER+ REPEAT ; \ display the number of bits in a cell : CELL>BITS ( -- ) TRUE HI-BIT U. ; \ display the number of bits in a character : CHAR>BITS ( -- ) TRUE HERE C! HERE C@ HI-BIT U. ; \ Leo Wong From: M.L.Gassanenko Subject: Re: 0123 Forth Date: 9 Apr 1996 21:41:30 +0400 Message-ID: X-Return-Path: ttpl!ttpl.iias.spb.su!mlg > For instance, I would use : %123 SWAP ROT ; for SPIN (the TOS is number > one). TUCK ( x1 x2 -- x2 x1 x2 ) I'd name %121, and its inverse %-3. > > remember whether ROT fetches the third item up or tucks the first item two > down (it's the former; -ROT usually does the latter)), so I just write %213 > and %132 for them. I do similar things when I have to write in English and cannot remember a word: I use a word from another language. But in my final version I usually podchishchaju such words. I do not think that %11 %12 %-1 is more readable than dup swap drop for a Forth reader. I think that when stack manipulations are a problem, the best way is to acquire an intuitive feeling of "the last" element and of performing actions with "the last elements". One of the possible ways is to abstract from the notion of stack and to consider operations as just words of a language: e.g. SWAP changes the meaning of - in the phrase SWAP - . The % signs and digits break my feeling of "the last elements" (and more, I have to name and rename the values), I feel that I have to think about what had been easy, so I do not like the %231 %231 notation. Which is true: : %123 %132 %12 ; or : %123 %231 %12 ; or : %123 %12 %231 ; ? > ... stack permutations are damn difficult > to get right if you have something entirely different in mind ... You have not to understand the algorithm and the stack manipulations at the same time. The algorithm steps are denoted by meaningful words (like < References: <4jui0k$9ra@news.wco.com> <31640D7C.5872@forth.com> <3164E823.4F4A@immersive.com> In article <3164E823.4F4A@immersive.com>, Marc de Groot writes: ..... stuff ...... |> |> : FOO ( n -- m ) \ Transforms n to m |> X \ Get address of X \ |> + \ Add n to X \ |> @ \ Fetch content of (X+n) \ Frob n for purposes of blah blah... |> ; |> Hi I'll have to add my two cents. I think this is bad commenting and not vary readable. It shows the classic redundent comments that I consider to be a waste of time for both the programmer and the one reading the code. I do agree that the vertical coding is good but one should still try to keep in mind that each line should be a sentence or pharse. Not only that, but the name of the word is not vary good either. Even "X" shows a lack of meaning. If these kinds of examples are used as an indication of good quality code, we will have earned the un-readable label. The first rule of comments is, they should never be redundent. The second line with "\ Get address of X " is only exceptable because of the poor naming of "X". The third line " \ Add n to X " is completely redundent and misleading. The last line " \ Fetch content of (X+n)" is clearly a redundant restating of "X + @" and only has meaning to someone that has never seen Forth. This last comment would have been more appropriate on the first line if at all. I'll try to show what I mean: Assumes a lookup table to get a customer number from a PO#. : PO#>Cust# ( PO# - CustomerNumber ) PO#>Cust#Table + @ ; \ Translate PO# to Customer# One might then apply this to some other function that displayed the customers address from the PO#: : .CustAddr ( CustomerNumber - ) CustAddrStrings + @ \ Get mail address string count type ; : PO#>MailAddr ( PO# - ) PO#>Cust# DUP .CustName CR .CustAddr ; One might notice the lack of comments in that last code. This was done because there was nothing that wasn't redundent that I could think to say about the code that it didn't clearly say itself. Adding redundent comments would not have made to code any clearer to all but a beginner. I would hope that anyone reading my code would only be a beginner for a short time. You may also notice the way I indented the two "." words to be over each other. This tends to group the thoughts so that one tends to see them as similar or continuing functions of similar levels. Use of white space is important. When it works best if it is left white then leave it white. Programs should be a story. If there is some part of the story that wouldn't normally make sense then add a clear comment. A month back, I submitted the following piece of assembly code to show that comments can be a vary important part of a program. If one was to only put the redundent comments one would still be lost with the following: \ Input AX \ Output AX \ Effected DX & flags MOV DX, AX \ Mov AX to DX AND DX, # $4002 \ Mask of DX DEC DX \ Decrement DX SUB DX, # $4000 \ Subtract high part SBB DX, DX \ Subtract with barrow AND DX, # $4002 \ Mask DX again XOR AX, DX \ Xor result RET As you can clearly see, the comments tell vary little of what this interesting piece of code does. The challenge was to put an appropriate name on the routine and add meaningful comments. ( No fair having SVFIG members who know the answer cheat here ) Dwight From: Brad Rodriguez Subject: Re: Help Please Fig Forth question from Forth beginner Date: Tue, 09 Apr 1996 06:11:55 -0700 Message-ID: <316A621B.36D7@headwaters.com> References: <4kb7vd$phg@soap.news.pipex.net> <4kd2uf$lg5@soap.news.pipex.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 2.01 (Win16; I) Mike Gill wrote: > The idea is to store numbers in a > variable as typed and not as a complete number. To take the example 123, > 1st keypress would store 1, second keypress would store 2 (making 12 not > 3) third keypress would store 3 (making 123 not 6 as would simply adding > them together do). Assuming you have a word GET-DIGIT which reads a key and returns a number from 0 to 10... 0 VARIABLE ACCUMULATOR \ the '0' is required in FIG-Forth : ACCUMULATE-DIGIT ACCUMULATOR @ 10 * GET-DIGIT + ACCUMULATOR ! ; : 4-DIGITS 0 ACCUMULATOR ! 4 0 DO ACCUMULATE-DIGIT LOOP ; This neglects the problem of terminating when a non-digit is entered. -- Brad Rodriguez bj@headwaters.com Computers on the Small Scale Contributing Editor, The Computer Journal... http://www.psyber.com/~tcj Director, Forth Interest Group........... http://www.forth.org/fig.html 1996 Rochester Forth Conference: June 19-22 in Toronto, Ontario http://maccs.dcss.mcmaster.ca/~ns/96roch.html