News for hackers. Stuff that matters.
Re:Bun v0.8.0 by ughitsaaron on Thursday August 24, 2023 @03:46AM (#37246127)
The fact of un-readability isn’t necessarily implied by the statement being replied to. `map` and `filter` are names for common operations on lists, not less performant alternatives other things. If there’s a more performant alternative to either operation, give it a name and express it in a function. That’s what functions are for, no?
Re:Bun v0.8.0 by pleoxy on Thursday August 24, 2023 @10:40AM (#37249281)
The biggest problem is that map, filter make copies of the structure. That's an allocation, that means GC calls.

You can make a similar function that changes the data in place and will be faster. But that comes with side effects which is not functional style.