Hacker News new | past | comments | ask | show | jobs | submit login

Yes. In theory, any pure function can be turned into a lookup table. And any lookup table that isn't just random numbers can be turned into a more compact algorithm that spends compute to save space.

Such tables may be infeasible, though. While a int8 -> int8 table only needs 256 bytes, an int32 -> int32 needs 16 gigabytes.




Fractal functions are pure, but don’t lend themselves well to memoization nor lookup tables.


What does this statement even mean? Every function from a finite domain is just a lookup table, period.


Who said anything about finite-domains?


Every function has finite domain on a computer.


Arbitrary-precision real-number libraries would disagree with you there.


False. A computer always has a finite amount of memory.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: