Am Sonntag, 25. November 2012, 13:01:31 schrieb David Kuehling: > Hi, > > I've recently come to using the FSL (Forth scientific library) > matrix/array support that ships with Gforth as fsl-util.4th. > > A few comments/questions about that: > > * Gforth CVS contains two files, fsl-util.4th and fsl-util.fs where > fsl-util.fs seems to be the more recent version, however only only > fs-util.4th is installed. Is that by mistake?
Probably. > * Both files suffer from printing out text to stdout during loading, > even with WARNINGS OFF, which makes them somewhat unusable from > scripts that need well-defined (machine-readable) output. (Though > there's a workaround [1]) This should be fixed, at least something like script? 0= [IF] <print version> [THEN] > * The Vector/Matrix indexing operators '}' and '}}' have quite some > overhead when implemented in Forth. What about adding them as > primitives? (I volunteer for the job unless there're objections). They also have some overhead when added as primitive, though that is of course less. IMHO, the FSL indexing operators are broken by design, as most Forth compilers don't do strength reduction, and even those who might can't do it in FSL, because the multiplication value is possibly aliased to other memory writes. What you *want* is a slicing operator, which gives you a ( step end start ) on the stack, so that you can do DO I f@ <operation> dup +LOOP drop probably all, including the slicing operator, wrapped into some nicer syntax, which does all the looping for you. It's probably better spent time to use the numeric primitives v* and faxpy inside FSL where possible; and adding the slice+looping operators I suggested above, this would speed up FSL considerably more than speeding up } and }}. -- Bernd Paysan "If you want it done right, you have to do it yourself" http://bernd-paysan.de/
signature.asc
Description: This is a digitally signed message part.
