News for hackers. Stuff that matters.
Re:Reflecting on Transducers in Scheme (2023) by bjoli on Tuesday August 20, 2024 @05:10PM (#41304114)
Transducers are not loops. You can create transducers and pass them as arguments to functions, that in their turn can prepend or append then.

They are composable algorithmic transformations.

Re:Reflecting on Transducers in Scheme (2023) by drcode on Tuesday August 20, 2024 @05:47PM (#41304431)
composable algorithmic transformation in the streets

but mostly an alternative to LOOP in the sheets

Re:Reflecting on Transducers in Scheme (2023) by bjoli on Tuesday August 20, 2024 @06:17PM (#41304675)
Sure. But in that case it is somewhere between map(car)-and-friends and LOOP.

Which is a situation where they add very little. Being able to use them as an intermediate step wherever data flows is probably the only place I use them myself. In channels, in file-readers etc. in places where you really need speed you should of course reach for whatever loop construct you prefer.

Re:Reflecting on Transducers in Scheme (2023) by RhysU on Tuesday August 20, 2024 @09:33PM (#41305910)
> composable algorithmic transformations

This phrasing always feels pointlessly fancy. I may be understeeped in the right lore.

What is a non-composable, non-algorithmic transformation? A composable, non-algorithmic transformation? A non-composable, algorithmic transformation?

Maybe there's some constraint on the domain vs the range buried in "transformation"?

Re:Reflecting on Transducers in Scheme (2023) by bjoli on Wednesday August 21, 2024 @04:54AM (#41308252)
There are lots of examples of non-composable transformations. Two functions are not necessarily composable. Call/cc does not compose with the current continuation, whereas delimited continuations do.

Algorithmic transformations are algorithmic. The result is well-defined.

It is a succinct way of saying that a transducer is a well-defined (in terms of input and output) transformation that can be combined with other transducers.

I didn't make up the lingo.