From: C.D.A.Hellon@bradford.ac.uk (Xian the Desk Lizard) Subject: Re: Code Bloat Date: Sat, 15 Oct 1994 21:36:20 GMT Originator: cdahello@ccw505 On 14 Oct 1994 17:19:37 GMT, Darin Johnson gave us: \ Really, it's an unfair comparison to bring in MS stuff - any \ fool can make themselves look good next to it. Rubbish. MS stuff, bad as it may be, is "Commercial quality code" - which means it sells and works well. Thus anything better than that can legitimately claim to be very good. If that is achieved by proper design in the first place, then such design is still creditable as such, regardless of what MS did. -- Xian the Desk Lizard | Email: c.d.a.hellon@bradford.ac.uk | New .plan! Mostly depressed, | finger cdahello@muser.brad.ac.uk|more part-time thinker, | Fundamentalism today is what Americans claim they full-time dosser | fled Europe to escape. -- jon on a.a From: ehp@ear.co.at (Ewald Pfau) Subject: Double Division in Standard Forth Date: Sat, 15 Oct 94 04:38:32 CET Hallo Johannes! jgt@BBS.FORTH-eV.de (Johannes Teich, that's me) wrote: > : TU/MOD ( ut u -- u_rem ut_quot) >R 0 R@ UM/MOD R> SWAP > >R R@ UM/MOD R> SWAP > UM/MOD > ; Just to give this note since I needed it some weeks ago: : QQU/MOD ( q5 u -- u q) >R 0 R@ um/mod ( l m rh 'h) R> swap >R >R ( l m h) R@ um/mod ( l m rh 'h) R> swap >R >R ( l m h) R@ um/mod ( l m rh 'h) R> swap >R >R ( l m rh) R@ um/mod ( l rm 'm ) R> swap >R ( l rm u) um/mod ( rl 'l ) R> R> R> R> drop ; Had to do scaling, 2^64 2^16 2^16 xx*/ , so it needed 80 bit number for intermediate. I realized on Intel machines it would be better to have the first division being one with 0 as high word - so in any case the over flow will be avoided. Fine greetings... ... Ewald (is there some traffic in de.comp.lang.forth? I switched it on...) From: flacy@dip.eecs.umich.edu (Mark A Flacy) Subject: Re: Code Bloat Date: 16 Oct 1994 05:41:19 GMT <1994Oct15.213620.10251@bradford.ac.uk> In-reply-to: C.D.A.Hellon@bradford.ac.uk's message of Sat, 15 Oct 1994 21:36:20 GMT In article <1994Oct15.213620.10251@bradford.ac.uk> C.D.A.Hellon@bradford.ac.uk (Xian the Desk Lizard) writes: > >On 14 Oct 1994 17:19:37 GMT, Darin Johnson gave us: >\ Really, it's an unfair comparison to bring in MS stuff - any >\ fool can make themselves look good next to it. > >Rubbish. MS stuff, bad as it may be, is "Commercial quality code" - >which means it sells and works well. Thus anything better than that Rubbish to that. MS stuff merely _sells_ well. More a triumph of marketing than of content. >can legitimately claim to be very good. If that is achieved by proper >design in the first place, then such design is still creditable as >such, regardless of what MS did. >-- >Xian the Desk Lizard | Email: c.d.a.hellon@bradford.ac.uk | New .plan! > Mostly depressed, | finger cdahello@muser.brad.ac.uk|more > part-time thinker, | Fundamentalism today is what Americans claim they > full-time dosser | fled Europe to escape. -- jon on a.a -- / ------------------------------------------------------------------------ \ / Mark Flacy "There's a lot to be said for a blow to the head" \ / flacy@eecs.umich.edu - Blue Oyster Cult \ / "I guess ya had to be there." - Me \ From: flacy@dip.eecs.umich.edu (Mark A Flacy) Subject: Re: Code Bloat Date: 16 Oct 1994 05:53:12 GMT In-reply-to: djohnson@arnold.ucsd.edu's message of 15 Oct 94 05:22 GMT+0300 In article djohnson@arnold.ucsd.edu writes: > >Actually, as an aside. A friend is working on a program restructuring >tool for his thesis. Ie, it can automatically restructure a program >so that accesses to a set of global vars can be hidden behind a >function lagyer, and so forth. The target language is scheme, one of >the major reasons being that it is very simple to automatically (in a >program) this sort of factoring. The explicit parameter passing >helps here tremendously. > I'm being a little dumber than normal here ("Impossible!" they shout.), but I don't see the connection to Forth. Or the applicability to Forth, for that matter. [rest deleted] (Sorry. Moronic newsreader will simply _reject_ a message that has fewer new lines than old lines. Reject as in lose everything that I typed in.) -- / ------------------------------------------------------------------------ \ / Mark Flacy "There's a lot to be said for a blow to the head" \ / flacy@eecs.umich.edu - Blue Oyster Cult \ / "I guess ya had to be there." - Me \ From: CZINCK@fox.nstn.ns.ca (Chris Zinck) Subject: Code Bloat Date: 16 Oct 1994 15:09:37 -0300 Hi, I've been reading the thread on code bloat and watching all the back and forth :-) about languages affecting the end result of a system. I have a totally different theory about the cause and effect. Basically, FORTH attracts people who like small, efficient programming. C++ and the like attract people who have a much smaller interest in the efficiency of a program and don't worry about it. A good case in point are some of the large commercial applications that actually got shipped with debugging info still in the EXE! I suspect that FORTH programmers who use C tend to produce smaller, more efficient C programs than straight C programmers. Anyone care to comment? :-) TTYL, Chris Zinck Internet: czinck@fox.nstn.ns.ca Zinck Computer Group Limited Compuserve: 71307,613 Dartmouth, Nova Scotia Phone: (902) 468-2738 Fax: (902) 468-4304 "You can never get off the treadmill...just work on making it larger." Barry Mooney - May 13, 1993 From: penev@pisa.Rockefeller.edu (Penio Penev) Subject: Re: Forth in Forth? Reply-To: penev@venezia.rockefeller.edu Date: Sun, 16 Oct 94 16:06:55 EDT On Mon, 10 Oct 94 20:20:00 +0100 Tommy Hallgren (tommy.hallgren@flower.ct.se) wrote: | There must be some advantages in writing a forth in asm? None whatsoever. Whatever the advantages of assembly, they can be reached from within FORTH. And most of the advantages of FORTH cannot be reached from within assembly. | This sounds very interesting, but please enlighten me, what is a metacompiler? "Metacompiler" is what actually is called a "compiler" in the C realm. It trasforms source code to binary image, that can be loaded in the memory and executed by a processor, _after_ the whole binary image has been built. It differs from a "compiler" in the FORTH realm in several key ways. The most important is, that the newly produced image _cannot_ be execetuted, before everything is over. Other important differences are, that the assembly of the target pocessor, the address space, the dictionary structure, the memory layout, the width of the stack, or a number of other critical things can be different between the system, that processes the source code and the system, that will execute the binary. I prefer the term "target compiler", because it expesses the key idea of the process -- a binary for a target system has been produces. There is a distiction between "compiler" and a "cross-compiler" in the C realm. It is on the basis of whether the target system is identical to the compiling system or not. This distinction is vague in FORTH. -- Penio Penev 1-212-327-7423 From: djohnson@arnold.ucsd.edu (Darin Johnson) Subject: Re: Code Bloat Date: 17 Oct 1994 00:03:43 GMT In-reply-to: CZINCK@fox.nstn.ns.ca's message of 16 Oct 1994 15:09:37 -0300 > A good case in point are some of the large > commercial applications that actually got shipped with debugging info still in > the EXE! Actually, I leave debugging info in a program I maintain. Simpler to debug in the field. With the environment it runs in, it is difficult to narrow down the problem based upon a verbal description over the phone. > I suspect that FORTH programmers who use C tend to produce smaller, more > efficient C programs than straight C programmers. Earlier you mentioned C++. C++ and C programmers are different breeds altogether. -- Darin Johnson djohnson@ucsd.edu Support your right to own gnus. From: mikeh@zeta.org.au (Michael Hore) Subject: Re: PPC Assembler? Date: 17 Oct 1994 09:36:24 +1000 dnw@williams (David N. Williams) writes: >Before I start reinventing the wheel, does anybody know of a PD PPC >assembler in forth? David, do you want a generic PPC assembler or one that runs on Power Macs? When I release Mops version 2.5 (Mac only) it will have a PPC assembler, thanks to Xan Gregg who's developed it for the new version of MacForth and is letting me release it with Mops in exchange for some work I'm doing for him on parsing Apple's Universal Headers. -- Mike. ---------------------------------------------------------- Mike Hore mikeh@zeta.org.au ---------------------------------------------------------- From: l.squared@genie.geis.com Subject: FIG and John Hall Date: 16 Oct 1994 21:31:45 -0500 Sorry Mr. Hall, I have not gone away, nor will I give up. For this month I have two observations and three questions. 1. My records indicate that it has been over three years since we have been given a report on the number of members in FIG, despite several requests, both polite and otherwise. How many members are there, and what is the breakdown between the USA, Canada and other areas of the world? 2. Apparently, the only way to "legally" change the leadership of FIG is by petition. How can one generate a petition when "elections" are not announced, requirements are unknown, and deadlines are either undefined or unpublished? Given that Mr. Hall considers the membership list to be "private", how is it possible to generate a petition when one cannot find out who the members are? - L. Greg Lisle - From: kskim@sun630cc.nfup.ac.kr (Kim Kyung Sik) Subject: Forth in SUN? is it true? Date: 17 Oct 1994 04:11:26 GMT Hi, everyone. I found something for 'FORTH' in SUN(xterminal, classic.... etc ) but, I dont know why this in? and where are manual for this? ( i mean not forth syntax, just aid to SUN.. ) zywon * city-ID : 760111 - 1121916 From: gordon@charlton.demon.co.uk (Gordon Charlton)@charlton.demon.co.uk (Gordon Charlton) Subject: Re: Code Bloat Date: Sun, 16 Oct 1994 22:36:37 GMT In article flacy@dip.eecs.umich.edu (Mark A Flacy) writes: >Bottom line? Part of the Forth philosophy is to name your procedures >in a way that reflects what they do. Wrong. Don't name words for what they do, but for what they are FOR. The first example that springs to mind is; I have a word that divides the top two on stack by their greatest common denominator. That is what it does. What it is for is to normalise a rational number. I called it NORMAL, not 2GCD/ BCNU Gordon {gordon@charlton.demon.co.uk} From: gordon@charlton.demon.co.uk (Gordon Charlton)@charlton.demon.co.uk (Gordon Charlton) Subject: Re: Double Division in Standard Forth Date: Sun, 16 Oct 1994 23:11:50 GMT In article jgt@BBS.FORTH-eV.de (Johannes Teich) writes: > >\ signed double by signed single multiplication, triple result: >\ : TM* ( d n - t) ABS? >R -ROT DABS? R> XOR >R ROT >\ (Gordon's unsigned) T* R> IF TNEGATE THEN ; > >\ signed triple by signed single division, double result: >\ : TM/ ( t n - d) ABS? SWAP >R >R TABS? R> XOR R> SWAP >R >\ (Gordon's unsigned) T/ R> IF DNEGATE THEN ; > >\ signed multiply/divide, triple intermediate product: >\ : DM*/ ( d1 n1 n2 - d2) >R TM* R> TM/ ; > > >I would be happy to see a more elegant solution. > I did this for /MOD, not triple. The first time I came up with something like the above, but nastier as I wanted floored, not symetrical. The second time around I came up with something along the lines of (this is off the top of my head); : --/MOD ( handle case that both are negative) ... ; : -+/MOD ( handle negative dividend, positive divisor) ... ; : +-/MOD ( handle negative divisor, positive dividend) ... ; : ++/MOD ( handle case that both are positive) ; : /MOD ( dividend divisor--remainder quotient) DUP 0< 2>R 2DUP D0< R> 2>R ( two flags and divisoron return stack) DABS R> ABS UM/MOD R> IF R> IF --/MOD ELSE -+/MOD THEN ELSE R> IF -+/MOD ( ELSE ++/MOD ) \ this is a noop THEN THEN ; It's more understandable and took sooo much less debugging. Correcting this, adding the missing bits and extending to triple are, (as authors say when they can't be bothered to do it themselves, or don't want to have to address the messy bits that screw up their carefully crafted line of reasoning :-) are left as an exercise for the reader. In this instance it's because I can't find the original code. BCNU Gordon {gordon@charlton.demon.co.uk} From: buck@satyr.sylvan.com (Michael Butler) Subject: Re: a proposed computer Date: Mon, 17 Oct 1994 02:27:03 GMT >Definitions, Larry Forsley's new rag. Where can I learn more about this "new rag" of Larry's? > >--jvn >-- >Julian V. Noble >jvn@virginia.edu ............................................................................... "The problem with any unwritten law is that | buck@satyr.sylvan.com you don't know where to go to erase it." -- attributed to Glaser and Way From: gordon@charlton.demon.co.uk (Gordon Charlton)@charlton.demon.co.uk (Gordon Charlton) Subject: Re: FORTH for us youngin's Date: Mon, 17 Oct 1994 00:13:01 GMT In article <37mfpi$4kd@newsbf01.news.aol.com> erather@aol.com (Erather) writes: >Indeed, if your only interest in Forth is comparing and understanding a >variety of implementation strategies for personal purposes, you have no >budget and since the learning is its own reward you don't consider your >time as a cost, you are quite right in sucking up a bunch of freebies and >comparing them. However, don't give the impression to your boss or >colleagues at work that Forth is a neat toy whereas MS-C is a "real >system." You're comparing apples and oranges. Speaking as a hobbyist (who tries to adopt a serious approach to programming), my interest in Forth is as a means to learning other aspects of computer science. I regard time spent figuring out quirky Forths as a cost. I used a commercial Forth for many years and was very impressed by its stability and straight-forwardness (mpe's gemForth for Atari - no longer supported) and would happily spend my admittedly small budget on a Forth for the mac aimed at my end of the market, but no such product exists, as far as I know. Perhaps it ought to, pd C's exist, but it doesn't prevent the marketting of hobbyist level C's. OTOH, I am still forming an opinion on Wil Baden's ThisForth and so far it seems very stable and straight-forward, (if unusual). Acquiring it certainly didn't feel like "sucking up a bunch of freebies". BCNU Gordon {gordon@charlton.demon.co.uk} The first rule of Forth is; Horses For Courses. From: plewe@ks.mpi-dortmund.mpg.de (J.Plewe) Subject: Re: assistance with this4th Date: Tue, 18 Oct 1994 11:38:46 GMT Ulrich Hoffmann (uho@informatik.uni-kiel.d400.de) wrote: : In ehp@ear.co.at (Ewald Pfau) writes: : >> : place ( c-addr len c-addr' -- ) : >> \ Put the string given by C-ADDR LEN as counted string at address C-ADDR' : >> 2DUP C! CHAR+ SWAP CMOVE ; : > Please, move before setting: : > 2DUP >R >R CHAR+ SWAP MOVE R> R> C! : > You never know where the string comes from :-) : I'm sorry, I cannot follow. Do you mean the move will overwrite the : count? Or the moved string will contain the already modified count? : Can you please explain, Ewald? : Are there any reasonable uses of PLACE, where my implementation : fails to word whereas your succeeds? Examples? : P.S. : If you use MOVE instead of CMOVE to move characters, you : may add CHARS to convert the character count to address units : and avoid an environmental dependency on character size. : (i.e. SWAP CHARS MOVE vs. SWAP CMOVE) The problems arise when the strings overlap: S" hello" OVER 2+ PLACE will fail because the length of "hello" is stored into the string. Additionaly, CMOVE does not handle overlapping strings correctly, so your place will produce 000C8D71 68 65 05 68 65 05 68 65 00 00 00 00 00 00 00 00 he.he.he........ whereas Ewald's solution gives 000C8E71 68 65 05 68 65 6C 6C 6F 00 00 00 00 00 00 00 00 he.hello........ - Joerg From: plewe@ks.mpi-dortmund.mpg.de (J.Plewe) Subject: Re: assistance with this4th Date: Tue, 18 Oct 1994 12:12:43 GMT J.Plewe (plewe@ks.mpi-dortmund.mpg.de) wrote: : The problems arise when the strings overlap: : S" hello" OVER 2+ PLACE Oh, of course this is forbidden in an ANSI system, because a string given by S" is read-only. So the sequence produces an ambigous condition. Nevertheless, the fact remains the same. You may replace the S" expression by any other (writable) memory area. : - Joerg From: bruceb@efn.org (Bruce Berryhill) Subject: Re: FIG and John Hall Date: Mon, 17 Oct 1994 09:09:27 GMT I recently asked John to publish the FIG budget here on c.l.forth. He replied that if I wasn't a FIG member, it was none of my business. He didn't bother to reply to my snotty response asking him to prove that FIG wasn't his personal gold mine. Sorry Julian, Jax, Marlin, etc... If I can't see where my money would go, I won't join FIG. -- -bruceb From: uho@informatik.uni-kiel.d400.de (Ulrich Hoffmann) Subject: Re: Why PD when commercial is SOO much better? Date: 17 Oct 1994 11:26:13 +0100 In tommy.hallgren@flower.ct.se (Tommy Hallgren) writes: > UH> Would you please explain, why you think F-PC is poorly documented, given > UH> the User-Guide (included), The Reference-Guide by Ting and "Real Time > UH> Forth" by Tim Hendtlass? > All you get is a bunch of files. Named Chapter1-18 (I think) and some > more. This is the User-Guide. Included in the disk distrubution for those that do not want to spend a single cent on documentation. It is available in printed form at least from Offete Enterprises. > I've read most of them and I still don't get how parameters are > passed to a code-word, at least no more than one parameter. They are passed on the data stack. User Manual Chapter 8.4 (chapter8.txt): F-PC uses SP as the data stack pointer and BP as the return stack pointer. ... The help on code words (fpcwords.txt) explains precisely how the word 2+ works (okay, that's with one parameter only). An in depth tutorial on how to CODE words can be found in Tim Hendtlass 'Real time Forth'. > And how do you make an executable from your code? And I don't mean > something that is 170kb and writes 'Hello world' and includes the > entire system. You're talking about a technical feature of JFORTH, don't you. I know the JFORTH application stripper is outstanding. But this has little to do with your claim of poor documentation of the F-PC system. F-PC has a companion target compiler called TCOM to produce small executables as you desire. TCOM is as well documented as is F-PC. > Compared to JForth there are very few support files included that does > something useful. Look at TCOMs 70+ sample files. Look at the 60+ F-PC sample files in the distribution. Look at many user contributions available seperately. IMHO most of the sample files are usefull. > And the editor isn't the greatest either. I would prefer using > something more standard. Again, if you don't like the editor, this has nothing to do with poor documentation. Press F1 and choose the Editor help, poorely documented? I also see good reasons to buy commercial systems. Support is one of them. You don't get much (free) support when you use F-PC. But the claim "F-PC is poorly documented" is just not correct. It will not become right when repeated often enough. Greetings, Ulrich -- Ulrich Hoffmann, Uni Kiel WWW: http://www.informatik.uni-kiel.de/~uho/ Institut f. Informatik, email: uho@informatik.uni-kiel.de Preusserstr 1-9, D-24105 Kiel, Germany Tel: +49 431 560426 Fax: 566143 From: dnw@williams (David N. Williams) Subject: Re: PPC Assembler? Date: 17 Oct 1994 10:21:20 GMT Michael Hore (mikeh@zeta.org.au) wrote: : David, do you want a generic PPC assembler or one that runs on : Power Macs? When I release Mops version 2.5 (Mac only) it will : have a PPC assembler, thanks to Xan Gregg who's developed it for : the new version of MacForth and is letting me release it with : Mops in exchange for some work I'm doing for him on parsing : Apple's Universal Headers. For now, I need a PPC assembler that runs on the Mac. A colleague and I are cranking up to port his assembly language development system to the PowerMac, and a Forth assembler could help for occasional tests. For sure I'll grab Mops as soon as its available. David ------------------------------------------------------------------------ David N. Williams Phone: 1-(313)-764-5236 Physics Department Email: David.N.Williams@umich.edu University of Michigan Ann Arbor, MI 48109-1120 From: dnw@williams (David N. Williams) Subject: Re: PPC Assembler? Date: 17 Oct 1994 10:25:14 GMT David N. Williams (dnw@williams) wrote: : For now, I need a PPC assembler that runs on the Mac. A colleague ^^^ Correction! PowerMac David ------------------------------------------------------------------------ David N. Williams Phone: 1-(313)-764-5236 Physics Department Email: David.N.Williams@umich.edu University of Michigan Ann Arbor, MI 48109-1120 From: anton@mips.complang.tuwien.ac.at (Anton Ertl) Subject: Re: Code Bloat Date: 17 Oct 1994 11:09:03 GMT In article , djohnson@arnold.ucsd.edu (Darin Johnson) writes: |> > : It's a little easier to do that in Forth, due to the implicit |> > : parameter passing. (It's a cut and paste operation, adding a colon, |> > : semicolon, and the name.) And, yup, you can do that in other languages |> > : like C, but you'll still have to fiddle with the parameter lists. |> |> Actually, as an aside. A friend is working on a program restructuring |> tool for his thesis. Ie, it can automatically restructure a program |> so that accesses to a set of global vars can be hidden behind a |> function lagyer, and so forth. The target language is scheme, one of |> the major reasons being that it is very simple to automatically (in a |> program) this sort of factoring. The explicit parameter passing |> helps here tremendously. Hard to believe. I have the impression that people working on program transformation tend to like notations without named parameters, e.g., combinators. See, for example Backus' FP, which was designed for that purpose: No named parameters. The reason for this is that with named parameters you can get all kinds of name clashes which have to be resolved before the transformation can be performed. - anton -- M. Anton Ertl Some things have to be seen to be believed anton@mips.complang.tuwien.ac.at Most things have to be believed to be seen From: uho@informatik.uni-kiel.d400.de (Ulrich Hoffmann) Subject: Re: assistance with this4th Date: 17 Oct 1994 13:09:20 +0100 In josh@cgi.zeta.com (Jos'h Fuller) writes: > : character create ( something) > does> .name ." :" tab get-line ftype cr ; > the problem is, i don't know how to get the name of the word which is > currently executing. since ans (not to mention the structure of this4th) > precludes 'dump', i'm not sure how to retrieve it. > i need to have the word print its name at the beginning of the line, > using the hypothetical '.name'. > to sum up, i need to be able to have a word identify itself, and then > print its name. You can do this portably in ANS-Forth, but thisFORTH does not provide the necessary optional standard word definitions to do so. The ANS-Forth way: \ The words SAVE-INPUT and RESTORE-INPUT allow to reread the input stream \ in a portable way. If your system has only >IN you may also alter \ it to get a similar effect also suitable in this situation. \ Unfortunately thisFORTH has neither - so ask Wil Baden to provide one or \ the other. : ( xn ... x1 n -- ) RESTORE-INPUT ABORT" cannot restore input" ; \ -------------------- \ move counted strings : place ( c-addr len c-addr' -- ) \ Put the string given by C-ADDR LEN as counted string at address C-ADDR' 2DUP C! CHAR+ SWAP CMOVE ; \ -------------------- \ Lay down a word from the input stream as counted string in the current \ data area. 33 CONSTANT |word| \ 3.3.3.2 Contiguous regions \ WORD shall be at least 33 characters. : ,word ( -- ) \ allocate data area for next word in input stream HERE |word| CHARS ALLOT ( dataarea ) \ allocate suitable large data area BL WORD COUNT DUP >R ROT place \ move string to data area R> 1+ |word| - CHARS ALLOT \ adjust data area to string length ; \ -------------------- : character ( -- ) ,word DOES> COUNT TYPE ." :" ... ; Ulrich -- Ulrich Hoffmann, Uni Kiel WWW: http://www.informatik.uni-kiel.de/~uho/ Institut f. Informatik, email: uho@informatik.uni-kiel.de Preusserstr 1-9, D-24105 Kiel, Germany Tel: +49 431 560426 Fax: 566143 From: flacy@dip.eecs.umich.edu (Mark A Flacy) Subject: Re: Code Bloat Date: 17 Oct 1994 12:38:00 GMT <101@charlton.demon.co.uk> In-reply-to: gordon@charlton.demon.co.uk's message of Sun, 16 Oct 1994 22:36:37 GMT In article <101@charlton.demon.co.uk> gordon@charlton.demon.co.uk (Gordon Charlton)@charlton.demon.co.uk (Gordon Charlton) writes: > >In article flacy@dip.eecs.umich.edu >(Mark A Flacy) writes: > >>Bottom line? Part of the Forth philosophy is to name your procedures >>in a way that reflects what they do. > >Wrong. Don't name words for what they do, but for what they are FOR. > >The first example that springs to mind is; > >I have a word that divides the top two on stack by their greatest common >denominator. That is what it does. What it is for is to normalise a rational >number. I called it NORMAL, not 2GCD/ > Well, I'd argue that NORMAL reflects what what the word does (it normalizes the two numbers on the stack) versus its actions. But I'll agree that your comment is less confusing than mine and expresses what I meant to say. >BCNU Gordon {gordon@charlton.demon.co.uk} -- / ------------------------------------------------------------------------ \ / Mark Flacy "There's a lot to be said for a blow to the head" \ / flacy@eecs.umich.edu - Blue Oyster Cult \ / "I guess ya had to be there." - Me \ From: mikc@gnu.ai.mit.edu (Mike Coughlin) Subject: Re: Forth in Forth? Date: 17 Oct 1994 12:44:36 GMT In article <1994Oct16.160655.20151@rockyd>, Penio Penev wrote: >On Mon, 10 Oct 94 20:20:00 +0100 Tommy Hallgren (tommy.hallgren@flower.ct.se) wrote: > >| There must be some advantages in writing a forth in asm? > >None whatsoever. Whatever the advantages of assembly, they can be >reached from within FORTH. And most of the advantages of FORTH cannot >be reached from within assembly. One must keep in mind that a Forth system can exist without an assembler. Such systems are not suitable for general purpose programming by experienced workers. The versions of Forth available as assembly language source should be considered to be temporary kluges, and should be replaced with more complete versions of Forth written in Forth as soon as these are available. The advantages of a Forth assembler over a conventional assembler are so large that I consider the continued use of conventional assemblers to be the major failure in the marketing of Forth. -- Michael Coughlin mikc@gnu.ai.mit.edu Cambridge, MA USA From: mikc@gnu.ai.mit.edu (Mike Coughlin) Subject: Re: Forth in Forth? Date: 17 Oct 1994 13:01:03 GMT In article , Mike Haas wrote: >I have seen Forth-in-C offer valuable debugging services for >C programmers, but wonder if it is useful for any real-world >applications. I've not spent any great dwal of time with any >of them, but from the little I've seen, they seem to be too >slow for serious applications-based programming. Systems based on Unix and other operating systems written in C are documented for C programmers and do not come with the essential information needed for assembly language programers. I've been told that the easiest way to find out how an assembly language routine should be written for these systems is to write a short program in C that does almost what you want and look at the assembly language listing produced by the C compilier. So I conclude that writing a Forth system in assembler for such machines would produce faster and more efficient code, but it would take so much more time than writing a Forth in C that nobody has gotten around to doing it yet. -- Michael Coughlin mikc@gnu.ai.mit.edu Cambridge, MA USA From: CZINCK@fox.nstn.ns.ca (Chris Zinck) Subject: Re: Code Bloat Date: 17 Oct 1994 11:23:38 -0300 In article djohnson@arnold.ucsd.edu (Darin Johnson) writes: >From: djohnson@arnold.ucsd.edu (Darin Johnson) >Subject: Re: Code Bloat >Date: 17 Oct 1994 00:03:43 GMT >> A good case in point are some of the large >> commercial applications that actually got shipped with debugging info still in >> the EXE! >Actually, I leave debugging info in a program I maintain. Simpler >to debug in the field. With the environment it runs in, it is >difficult to narrow down the problem based upon a verbal description >over the phone. Sure, in a vertical application you might want to do that (does that mean the customer is in the debugger?). However, I can't remember which one it was, but the example I heard was a spreadsheet with a large installed base. Definitely not something I'd want to send out. (probably meant they had another full disk to ship even WITH compression). >> I suspect that FORTH programmers who use C tend to produce smaller, more >> efficient C programs than straight C programmers. >Earlier you mentioned C++. C++ and C programmers are different >breeds altogether. True, but I haven't really used the OOP part yet. I'm still using it like a better C. Even still, I think there are a lot of C programmers doing commercial apps that don't have that 'smallness gene' floating around like the people who use Forth. The Forth love/hate relationship is a good example of the filtering in action. There is of course some cross polination, but in general I think the theory fits. Chris Zinck Internet: czinck@fox.nstn.ns.ca Zinck Computer Group Limited Compuserve: 71307,613 Dartmouth, Nova Scotia Phone: (902) 468-2738 Fax: (902) 468-4304 "You can never get off the treadmill...just work on making it larger." Barry Mooney - May 13, 1993 Date: Tue, 18 Oct 1994 01:24:27 +0200 From: hs@4thware.gerwin.net (Hanno Schwalm) Subject: Forth for handheld --> Billies suggest hi, I was looking for a Forth system running on a small handheld DOS computer and someone called Billy (I 'lost' the mail) suggested PYGMY Forth ... I am very pleased! I used a NOVIX board with cmFORTH some years ago, so I feel quite at home. BUT i have no idea about DOS :-) Can anyone help me with PYGMY code for this pseudo-code? 1) char-serial-out ( char -- ) 2) char-serial-available ( -- flag ) 3) char-serial-in ( -- char ) 4) open-serial ( ?? -- ok? )  Hanno Schwalm hs@4thware.gerwin.net From: lct@vax1.mankato.msus.edu Subject: Parallel Forth? Date: 17 Oct 94 14:52:51 -0500 Our University has recently acquired a MasPar MP-1 computer. This is a massively parallel, SIMD architecture machine. I am interested in extending the Forth language for use in this type architecture. Each of the processing elements (2048 in our case) would have its own stacks: data stack, a return stack (not for addresses but for >r , r> etc.) and probably a float stack. Only the array control unit would contain executable code in its dictionary. I plan to approach this effort by using pfe as starting point. If you have any experience or ideas along this line, I would love to AVOID re-inventing or re-discovering what you already have. Thanks. --- Leon Tietz email: LCT@mankato.msus.edu Computer and Information Sciences voice: (507)389-5319 MSU Box 225 fax: (507)389-6376 Mankato State University Mankato, MN 56002-8400 From: C.D.A.Hellon@bradford.ac.uk (Xian the Desk Lizard) Subject: Re: Code Bloat Date: Tue, 18 Oct 1994 01:16:55 GMT Originator: cdahello@ccw202 On 16 Oct 1994 05:41:19 GMT, Mark A Flacy gave us: \ In article <1994Oct15.213620.10251@bradford.ac.uk> C.D.A.Hellon@bradford.ac.uk (Xian the Desk Lizard) writes: \ > \ >On 14 Oct 1994 17:19:37 GMT, Darin Johnson gave us: \ >\ Really, it's an unfair comparison to bring in MS stuff - any \ >\ fool can make themselves look good next to it. \ > \ >Rubbish. MS stuff, bad as it may be, is "Commercial quality code" - \ >which means it sells and works well. Thus anything better than that \ Rubbish to that. MS stuff merely _sells_ well. More a triumph of \ marketing than of content. No, it does work well too, except for that ridiculous Windoze thing. The trouble with MS stuff is that it assumes everybody owns a 486-DX33 with 400Mb hard drive just for word processing. That doesn't have any impact on the quality of the application. -- Xian the Desk Lizard | Email: c.d.a.hellon@bradford.ac.uk | New .plan! Mostly depressed, | finger cdahello@muser.brad.ac.uk|more part-time thinker, | Fundamentalism today is what Americans claim they full-time dosser | fled Europe to escape. -- jon on a.a Subject: Re: GAMES IN FORTH From: richard.beldyk@mecheng.fullfeed.com (Richard Beldyk) Date: Tue, 18 Oct 94 11:03:00 -0600 Thanks, I'm teaching 5 engineering courses this term so I have nbot gotten all the way through your book yet. Rich From: paysan@Informatik.TU-Muenchen.DE (Bernd Paysan) Subject: Re: assistance with this4th Date: 18 Oct 1994 18:34:28 GMT Originator: paysan@hphalle4a.informatik.tu-muenchen.de In article , plewe@ks.mpi-dortmund.mpg.de (J.Plewe) writes: >J.Plewe (plewe@ks.mpi-dortmund.mpg.de) wrote: > >: The problems arise when the strings overlap: > >: S" hello" OVER 2+ PLACE > >Oh, of course this is forbidden in an ANSI system, because a string >given by S" is read-only. So the sequence produces an ambigous condition. >Nevertheless, the fact remains the same. You may replace the S" expression >by any other (writable) memory area. This sequence would produce an ambigous condition, but what about pad dup 80 accept pad place ??? Certainly you could do pad char+ 80 accept pad c!, but what if you don't know where the string comes from when you want it to place into pad, because you need it as counted string in a scratch area? In this case, it is rather likely that you move a string from pad to pad, because you have needed a scratch area to get the string. -- Bernd Paysan "Late answers are wrong answers!" From: skip@taygeta.oc.nps.navy.mil (Skip Carter) Subject: Re: TCP/IP in Forth, was Re: ThisForth on the CRAY Reply-To: skip@taygeta.oc.nps.navy.mil (Skip Carter) Date: Tue, 18 Oct 1994 18:50:43 GMT In article <37vlma$6v8@funlwb.stl.dec.com>, cameron@mickie.sna.dec.com (James Cameron) writes: |> |> (Apologies to all, but this is my only method of speaking with Skip) |> |> Skip, |> |> Your web page has given me trouble too. |> |> URL: http://taygeta.oc.nps.navy.mil/skips_home.html |> |> And here is the text that my client received. It is unusual that the |> imbedded images are pointed to by ftp, could you use http instead? |> |> ........... These problems are caused by my machine being unable to properly reverse name the remote site. Since this reverse checking is not done with http, I have changed my page to send embedded images via http instead of ftp. Let me know if there are any other problems. -- Everett (Skip) Carter Phone: 408-656-3318 FAX: 408-656-2712 Naval Postgraduate School INTERNET: skip@taygeta.oc.nps.navy.mil Dept. of Oceanography, Code OC/CR UUCP: ...!uunet!taygeta!skip Monterey, CA. 93943 TELEMAIL: s.carter/omnet WWW: http://taygeta.oc.nps.navy.mil/skips_home.html From: erather@aol.com (Erather) Subject: Re: FORTH for us youngin's Date: 18 Oct 1994 15:13:01 -0400 In article <103@charlton.demon.co.uk>, gordon@charlton.demon.co.uk (Gordon Charlton)@charlton.demon.co.uk (Gordon Charlton) writes: >would happily spend my admittedly small budget on a Forth for the mac >aimed at my end of the market, but no such product exists, as far as I >know. Have your tried CSI's MacForth? We have reviewed it in detail and generally liked it very much, and it seems very reasonably priced. They have announced a native PowerMac version, too. From: djohnson@elvis.ucsd.edu (Darin Johnson) Subject: Re: Code Bloat Date: 17 Oct 1994 16:59:21 GMT <37tm0f$am7@news.tuwien.ac.at> In-reply-to: anton@mips.complang.tuwien.ac.at's message of 17 Oct 1994 11:09:03 GMT > |> The explicit parameter passing > |> helps here tremendously. > > Hard to believe. I have the impression that people working on program > transformation tend to like notations without named parameters, e.g., > combinators. Parameter names have little to do with this restructuring. I meant that the explicit function call delimiters were a big help. But the tool does have to worry about such things, but it's minor. It's much better to have named parameters than unnamed ones (but I suppose that in this group it's still up for debate - but even Forth has these as an option). > The reason for this is that with named > parameters you can get all kinds of name clashes which have to be > resolved before the transformation can be performed. This is a really minor problem with modern languages. Maybe FP has these problems, but it's ancient. If scoping can't handle it, then the tool can trivially rename the parameters. But most of the places this problem will crop up is in un-factoring (with factoring, you create a new function, and thus a new scope). -- Darin Johnson djohnson@ucsd.edu Where am I? In the village... What do you want? Information... From: andrejs@crl.com (Andrejs Vanags) Subject: Why assembler for speed? Date: 17 Oct 1994 09:58:35 -0700 Hello again, I've been trying to understand the interpreter and the 'guts' of F83, and I am greatly hampered by the recurring use of Assebler code where high level code should go, like in HASH, FIND, WORD, NEST, etc. (I can't read assembler). I end up trying to cross reference to F83S, FPC, e-Forth, pygmy etc. to see if I can find a help screen, or a high level definition. I understand perfectly the concept of testing in high level language, and then 'speeding' up the loop by translating to assembler. But when you think about it, this is not even necessary! (besides you might 'translate wrong', and therefore you still have to test and validate all over again) I think Forth gives you the ability to vector : or to define a new defining word C: or some such so that the compiler will search the inside of all the high level words with in it until it finds the assembler code, and then it would imbeb it in the dictionary. If SEE can recognize assembler words, why couldn't the compiler? the advantages of doing it this way would be: 1) Automatic translation, no errors (as the code to be executed does not change, just the intermediate word calls). 2) Portability. Only the barest absolute minimum of words would be coded in assembler, all the rest would be in high language. (Where the fast words would be compiled with C: such that assembler code is imbebed) 3) Readability. To help poor schmucks like myself. 4) Ease of updating (as result of above) Has any one tried or implemented this? Any info on the subject will be greatly appreciated, Andrejs Vanags andrejs@crl.com From: djohnson@elvis.ucsd.edu (Darin Johnson) Subject: Re: Forth in Forth? Date: 17 Oct 1994 17:06:54 GMT <36pspk$8f0@news.cerf.net> <37tsifINN32r@life.ai.mit.edu> In-reply-to: mikc@gnu.ai.mit.edu's message of 17 Oct 1994 13:01:03 GMT > So I conclude that writing a > Forth system in assembler for such machines would produce faster and > more efficient code, but it would take so much more time than writing > a Forth in C that nobody has gotten around to doing it yet. Plus it would be out of date real quick. What happens when you (or your market) switches to new architectures? Happens all the time in the UNIX world. Besides, now days, only a very experienced assembler programmer can beat state of the art compilers (I don't know about the PC world though). -- Darin Johnson djohnson@ucsd.edu -- Toy cows in Africa From: duncan@nic.cerf.net (Ray Duncan) Subject: Re: Forth in Forth? Date: 17 Oct 1994 16:44:33 GMT In article <37trjkINN2fj@life.ai.mit.edu> mikc@gnu.ai.mit.edu (Mike Coughlin) writes: > The advantages of a Forth assembler over a conventional assembler >are so large that I consider the continued use of conventional >assemblers to be the major failure in the marketing of Forth. This is not at all the case, except for the special case of writing Forth systems. Modern assemblers, although they may be fat and piggy as in the case of MASM 6.x, have many powerful features that are rarely or never found in Forth assemblers. The emphasis in writing a Forth assembler is typically to support the rapid porting of a kernel and/or the construction of relatively short machine language sequences for the purposes of pinhole-like optimizations of high-level Forth code. Structures, true macros, generalized support for forward references, support for multiple memory models, the ability to output standard relocatable object modules, usable printed program listings that include the generated machine code, generation of symbol tables for use with standard system-level debugging tools, and detailed error diagnostics are among the many programmer- friendly features of a modern conventional assembler that are *NOT* found in the typical Forth assembler. This is of course not a criticism of Forth assemblers, they do exactly what they are designed to do and they do it well, But to imagine that the current style of Forth assembler could and should replace conventional assemblers is simply preposterous. From: sinala@cs.tamu.edu (Sam Inala) Subject: Re: Local words and definitions? Date: 18 Oct 1994 20:52:05 GMT Reply-To: pinky@tamu.edu Keywords: ssa symbolic stack architecture forth Thus spake Billy Tanksley : >> >Sounds like you want SSA, or Symbolic Stack Architecture. There's a >> >package for F83 on asterix.inescn.pt in /pub/forth/ibm, [..] > >> Do you remember the filename? I found too many files to determine >> which one was the one I was looking for. > >Aside from the fact that it started with ssa, no. Try doing a 'dir ssa*' . I tried this: Logged into asterix.inescn.pt. NcFTP 1.0 (6 Dec 92) Ready. 1 NcFTP /pub/forth/ibm ->dir ss* 2 NcFTP /pub/forth/ibm ->ls ss* ss*: No such file or directory. Maybe it was moved? -- Till next time, \o/ \o/ V \o/ V email:pinky@tamu.edu <> Sam Inala <> V From: wilbaden@netcom.com (W.Baden) Subject: Re: assistance with this4th Date: Tue, 18 Oct 1994 16:28:05 GMT Here's one way to do it in This Forth. : CHARACTER GET-WORD 2DUP PLEASE "~ " CREATE 2DUP UPPERCASE ,STRING does> .name ." :" tab get-line ftype cr ; UPPERCASE and ,STRING are old friends who are re-introduced below. I never bothered with definitions of SAVE-INPUT and RESTORE-INPUT as I find them klunky, and TOLD and SOUGHT are more useful. I acknowledge my error, and will provide them in the future. : SAVE-INPUT source-id told 1 ; : RESTORE-INPUT drop source-id swap 0 fseek ; If you want, `source-id' may be replaced by `0', making them more near Standard and even less useful. : CHARACTER SAVE-INPUT CREATE RESTORE-INPUT ABORT" Can't RESTORE-INPUT " GET-WORD 2DUP UPPERCASE ,STRING does> .name ." :" tab get-line ftype cr ; Old friends -- : UPPERCASE ( s . -- ) CHARS OVER + SWAP ?DO I C@ >UPPER I C! 1 CHARS +LOOP ; : ,STRING DUP C, 0 DO COUNT C, LOOP DROP ; New friend -- : .name ( prints the name of a word) NEWLINE COUNT DUP MORE TYPE ; Procedamus in pace -- Wil From: ehp@ear.co.at (Ewald Pfau) Subject: assistance with this4th Date: Tue, 18 Oct 1994 22:41:32 X-FTN-To: Ulrich Hoffmann > Please, move before setting: > 2DUP >R >R CHAR+ SWAP MOVE R> R> C! > You never know where the string comes from :-) UH> I'm sorry, I cannot follow. Do you mean the move will UH> overwrite the count? Or the moved string will contain the UH> already modified count? Can you please explain, Ewald? Hallo Ulrich, Both may happen in a buggy way, when fields overlap. UH> Are there any reasonable uses of PLACE, where my UH> implementation fails to word whereas your succeeds? UH> Examples? : $ALLOC ( a n -- ) HERE OVER CHAR+ ALLOT PLACE ; : $= ( --) CREATE $ALLOC ALIGN DOES> ( -- a n) COUNT ; Make up string constants: S" ABC" $= 'ABC' S" DEF" $= 'DEF' You cannot be sure what is happing exactly at the address at HERE while setting thus a string constant (btw.: firstly ALLOC' then MOVE :-) ). UH> If you use MOVE instead of CMOVE to move characters, you UH> may add CHARS to convert the character count to address UH> units and avoid an environmental dependency on character UH> size. (i.e. SWAP CHARS MOVE vs. SWAP CMOVE) You caught me :-) I would have to change a lot of source files to accomodate this need. Since now I took "1 CHARS" to be 1. Hardly use the traditional CMOVE's any more. Should be CHAR+ SWAP CHARS MOVE then, ok. MOVE seems to be the ONLY word left acting upon address units (besides doing positioning in binary files). Hopefully this is not changed! So, by MOVE, portable 8@, 16@, 32@ and so on may be constructed as workarounds if length MUST be acted upon as being counted in bytes (so for instance in writing interfaces to existing methods for binary data fields). Or did I read the needs of ANS in a wrong way here? ... Ewald From: eichin@cygnus.com (Mark Eichin) Subject: Jax' Forth Book out of print? Date: 18 Oct 1994 17:26:42 -0400 I just tried to order Jax' "Forth: The New Model", and got back a message (from Quantum Books in Cambridge MA, quanbook@world.std.com) saying: > We tried ordering this book back in June for store stock, but we were told > that the book was out-of-stock with the publisher. Anyone heard of a reprint or other possible source? _Mark_ MIT Student Information Processing Board Cygnus Support From: jvn@fermi.clas.Virginia.EDU (Julian V. Noble) Subject: Re: a proposed computer Date: Tue, 18 Oct 1994 22:07:01 GMT buck@satyr.sylvan.com writes: Re: Definitions (Larry Forsley's new rag) > Where can I learn more about this "new rag" of Larry's? Call or write Rochester Forth Institute, 70 Elmwood Avenue Rochester, NY 14611 716 235 0168 --jvn -- Julian V. Noble jvn@virginia.edu From: jvn@fermi.clas.Virginia.EDU (Julian V. Noble) Subject: Re: Parallel Forth? Date: Tue, 18 Oct 1994 22:48:02 GMT lct@vax1.mankato.msus.edu writes: > > Our University has recently acquired a MasPar MP-1 computer. > This is a massively parallel, SIMD architecture machine. I > am interested in extending the Forth language for use in this > type architecture. Each of the processing elements (2048 in > our case) would have its own stacks: data stack, a return > stack (not for addresses but for >r , r> etc.) and probably > a float stack. Only the array control unit would contain > executable code in its dictionary. > > I plan to approach this effort by using pfe as starting point. > If you have any experience or ideas along this line, I would > love to AVOID re-inventing or re-discovering what you already have. > > Thanks. If I recall correctly, NASA programmed its Massively Parallel Array in Forth. Maybe you should ask them. Also the Cellular Automaton Machine at MIT was controlled using Forth. Perhaps some of the people involved could be of assistance. --jvn -- Julian V. Noble jvn@virginia.edu From: roedy@BIX.com (Roedy Green) Subject: postfix assemblers Date: Wed, 19 Oct 1994 09:06:34 Ray pointed out the drawbacks of typical Forth assemblers. Here are some of the advantages: 1. rapid testing cycle. This is the number one advantage, especially when you are writing code that interacts with a device. 2. unambiguous indirection. In regular assembler, which is partially a typed language, I never feel confident I am jumping to an address in a register, or the address pointed to by the register. 3. You can use structured IFs, rather than making up local jump-to names. 4. patching. You have precise control of long-short constants etc. This way you can guarantee a particular form if you plan to patch the code later in the compilation process. Roedy@bix.com -30- From: CZINCK@fox.nstn.ns.ca (Chris Zinck) Subject: Re: Code Bloat Date: 19 Oct 1994 12:04:08 -0300 In article rockwell@nova.umd.edu (Raul Deluth Miller) writes: >From: rockwell@nova.umd.edu (Raul Deluth Miller) >Subject: Re: Code Bloat >Date: 19 Oct 1994 07:52:22 -0400 >Aaron+Chris Waters: >: Only in part, I suspect. Speaking only from my own experience as a >: top-notch Forth programmer who learned C because of the larger job >: market: I had, at first, a definite tendency to OVERfactor in C, >: resulting in smallish but not-particularly-efficient programs. I >: had to learn to "grok" C, just as I had had to learn to "grok" >: Forth, before I could really write optimal C code. >That's an artifact of the C compiler you were using. >I use a C compiler that will inline many of the functions when it's >generating code and do other things to make C function calls lighter. >Raul D. Miller n =: p*q NB. 9<##:##:n [.large prime p, q > y =: n&|&(*&x)^:e 1 NB. -.1 e.e e.&factors<:p,q [.e NB. public e, n, y > x -: n&|&(*&y)^:d 1 NB. 1=(d*e)+.p*&<:q Ya but.....Doesn't that just bounce the problem back into the realm of Code Bloat? Chris Zinck Internet: czinck@fox.nstn.ns.ca Zinck Computer Group Limited Compuserve: 71307,613 Dartmouth, Nova Scotia Phone: (902) 468-2738 Fax: (902) 468-4304 "You can never get off the treadmill...just work on making it larger." Barry Mooney - May 13, 1993 From: anton@mips.complang.tuwien.ac.at (Anton Ertl) Subject: Re: ANS Forth file name extensions--consensus? Date: 19 Oct 1994 16:17:45 GMT In article , rockwell@nova.umd.edu (Raul Deluth Miller) writes: |> David N. Williams: |> How about .4th, or .fth? |> |> how about .4 ? Clashes with UNIX section 4 manual pages I like .fs because .f clashes with Fortran and I want to differentiate between stream and block files (block files get .fb). - anton -- M. Anton Ertl Some things have to be seen to be believed anton@mips.complang.tuwien.ac.at Most things have to be believed to be seen From: anton@mips.complang.tuwien.ac.at (Anton Ertl) Subject: Re: Proposal: Tag for ANSI systems Date: 19 Oct 1994 16:34:53 GMT In article <75LTBEJO@gwdu03.gwdg.de>, plewe@ks.mpi-dortmund.mpg.de (J.Plewe) writes: |> ANSI Forth systems are ANSI Forth systems. Ok. |> But sometimes they have special feature which may be useful. |> In these cases, it would be nice to have a possibility to check |> on which system an application is running or to be compiled. |> Therefore I propose to all providers of ANSI Forth systems to |> include a tag into theire implementation like: |> |> CONSTANT |> |> Perhaps is spelled in mixed case (e.g. F68kAns), so |> that inference with application words will be unlikely. |> Maybe the same can be done with ENVIRONMENT?, but I cannot see |> advantages or disadvantages. The advantage of environmental queries is that ANS compliant programs cannot define new ones. I.e., your systemname cannot be shadowed. Environmental queries were designed for such things, so they probably should be used for that. Hmm, since the systemnames are not standardized, what's the point of creating such a convention? - anton -- M. Anton Ertl Some things have to be seen to be believed anton@mips.complang.tuwien.ac.at Most things have to be believed to be seen From: jvn@fermi.clas.Virginia.EDU (Julian V. Noble) Subject: Re: Why assembler for speed? Date: Wed, 19 Oct 1994 16:15:09 GMT andrejs@crl.com writes: [ deleted ] > I understand perfectly the concept of testing in high level language, and > then 'speeding' up the loop by translating to assembler. But when you > think about it, this is not even necessary! (besides you might 'translate > wrong', and therefore you still have to test and validate all over again) You have to test and validate every change to a program. This will be true even with the kind of optimizer you are describing. > I think Forth gives you the ability to vector : or to define a new > defining word C: or some such so that the compiler will search the inside > of all the high level words with in it until it finds the assembler code, > and then it would imbeb it in the dictionary. If SEE can recognize > assembler words, why couldn't the compiler? the advantages of doing it > this way would be: > > 1) Automatic translation, no errors (as the code to be executed does not > change, just the intermediate word calls). Wrong. One does not necessarily want merely to translate to inline code, one also would like to eliminate redundant pushes and pops. Moreover, an automatic inliner has other problems, especially with multiple-code-field words defined with VALUE and the like. I know, I have used an excellent one for years. > 2) Portability. Only the barest absolute minimum of words would be coded > in assembler, all the rest would be in high language. (Where the fast > words would be compiled with C: such that assembler code is imbebed) Only portable if each vendor supplies an inline optimizer. On some Forths such a beast will be baroque, to say the least. > 3) Readability. To help poor schmucks like myself. > 4) Ease of updating (as result of above) > > Has any one tried or implemented this? Yes, HS/FORTH has a recursive-descent optimizer. Produces execution speeds within 2x best assembler. Eliminates redundant push/pop pairs, etc. -- Julian V. Noble jvn@virginia.edu From: phil@3do.com (Phil Burk) Subject: 'C' based Forths Date: 19 Oct 1994 08:56:38 GMT I am getting tired of writing Forth for new processors all the time. I have been experimenting with 'C' based Forths and am becoming convinced that this is the way to go. Yeah, they're slower than native Forths but on todays CPUs, who cares. I have written a simple 'C' based Forth and was surprised at how quickly it came together. I move it back and forth between SUN, SGI and Mac and don't have to touch the source. This is the last Forth I will ever have to write. I would like to come up with a list of all the 'C' based Forths and where to get them. Is there such a list? If not, here is the start of a list with the one's I know about so far. "Tile Forth" by who? - part of GNU package. PD. Is it ANSI? Where is it? "CForth" by Mitch Bradley - commercial package from Bradley Forthware. Is there an ANSI version now? "PFE, the Portable Forth Environment" by Dirk Uwe Zoller. PD. ANSI compatible (I think.) Where can I get this? What else? Can anyone help me fill in the huge gaps in this list? Thanks mucho. ----------------------- Phil Burk, phil@3do.com ----------------------- From: gordon@charlton.demon.co.uk (Gordon Charlton)@charlton.demon.co.uk (Gordon Charlton) Subject: Re: assistance with this4th Date: Wed, 19 Oct 1994 21:21:12 GMT In article <37tphg$fu4@minnie.informatik.uni-kiel.de> uho@informatik.uni-kiel.d400.de (Ulrich Hoffmann) writes: >The ANS-Forth way: > >\ The words SAVE-INPUT and RESTORE-INPUT allow to reread the input stream >\ in a portable way. If your system has only >IN you may also alter >\ it to get a similar effect also suitable in this situation. >\ Unfortunately thisFORTH has neither - so ask Wil Baden to provide one or >\ the other. > >: SAVE-INPUT ; > >: input-source> ( xn ... x1 n -- ) > RESTORE-INPUT ABORT" cannot restore input" ; > I haven't thought about it too hard, but I suspect it may be possible to do this in high level ThisForth. SAVE-INPUT would need to modify words that draw characters from the stream to add them to a buffer, and then RESTORE-INPUT could reinsert the buffer into the data stream. Of course making them nestable may be a bit hairy. BCNU Gordon {gordon@charlton.demon.co.uk} From: gordon@charlton.demon.co.uk (Gordon Charlton)@charlton.demon.co.uk (Gordon Charlton) Subject: Re: FIG and John Hall Date: Wed, 19 Oct 1994 21:28:39 GMT In article <199410170231.AA146251068@relay2.geis.com> l.squared@genie.geis.com writes: > > Sorry Mr. Hall, I have not gone away, nor will I give up. For this >month I have two observations and three questions. > How about apologising to those of us who come to comp.lang.forth to talk about the computer language Forth? Why not set up a new group called i.e. alt.fig.whinge.whine.moan ? I would vote in favour. BCNU (not!) Gordon From: gordon@charlton.demon.co.uk (Gordon Charlton)@charlton.demon.co.uk (Gordon Charlton) Subject: Re: Forth in SUN? is it true? Date: Wed, 19 Oct 1994 21:40:38 GMT In article <37sthe$2lo@news.kreonet.re.kr> kskim@sun630cc.nfup.ac.kr (Kim Kyung Sik) writes: >Hi, everyone. >I found something for 'FORTH' in SUN(xterminal, classic.... etc ) >but, I dont know why this in? and >where are manual for this? ( i mean not forth syntax, just aid to SUN.. ) > >zywon * city-ID : 760111 - 1121916 Yes, its true. Hit [STOP]+A on a sparc station during boot, and then N at the > prompt. Now try WORDS Why? I quote Mich Bradley (chairman, Open boot Working Group) from the euroForml Proceedings 1991 "Open boot is a portable, CPU independant firmware system, based on the Forth programming language. Open boot is currently available on more than 400,000 desktop SPARCstation computers, and can be easily adapted for use on nearly any general-purpose computer system. The IEEE P1275 Open Boot Working Group is developing a proposed IEEE standard for boot firmware based on Open Boot." BCNU Gordon {gordon@charlton.demon.co.uk} Shorter hours, longer arms You don't need to grease their palms -- Rise Of The Robots - The Stranglers