Re: C-programmer needs Forth advice
- From: "werty" <werty@xxxxxxxxxxxxx>
- Date: 25 Nov 2005 00:53:35 -0800
ANSI Forth an obsolete Forth frowns on everything that is common
sense Forth . They argue til midnite on all the old stuff that is
"original"
C is for paychecks , Forth is for writting code or HLL .
There are 2 answers to your question , one is to help
you write better C to hide what you do and look a Wizard
C programmer ,
The other answer is to help you understand how easily
NewForth handles this problem .
See the paradox ?
Forth puts programers out of work by trivializing programming .
BTW My NewForth pocket PC will not need a LCD display nor QWERTY
keyboard.
It talks menus , you select an item from the menu , it "voice
Recognizes"
it ( big deal/Job ! It compares 4 voice words !! ) .
It uses HDD 20 GB and 128MB SDRAM and can "walk" around town with
you and tell you where you are and scold for missing appoinments ....
It is constantly "challenging" you ( making decisions ) , advising
you for it has in it's
database every street lamp , stop sign , post office , best place to
buy this
or that , .....Its compressed in 10 GB . Only NewForth could do
it .
And all here see it as a loss of their paycheck , thus im public
enemy # 1
Daniel wrote:
> Hi,
>
> I am a C and assembly programmer, so I think in variables and
> registers. I know Forth a bit, but I don't like stack juggling. Local
> variables seem to be frowned upon in Forth, so I wonder if you can
> really live without them. As an example, here's a typical C-function,
> can anybody tell me how can this be done in Forth? The function reads
> characters from a file, stores them in a buffer, zero-terminates the
> buffer, and returns the number of characters read.
>
> int read(char *buf, FILE *file)
> {
> int len = 0;
> int c;
>
> while ((c = fgetc(file)) != EOF)
> {
> *(buf++) = (char) c;
> len++;
> }
> *buf = 0;
> return len;
> }
>
> Thanks for any advice,
> Daniel
.
- Follow-Ups:
- Re: C-programmer needs Forth advice
- From: Larry Elmore
- Re: C-programmer needs Forth advice
- References:
- C-programmer needs Forth advice
- From: Daniel
- C-programmer needs Forth advice
- Prev by Date: Re: Forth for ADuC8xx?
- Next by Date: Re: C-programmer needs Forth advice
- Previous by thread: Re: C-programmer needs Forth advice
- Next by thread: Re: C-programmer needs Forth advice
- Index(es):
Relevant Pages
|