Opened 15 months ago

#1323 new defect

Teach compiler that fold and map with clean procedure is itself clean

Reported by: sjamaan Owned by:
Priority: major Milestone: someday
Component: compiler Version: 4.11.0
Keywords: optimisations Cc:
Estimated difficulty: hard

Description

It looks like CHICKEN currently doesn't understand that fold and map are #:clean if the argument procedure is #:clean. This prevents it from recognising that something like (fold + 0 (iota 10000)) is foldable.

We could hardcode these procedures, but I'd prefer not to, so this might require some kind of new annotation in types.db.

This idea was inspired by http://pramode.in/2016/08/25/rust-add-billion-numbers/ - if Rust can do it, so can we!

Change History (0)

Note: See TracTickets for help on using tickets.