On 9/7/13 12:05 PM, Paul Rubin wrote:
> "Elizabeth D. Rather" <
era...@forth.com> writes:
>> FORTH, Inc. has used tethered cross-compilers exclusively for embedded
>> systems programming since the mid-80's.
>
> Oh cool, so you don't use target-resident interpreters at all any more?
> Interesting.
Haven't for a very long time now.
>> there was a considerable learning curve .... A lot of this learning is
>> captured in the proposed cross-compiler standard,
>
> I did look at that and it seemed doable though there was an issue or two
> that I didn't completely understand.
You're welcome to ask :-)
>> although the present documents omit any discussion of the design and
>> operation of an umbilical link,
>
> Is that considered secret sauce, or is it just a matter of it not being
> standardized yet? Are there any publications? I had been thinking in
> terms of hacking up the gdb remote stub that is typically available for
> target processors these days, to handle the target-side communications.
At the time, it seemed that the important thing was to get the
cross-compiling standardized and then look at the umbilicals. It just
hasn't happened. The target side is really very simple.
>> The only real disadvantage I know of is that it's more difficult
>> technically to develop a tethered cross-compiler as a DIY project
>
> Yeah, that's the main part I wondered about. It also seems to me that
> the language has to be restricted a little, since you (e.g.) can't have
> target words running and affecting the compilation of later words the
> same way, or launching defining words or whatever. But I hope this
> isn't an issue in practice.
The only "restriction" (if you call it that) is that the target doesn't
normally have a compiler. It is possible, but that's the advanced
course, and not really appropriate or necessary most of the time.
>> For someone using one to write an embedded application, it's a pretty
>> nearly ideal programming environment.
>
> This sounds cool.
>
>> If you're developing for a high-volume target that needs an absolute
>> minimum amount of RAM, I would recommend using a target board during
>> development that has generally the same configuration but more
>> RAM. Your final code can be all resident in ROM or flash.
>
> That makes sense. I had figured the tiniest processors aren't really
> feasible targets because the stacks eat a fair amount of ram. I think
> some AVR's have only 24 bytes or so of ram, but they have a lot of
> registers (well, 32 minus a few special purpose ones). Maybe a smart
> enough optimizing compiler could get rid of most stack operations and
> slots, using the registers instead.
No, it's not the stacks that are a problem. What you want the extra RAM
for is so you can download new definitions into the target and test
them, without having to burn flash.
>> I'd really recommend that you spend some time using one of the
>> available evaluation systems to get a good feel for what it's like!
>
> One of these days I'd like to watch an expert hack on Forth code for a
> while. The thought processes seem different than other languages, which
> is one of the reasons I find Forth interesting.
Yws, it is somewhat different. You feel intimate with the system, not
like a person using an external tool. Think of a sculptor molding clay
with his bare hands. That's what it feels like. Thoughts turn into code
in what feels like an organic process.
> Regarding the evaluation systems, it's not real clear to me how one
> targets the system to a specific board. Are there docs about that?
The systems all come pre-configured for one of a list of boards. They're
all pretty cheap, and you may already have one. If not, you have the
ability to adjust most of the parameters. The only limitation on the
FORTH, Inc. evals is that you can't build a very large target
application. They all come with at least one, and sometimes several,
sample target apps to work with.