[erlang-questions] Suffix array implementation in Erlang?

21 views
Skip to first unread message

zabrane Mikael

unread,
Sep 3, 2010, 11:17:25 AM9/3/10
to Erlang Questions Mailinglist
Hi list,

I'm looking after a fast implementation of "Suffix array" in Erlang:
http://en.wikipedia.org/wiki/Suffix_array

Any pointer/code will be very welcome!

--
Regards
Zabrane

________________________________________________________________
erlang-questions (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:erlang-questio...@erlang.org

Evans, Matthew

unread,
Sep 3, 2010, 1:08:54 PM9/3/10
to zabrane Mikael, Erlang Questions Mailinglist
Sounds like a good use for a NIF implementation.

zabrane Mikael

unread,
Sep 3, 2010, 1:13:19 PM9/3/10
to Evans, Matthew, Erlang Questions Mailinglist
Hi Metthew,

Yep, this is what I'm planning is no pure Erlang implementation is available.

--
Regards
Zabrane


2010/9/3 Evans, Matthew <mev...@verivue.com>:

Robert Virding

unread,
Sep 3, 2010, 7:09:42 PM9/3/10
to zabrane Mikael, Evans, Matthew, Erlang Questions Mailinglist
Why do a NIF implementation? Or don't you plan to use erlang data structures?

Robert

zabrane Mikael

unread,
Sep 4, 2010, 7:29:50 AM9/4/10
to Robert Virding, Evans, Matthew, Erlang Questions Mailinglist
Hi Robert,

2010/9/4 Robert Virding <rvir...@gmail.com>:


> Why do a NIF implementation?

Performance ! There's a lot of rock solid C implementations out there.

> Or don't you plan to use erlang data structures?

Yep, but before reinventing the wheel, I'd like to know if a pure
Erlang implementation exists.

Robert Virding

unread,
Sep 4, 2010, 10:33:33 AM9/4/10
to zabrane Mikael, Evans, Matthew, Erlang Questions Mailinglist
On 4 September 2010 13:29, zabrane Mikael <zabr...@gmail.com> wrote:
> Hi Robert,
>
> 2010/9/4 Robert Virding <rvir...@gmail.com>:
>> Why do a NIF implementation?
>
> Performance ! There's a lot of rock solid C implementations out there.
>
>> Or don't you plan to use erlang data structures?
>
> Yep, but before reinventing the wheel, I'd like to know if a pure
> Erlang implementation exists.

Where I was trying (unsuccessfully) to go was that if you were going
to use normal erlang data structures (lists/tuples) to build the tree
and store general erlang terms in it then I would be surprised if you
can use destructive algorithms for the array as they work on the
normal Erlang heaps. In which case you might not be able to directly
use these C implementations. In which case it is probably easier to
work on the tree directly in Erlang instead of in C in a NIF, seeing
you have to modify the algorithms anyway.

I can't remember what it says about destructive operations on heap
data in the NIF docs.

Robert

Reply all
Reply to author
Forward
0 new messages