Re: Programming for Electronics Engineers

From: Keith Wootten (keith_at_nononono.co.uk)
Date: 01/24/05


Date: Mon, 24 Jan 2005 14:03:56 +0000

In message <35jt7dF4h5mn7U1@individual.net>, Paul Burke
<paul@scazon.com> writes
>Winfield Hill wrote:
>
>> Aha, two Forth fans!
>>
>Forth has been around for over 25 years now, and as one who was very
>keen on it in the early days- I saw it as a sort of MSI language, a bit
>like the more complex TTL as aginst simple gates- I think its day has
>long passed. In fact Forth any_good if people_using_it more then. It's
>just too easy to crash when you have to do your own stack shunting.

For embedded work, that's a good thing. Get all the bugs out before
release. In practice, stack balancing becomes second nature.

Forth on a stack machine is a thing of beauty. Very fast, and
deterministic. Interrupt latency is very small - there's nothing to
stack, it's already there!

The obsolete RTX2000 was a very, very nice part and at 10MHz would
outperform anything else I've come across with similar clock speed. The
Ignite1 is astonishingly rapid (www.ptsc.com) but is owned by a bunch of
suits. There are several FPGA stack machine implementations which look
very interesting.

C works as a reasonable assembler, but whoever thought up the use of =
and == should be shot. Slowly. I also dislike the stupid typing rules
which seem to exist so that the compiler can tell you that you've broken
them, and why can't I use any goddam character I want in a function or
other name. The pointer syntax seems to deliberately obfuscate a simple
concept.

>I don't think C is perfect, but it's widely available, and it does the
>job, even for 2k/128 byte targets, and it's got the low level dangerous
>things that allows people who know what they are doing to get on with it.
>
>Paul Burke

I have to use it sometimes too, but I'd be kicking and screaming at the
thought of 2KiB/128B work in C or Forth for that matter. For small PICs
I use my own assembler which allows Forth-like naming flexibility and
looping/branching constructs without trying to force a data stack onto
the poor thing and which runs under Win32Forth.

Cheers

-- 
Keith Wootten


Relevant Pages

  • Re: how to find the stack size used by a function
    ... I want to write a program in C using gcc compiler on red hat linux ... Paul Burke wrote: ... How to find out the stack size uesd by a function. ...
    (comp.arch.embedded)
  • Re: cheapest way for embedded TCP/IP stack?
    ... kathy wrote: ... ez80F91 has stack and MAC, ... You really need the programmer, ... Paul Burke ...
    (comp.arch.embedded)
  • Re: Whatever happened to Eric LaForest?
    ... The only work I am aware of is on stack scheduling for basic blocks, ... using special registers (this is the need for index registers I ... stack machine could have about the same net performance as a similarly ... Optimized MIPS code (inner loop only) ...
    (comp.lang.forth)
  • Re: Traditional COBOL environment
    ... believe was not a stack machine. ... None of the IBM hardware is stack-based, ... the post I replied to indicated the Wang VS had hardware-based ...
    (comp.lang.cobol)
  • Re: Traditional COBOL environment
    ... believe was not a stack machine. ... None of the IBM hardware is stack-based, ... HEAP storage and I believe there are now stacking instructions. ...
    (comp.lang.cobol)