[erlang-questions] erl_nif improvements

Sverker Eriksson sverker@REDACTED
Mon Jan 11 14:03:46 CET 2010


Michal Ptaszek wrote:
> [...]
> Recently I am playing with the Erlang-Python bindings 
> (they are still in a very alpha-version but they are 
> working well - called Pytherl and available at 
> http://bit.ly/7HZBAm) which should allow users to reuse 
> Python libraries in Erlang projects. However, using 
> the very narrow NIF exports it is a tedious task to 
> play with. 
>
>   
The idea was to get something out for folks to play with and get some 
useful feedback in return, like this.

> Moreover I have seen a lot of changes in the official 
> github repository (e.g. added enif_get_double or enif_get_tuple).
>
> However, I would like to ask if there are any plans to 
> extend the list of the C functions with e.g.:
> - enif_get_atom/2 (returning const 'char *')
> - enif_get/set_tuple_element/4
> - enif_make_tuple/list/(ErlNifEnv env, ERL_NIF_TERM erl_term, 
> int count, ERL_NIF_TERM **elements) (not a variadic versions. 
> As far as I read the NIFs implementation it should be a very
> simple change/copy-paste in the code)
>   
Sounds reasonable.

Not sure about "set_tuple_element" though. Do you mean to make a copy of 
a tuple like erlang:setelement/3 or to mutate an existing tuple.  
Mutating existing terms is something that we probably do not want to do, 
even if the term has not yet been returned from the NIF.

/Sverker, Erlang/OTP Ericsson



More information about the erlang-questions mailing list