News for hackers. Stuff that matters.
Re:A Tour of Lisps by cmrdporcupine on Tuesday January 30, 2024 @11:18AM (#39191906)
Here's what I don't like about recursion & associated world of linked lists car/cdr: Modern Computing Hardware performance characteristics. That is, missed branch predictions, and lost opportunity to apply SIMD/vector operations.

On "classical" computing hardware, it's fine. On present-day architectures we're better off writing with "wider" operations across vectors rather than depth-first-ish recursive operations on scalars.

But yes, for some domains, the performance doesn't matter.

I just also find recursion more difficult to read in some contexts. In others, things like tree transformation etc. it's easier to read, for sure.

But I am also a fan of immutable, or at least copy-on-write, data, expressed in series of functional applications, etc. etc.

Re:A Tour of Lisps by chriswarbo on Thursday February 01, 2024 @08:26AM (#39215672)
Most of the time "recursing through a linked list" is still too low-level; and we can instead write our code at a higher level with `map`, `reduce`, etc. Recursion is then just an implementation detail of those functions; which we could instead swap out for, say, massively parallel fan-out across a datacentre (i.e. frameworks like MapReduce, and its descendents like Spark)!