Re: Announcement: Axiom, a Forth Based Universal Game Programming System
- From: Krishna Myneni <krishnamyneni@xxxxxxxxxxxxx>
- Date: Tue, 28 Aug 2007 20:08:39 -0500
dreamwafer@xxxxxxxxx wrote:
On Aug 28, 2:05 pm, m...@xxxxxx (Marcel Hendrix) wrote:
dreamwa...@xxxxxxxxx writes Re: Announcement: Axiom, a Forth Based Universal Game Programming System
On Aug 27, 11:41 pm, m...@xxxxxx (Marcel Hendrix) wrote:Is less stack juggling not compelling enough?
Yes it is. I just wanted to make sure I wasn't overlooking other
important points
surrounding the issue.
Source code clarity: with a unified stack, you are never completely sure
that there is not a float involved somewhere, whereas with a separate
stack you simply write
: x ( adam bertha -- xantippe ) ( F: r -- cos{r} ) ... ;
Then there is efficiency: a separate stack works much faster when you
use the hardware FPU or SSE2 unit. Most fast Forths use a separate
FP stack, so your code can never be directly used on/ported to/checked
through them.
With a separate FP stack you switch to double or quad precision without
rewriting any code. (Say you want your Fractal generator upgraded to
256 bits with Julian Noble's ideas.)
-marcel
I see, I'll consider these points as well, thanks!
-- Greg
While all of the above arguments in favor of a separate fp stack have some
validity, collectively they may give the impression that Forth code written for
a unified/shared stack is hard to write, hard to document, and sluggish. Such a
conclusion should be met with skepticism. Some of the earliest Forth systems,
e.g. the LMI Forths featured a unified stack, and they were quite successful in
their day. I have worked extensively with a shared stack system, and even ported
a good bit of common Forth code to such a system:
http://ccreweb.org/software/kforth/kforth4.html
It may be that a separate stack system is now more compelling, given that it is
the common practice. However, should you decide to continue with a shared stack
system, I urge you to consider making fp numbers be double floats which occupy
two stack cells, rather than 32-bit fp numbers. Although it seems unlikely, and
the situation may never arise in your application, I have run into limitations
with the precision of 32-bit floats. Originally, in the days of DOS, I used
32-bit floats in an application named xyplot, to conserve memory. Now, I
actually have data which I cannot plot with this program, because the number of
significant digits is insufficient. This limitation is forcing a rewrite of a
good-sized program.
Krishna Myneni
.
- Follow-Ups:
- Re: Announcement: Axiom, a Forth Based Universal Game Programming System
- From: slava@xxxxxxxxx
- Re: Announcement: Axiom, a Forth Based Universal Game Programming System
- References:
- Re: Announcement: Axiom, a Forth Based Universal Game Programming System
- From: dreamwafer
- Re: Announcement: Axiom, a Forth Based Universal Game Programming System
- From: Marcel Hendrix
- Re: Announcement: Axiom, a Forth Based Universal Game Programming System
- From: dreamwafer
- Re: Announcement: Axiom, a Forth Based Universal Game Programming System
- Prev by Date: Re: What were "shadow blocks"?
- Next by Date: Re: Announcement: Axiom, a Forth Based Universal Game Programming System
- Previous by thread: Re: Announcement: Axiom, a Forth Based Universal Game Programming System
- Next by thread: Re: Announcement: Axiom, a Forth Based Universal Game Programming System
- Index(es):
Relevant Pages
|