-----Original Message----- From: erlang-questi...@erlang.org [mailto:erlang-questi...@erlang.org] On Behalf Of zabrane Mikael Sent: Friday, September 03, 2010 11:17 AM To: Erlang Questions Mailinglist Subject: [erlang-questions] Suffix array implementation in Erlang?
> Sounds like a good use for a NIF implementation.
> -----Original Message----- > From: erlang-questi...@erlang.org [mailto:erlang-questi...@erlang.org] On Behalf Of zabrane Mikael > Sent: Friday, September 03, 2010 11:17 AM > To: Erlang Questions Mailinglist > Subject: [erlang-questions] Suffix array implementation in Erlang?
> Yep, this is what I'm planning is no pure Erlang implementation is available.
> -- > Regards > Zabrane
> 2010/9/3 Evans, Matthew <mev...@verivue.com>: >> Sounds like a good use for a NIF implementation.
>> -----Original Message----- >> From: erlang-questi...@erlang.org [mailto:erlang-questi...@erlang.org] On Behalf Of zabrane Mikael >> Sent: Friday, September 03, 2010 11:17 AM >> To: Erlang Questions Mailinglist >> Subject: [erlang-questions] Suffix array implementation in Erlang?
On 4 September 2010 13:29, zabrane Mikael <zabra...@gmail.com> wrote:
> Hi Robert,
> 2010/9/4 Robert Virding <rvird...@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
________________________________________________________________ erlang-questions (at) erlang.org mailing list. See http://www.erlang.org/faq.html To unsubscribe; mailto:erlang-questions-unsubscr...@erlang.org