After being party to some pain and suffering over at Heaps, I was reminded of Perl's striking lack of data structures beyond the basic arrays, hashes, and scalars. Sure, it has modules for everything from databases to MIDI, and makes it easy to glue these different domains together in interesting ways. But in terms of bread-and-butter, straight-from-CLR data structures, I think it could be better.

If I were working in C++, I could get these basic building blocks from the STL, LEDA, Boost, etc. Such standard implementations are well-designed, efficient, and well-tested; they let programmers solve problems once and for all, then move on to better things. While a few applications demand more than the standards can provide, and more than a few programmers prefer their own, uneven wheels, most people who want to get the job done quickly and correctly have the tools to do so.

Now consider our Heap. I believe POE has implemented its own priority queues, and List::Priority just hit the shelves last month. None of these is fast enough, general enough, and/or easy enough to use, so each will remain confined to its own niche. Each has its strengths and weaknesses, but I wouldn't be surprised if a good standard implementation could beat them all.

Perl needs a good, tested library of containers and algorithms, all living in a well-known place. There are some gems out there on CPAN now, and probably some more sitting in people's home directories. We need to put them in a common place, test them, tune them, and get them in the standard distribution.

/s


In reply to We have no SPL. by educated_foo

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.