Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Julian Fondren Newsgroups: comp.lang.forth Subject: Re: Forth Performance Question Date: Fri, 12 Aug 2011 08:15:04 -0500 Organization: A noiseless patient Spider Lines: 45 Message-ID: <86y5yy4vqf.fsf@gmail.com> References: <86zkjhjes4.fsf@gmail.com> <2011Aug11.182621@mips.complang.tuwien.ac.at> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx04.eternal-september.org; posting-host="cO8zBIpB9LiP7q+vFZIJrA"; logging-data="32717"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+wjFDeQ2F8b9CV2zLQ9xyDGEQcZn5gCZg=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (windows-nt) Cancel-Lock: sha1:gEavcCr8bAqf37nkCS9qVXEnGAY= sha1:lVxCusHiIDVhVf/C/ou1RTew2Wc= Xref: x330-a1.tempe.blueboxinc.net comp.lang.forth:4774 Arnold Doray writes: > So, while in C it would be easy to understand what > > for(int i = x; i < 10; ++i){ ... } > > does, in Forth, you would have to remember what ?DO, +DO, U+DO and > friends do on a case-by-case basis. You only have to know these words in the case that you're working on code that uses them, in which case you can look them up simply enough. For your own code, you don't need them; you only need DO . Or rather, you do not even need DO . You only run the risk of having someone come along to say "why don't you say ", which is not so awful a fate. Look: for (i = 0; i < 10; i++) ...; is just a convenient expression for i = 0; while (i < 10) { ... i++; } Which is in Forth 0 begin dup 10 < while ... 1+ repeat drop DO and friends are likewise just convenient words, and especially aren't a burden for a newbie who can avoid them in his own code. > So perhaps a better way to learn Forth would be to learn a small subset > of ANS Forth, rather than a stripped-down Forth-like variant language? > Any pointers to what this subset would be? You don't need to understand every single word that your system provides; therefore there's no need for a stripped-down system. And ANS Forth is _not_ big, so stripping that down is fairly pointless. Get any decent system, follow a tutorial maybe (I have fond memories of gforth's "crash course"), and start learning the language. At any given point you'll know the subset that you know. This is easier done than said.