Hacker News new | past | comments | ask | show | jobs | submit login
Self-optimizing data structures: using types to make lists faster (donsbot.wordpress.com)
21 points by dons on Oct 11, 2009 | hide | past | favorite | 7 comments



C++1x and Haskell'' are going to differ only in syntax.


I didn't know C++ had lazy-functional semantics.


I'm not sure if I understand exactly what is the current limitation.

Is the main point of this to create something like [!a] ? (ok not really - it's about parts of "a" being strict) Is it just the current syntax / spec limitation that we can't do this? Can it be safely ported in this or some other way into the standard list implementation?


Hmm. No, its not about making it strict -- (!) already does that. It is about changing the representation entirely, so that you get specialized code and data for every different type, rather than reusing slower, general purpose functions.

The code examples show the different, as do the pictures of the heap.

This is some kind of extremely aggressive, but uniform, specialization.


Ok - I get it now. Sadly, I expected that type of optimisation to already take place in GHC, which is why I was confused about what do they do differently. But I see why that's hard now...


Articles like this always leave me torn with, on one hand, a deep fascination with the power, potential, and elegance of Haskell, yet, on the other hand, a nagging feeling that I'll never be quite smart enough to actually understand it...


Failure is part of the process of understanding something.

I would guess that if you limited your ambition of using all the features in the language to something you almost know well, after making some programs using that feature-set, I'd guess you'll see the need for some better feature, and there's a good chance it already exists.

Does not that sound reasonable to you?




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

Search: