Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!tut.cis.ohio-state.edu!ucbvax!pasteur!ames!amdahl!pacbell!sactoh0!tree!stever From: stever@tree.uucp (Steve Rudek) Newsgroups: comp.lang.forth Subject: Re: interactive control structures Summary: 4)CHARACTER at a time interpretation. (How about ALL 4 modes?) Message-ID: <1990Jan7.031713.29770@tree.uucp> Date: 7 Jan 90 03:17:13 GMT References: <9001050440.AA25729@jade.berkeley.edu> <9167@medusa.cs.purdue.edu> Organization: TREE BBS (916)349-0385 Sacramento, Ca Lines: 81 In article <9167@medusa.cs.purdue.edu>, bouma@cs.purdue.EDU (William J. Bouma) writes: > In article <9001050440.AA25729@jade.berkeley.edu> Forth Interest Group International List writes: > >But, back to the discussion of the temporal aspects of interpretation > >and compilation: I see three possibilites: > > > >1) The traditional Forth model: A line of input is collected, then > > the words on that line are executed one-at-a-time > > > >2) The "compile-a-line-model": A line of input is collected, compiled > > as a unit, and then executed. (As in Antero Taivalsaari's system) > > > >3) The LaForth model: The system reads a word from the input device, > > executes it, reads the next word, executes it, etc. > > > >(3) appeals to me from an intellectual standpoint; the basic execution > > > The reason I like (1) is because I like command line history/editing. I've been thinking for a while that it would be nice to have the option of single character input to the interpreter so you could write single character "words". For instance, in F83 I keep typing "N L" or "A L" (display the next or the shadow screen). It would be neat to be able to switch the interpreter into single character interpretation mode and have words "N" and "A" which took these actions. Even better would be a "word completion" routine which monitored the input, one character at a time, and when it had sufficient characters to uniquely identify the word, typed the rest of the word to the screen and then passed the word to the interpreter for execution. That's how this system's bbs front end works and it is nice -- this scheme would allow you to use the convenience of single character input yet have more than 256 such "words". Why not let everyone have their cake and eat it too ... and let them choose WHEN they want to eat! Define a variable along the lines of "BASE" which would control the preferred input mode, 1 through 4. (It would be frosting if the key could be "hot wired" to pop you into single character mode--possibly switching to a vocabulary of single character words at the same time). One of the things which has always dumbfounded me about Forth and Forth programmers is how come there can be all these HOT programmers, working with source code to this HOT interpreter...and the interpreter interface remains so dismal and archaic. Yeah, I've seen F-PC now. It's a step in the right direction but it's not the end-all...and WHY did it have to wait until AFTER turbo pascal, quick basic, etc?. I've heard the standard disclaimer about how the vendors just don't want to preempt the Forth programmer's God-given right to 'roll his own' interface. But I don't buy that. What's the explanation for why the Forth interpreter interface is commonly sadly anachronistic? Surely it isn't as simple as a collective lack of imagination? I'm not talking about just "bells and whistles", either. Things like history stacks, full screen editors, interpret mode control structures, single character input "words" (as I'm propounding), hypertext facilities, visual run-time displays of the stacks in a separate window, tree editors, etc. are all relatively obvious ideas which would produce definite and substantial paybacks in programmer productivity. These ideas could have been and SHOULD have been appearing in Forth implementations way back at the beginning of the 80's. But it's the 90's...and these types of improvements (or comparable improvements, in the case of non-interpreted languages) are old hat in other languages and "cutting edge" in Forth implementations?? I'm admittedly not half the programmer many of you are. But WAY back in 1982 I got frustrated with the fact that Microsoft BASIC on my Osborne 01 CP/M machine didn't have a full screen editor. So I did the sensible thing. I disassembled the interpreter, discovered where its tokenizing, DOS, and main interpreter code were located. Then I PATCHED the interpreter so it would jump to an editor (which I'd written and previously loaded into high memory) anytime I pressed . The editor code would hotpatch BASIC to snag use of its tokenizing and detokenizing routines. It would let me edit my program and, when I pressed again, it would retokenize, remove the hotpatches in BASIC and jump back down to the interpreter. It worked quite well, thank you. And I didn't even have source to Microsoft BASIC (which was a tangled mess, by the way). What's YOUR excuse? Maybe Forth should resolve to LEAD the way in this new decade?? P.S. I've resolved to be "a kinder, gentler" critic in this new year. :-) -- -- {pacbell!sactoh0! OR ucdavis!csusac!}tree!stever