Path: csiph.com!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail From: "Rod Pemberton" Newsgroups: comp.lang.forth Subject: Re: Which scripting for embedded automation? Date: Thu, 30 Jul 2015 22:15:23 -0400 Organization: Aioe.org NNTP Server Lines: 63 Message-ID: References: <0e930740-22d8-4e2b-833f-bb5843437d0d@googlegroups.com> <40eef114-1b88-4c29-8937-f0a708a8e805@googlegroups.com> <2015Jul29.092237@mips.complang.tuwien.ac.at> <2015Jul30.144041@mips.complang.tuwien.ac.at> NNTP-Posting-Host: n4wpt9zq8xR26Ttf9mo2BA.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; 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:40994 On Thu, 30 Jul 2015 08:40:41 -0400, Anton Ertl wrote: > "Rod Pemberton" writes: >> On Wed, 29 Jul 2015 03:22:37 -0400, Anton Ertl wrote: >>> "Rod Pemberton" writes: >>>> Yes. Everything an 8-bit microprocessor can do, and the general >>>> purpose instructions of 16-bit processors, can be done directly in >>>> C without needing to use assembly. The only thing missing is a >>>> carry flag and an overflow flag. >>> >>> Yes, these are two things that you cannot express directly in C. >>> >>> Another big restriction of C is that you are limited in the kind >>> of control-flow you can do. >> >> This statement was in regards to threaded code, yes? >> Or, was that meant as a general comment on C's control-flow? > > As a general comment. I then gave several examples of what you > cannot do. Ok. That answers it. I was wondering if you were calling "threaded code" a type of control-flow or not. >>> Threaded code? Not in standard C. >> >> That's not true. I implemented my ITC Forth interpreter in pure >> ANSI C, i.e., no special features. It works the exact same way >> as a Forth interpreter in assembly, > > Show me the code, No. It's not released. > and I'll show you where it's not threaded code. Funny... But, I seriously doubt that. What is your rationale or presumption for that statement? ... >>> Coroutining? Nope. >> >> That's not true either. Again, it's just more difficult. >> C was designed for a single entry to a procedure, i.e., >> structured code. >> >> Simon Tathem's coroutines in C: >> http://www.chiark.greenend.org.uk/~sgtatham/coroutines.html > > That's cute. But that's just calls and returns, not real coroutining. > And it's also restricted to just one function; you cannot use this > technique if the emit() happens in a function called by the top-level > "coroutine". Consider a recursive tree walk as a coroutine; not with > this technique. I think you may be dismissing the technique too quickly ... IIRC, it's the basis of every threading and coroutine library for C. Rod Pemberton