prof_braino, that code is the poster child for programming in something other than Forth. The FHT can be done more compactly and is more readable when programmed in C. Forth is good for some things, but the FHT isn't one of those things.
There are MANY things that are best done using other tools. If you can do it on C on a workstation, of course do that. This is a very narrow applicability, everybody has a PC just just down load a C library with FFT; but that won't always work on a stock prop board. If you MUST do it on a prop, and GCC isn't finished yet, and you don't have access to workstation resources, and you can choose to use forth, then this is an option. Which is exactly what heater has been trying to do, FFT on a prop using forth.
Basically FORTH feels a bit like an assembly language that prevents access to the JMP instruction, so labels can only be used for subroutine names and variable storage. But makes up for it with one heck of a macro facility (its flow of control structures), so you don't mind.
Exactly. The right tool for the right job. Once we get the feel for how to use it, a given tool can be very handy for that purpose.
Can I post your CS101 forth examples as downloads and wiki pages on the propforth site? Are any of them in a "finished form" or do some still need work?
Can I post your CS101 forth examples as downloads and wiki pages on the propforth site? Are any of them in a "finished form" or do some still need work?
I would be flattered, so feel free to take any FORTH code I post if it will help you. Those samples compile under Gforth, but haven't been ported to PropForth yet. I did PM you my .roman function ported to PropForth. The only breaking changes in PropForth was no case statement or while loop, so I had to tweak the control structures a bit.
My current CS-101 FORTH project is the sieve of Sieve of Eratosthenes which I can post when it is finished.
Comments
There are MANY things that are best done using other tools. If you can do it on C on a workstation, of course do that. This is a very narrow applicability, everybody has a PC just just down load a C library with FFT; but that won't always work on a stock prop board. If you MUST do it on a prop, and GCC isn't finished yet, and you don't have access to workstation resources, and you can choose to use forth, then this is an option. Which is exactly what heater has been trying to do, FFT on a prop using forth.
Exactly. The right tool for the right job. Once we get the feel for how to use it, a given tool can be very handy for that purpose.
Can I post your CS101 forth examples as downloads and wiki pages on the propforth site? Are any of them in a "finished form" or do some still need work?
I would be flattered, so feel free to take any FORTH code I post if it will help you. Those samples compile under Gforth, but haven't been ported to PropForth yet. I did PM you my .roman function ported to PropForth. The only breaking changes in PropForth was no case statement or while loop, so I had to tweak the control structures a bit.
My current CS-101 FORTH project is the sieve of Sieve of Eratosthenes which I can post when it is finished.