3 ms·
Had a complicated discussion here, but it's ridiculous, because: Church-Turing thesis says lambda calculus is turing complete and it is purely functional with
by hawkice 10y ago
Had a complicated discussion here, but it's ridiculous, because:
Church-Turing thesis says lambda calculus is turing complete and it is purely functional with no pointers at all.
- sp332 10y agoBut it does have fixpoints... right? You need recursion somehow.
- hawkice 10y agoYou don't need the type of fixed points that cause the issues with circular pointers. Recursion can be done with (appropriately for HN) the Y combinator. The kind of tricks I'm talking about rely on laziness and are pretty complicated. See: http://stackoverflow.com/questions/37366222/why-is-this-version-of-fix-more-efficient-in-haskell http://stackoverflow.com/questions/37366222/why-is-this-vers...
- catnaroek 10y agoIn Standard ML, all recursive value definitions must have function literals as their right-hand sides. Thus, at runtime, recursion is guaranteed to go through functions (which normally aren't allocated in the heap) and/or mutable data structures (which can be handled in a special way by the garbage collector). Immutable data structures are generally guaranteed to be cycle-free. That being said, reference counting is a really bad fit for functional languages for several other reasons.