Felix Winkelmann <[email protected]> writes:
> This is a terribly written program. It uses 3-element lists as vectors
> (including higher-order "vector" arithmetic using "map") and allocates
> like hell. The compiler can not do much with this code, and it
> produces CPS calls everywhere.
I take it you are referring to the {add, sub, scale, mul, dot,
squared-length, normal} functions? It seems clear to me that there's
plenty of room for optimization in them, but I wonder if you're being a
bit hasty to dismiss the naive implementation so readily. IMHO, use of
`map` to transform lists is sort of idiomatically lisp.
That is to say, in this case there are alternatives for numerical
computation, but transforming a list in a similar manner ought to be
commonplace in lispy programmes. If it is this sort of behaviour that
drives the GC into agony then I expect that there are many Chicken
programmes that may benefit from any form of optimization that could be
had from `map`.
-Dan
--
-Dan Leslie
_______________________________________________
Chicken-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/chicken-users