Path: csiph.com!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail From: "Rod Pemberton" Newsgroups: comp.lang.forth Subject: Re: Epic Fail Date: Sat, 12 Apr 2014 06:18:56 -0400 Organization: Aioe.org NNTP Server Lines: 50 Message-ID: References: <2014Apr7.192923@mips.complang.tuwien.ac.at> <19597f37-fa23-478f-9a5f-b2aa66e89ae4@googlegroups.com> <2014Apr8.175427@mips.complang.tuwien.ac.at> <2014Apr9.181655@mips.complang.tuwien.ac.at> <64idnem648RzN9jOnZ2dnUVZ8iWdnZ2d@supernews.com> <4cde73fc-f677-4377-ac78-7f81ee13ae65@googlegroups.com> NNTP-Posting-Host: CNsg4fVcCsvs3UaOgZtQCw.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Opera Mail/12.16 (Linux) X-Notice: Filtered by postfilter v. 0.8.2 Xref: csiph.com comp.lang.forth:29558 On Sat, 12 Apr 2014 02:10:50 -0400, wrote: > By far however, the biggest blunder that Anton Ertl made in his {: was > to make the initial values of the locals "undefined." WTF??? This is an > incredibly bad idea. On one compiler they may get initialized to zero, > and on another to something else. Also, they may get initialized to > whatever happened to be in memory, so this will be a pretty much random > value from one run of the program to the next. The danger here is that > the programmer may have a bug in his program in that he uses a local > without explicitly initializing it. If that's true Hugh, I'd agree with you, in general. But, I'm coming from the C perspective that these should be treated like ? and cleared. Of course, C doesn't automatically clear auto or procedure local variables, which requires the programmer to do so. So, it's entirely possible that Forth should treat them the way Anton did too. > BTW: If I am a troll, then why am I the only person discussing Forth in > this thread? I've brought that up many times. No one here discusses Forth. Well, a few people do on occasion, but the majority generally don't, including those who criticize others for not discussing Forth. But, I'll discuss Forth if you like. What's a trivial way to implement a Forth optimizer in Forth? Maybe, put ten numbers, 0 to 9, on the stack, then redefine math and binary operations to do nothing, then execute a sequence of stack, math, and binary operations, and emit the stack (.S) to see the final order? How do you determine the lowest cost sequence? ... Drop the results back into a stack optimizer? > Nobody here really cares about C except Anton Ertl and Rod Pemberton, > [...] What about Paul Rubin? > Nobody here really cares about C except Anton Ertl and Rod Pemberton, > because they implemented their Forth systems in C --- but implementing > Forth system in C is utter foolishness! No, it's not. The way most C's in Forth are implemented is foolish. Those are done the C way, if you could call it that. But, I implemented mine the Forth way. It's implemented exactly like you would in assembly. This must be like the thirtieth time I've mentioned that now ... Rod Pemberton