[comp.lang.forth] Efficiency of portable C

wmb@MITCH.ENG.SUN.COM (Mitch Bradley) (01/11/91)

> > In the C "wrapper" programs that I use for interfacing Forth to various
> > operating systems, I avoid printf(), instead using puts().  If I need to
> > display numbers, I write my own "puti()" routine.
>
> All this says is that efficiently coded ( sizewise ) "C" is nonstandard.
> What good is a standard "C"? About as good as a standard FORTH!

Huh?  What is non-standard about puts()?  What is non-standard about
writing my own puti() routine?

I use printf() a lot, and am happy to have it.  Just because I have
chosen not to use a particular standard library routine in a particular
application context, that doesn't mean that the routine is bad or that
standardization is bad.

Probably 99% of all C programs use printf(), and every C programmer
in the world knows how to use it.  That is good.  That is very good.

Programmer productivity is much more important than 25K bytes in a
lot of applications.  25K bytes costs $1.60 in a lot of machine
environments.

In other environments, 25K bytes may be the difference between success
or failure.  You get to choose.

It's the same way with Forth extension wordsets; use them where it makes
sense, roll-your-own if not.

Mitch