[erlang-questions] Add a new data structure to erlang VM.

Steve Vinoski <>
Sat Jul 9 20:59:00 CEST 2016


On Sat, Jul 9, 2016 at 1:54 PM, Constantin Kulikov <>
wrote:

> If I want to add a new datastructure to erlang(my local fork of the
> erlang-otp from github), what should I do? Yes, I mean a C-level module
> realization.
>
> Let's say I want to add a double linked list(just for simplicity) module
> with an interface like that:
> dlist:new() -> ?some king of reference to a list?
> dlist:push(item) -> ?reference to a list?
> dlist:pop() -> {item, ?reference to a list?}
> etc...
>
> Is it possible at all? Has anyone ever tried to do something like this?
> What definitions to what files should I add? How must I allocate my data
> structure? How must I reference items in it?
> Can someone point me to source locations where erlang's list/ets
> table/tuple operations(creating a new, storing a reference to objects)
> defined?
>

See

http://erlang.org/doc/tutorial/nif.html
http://erlang.org/doc/man/erl_nif.html

--steve
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20160709/9c2dec71/attachment.html>


More information about the erlang-questions mailing list