-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFC 1: Arrays #15
Comments
Could it be done as a NIF? How much work would it be? |
Manual memory management just doesn't play nicely with the erlang vm typically. |
Does it have to be a data structure available in core and not the stdlib? There is the |
@tsloughter yes I am leaning towards using the |
Ah yea, |
Erlang (or rather hipe) has mutable arrays but only of immediate types. See
hipe_ bif
Probably not a practical approach though.
…On Wed, 27 Dec 2017 at 16:46, Tristan Sloughter ***@***.***> wrote:
Ah yea, set on mutable needs to return unit :(. I'd be curious to a NIF
like @rascala <https://github.com/rascala> suggests, using resources to
reference the array. But maybe garbage collection issues with that...
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#15 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABIDlLp7JrDsL0i2SFWn4AxUNEZTBEUXks5tEnRYgaJpZM4N98jr>
.
|
Arrays have no direct equivalent in
core erlang
. A lot of code that uses arrays can be quite directly translated to using lists instead (fsharpList
s orSeq
s). The exception to this is code that mutates the array directly. That said a lot of code may use arrays and it would be good to cover arrays in some shape or form.The most direct equivalent of erlang's
binary()
type is thebyte array
so it would make sense to translate operations on byte arrays to operations on binaries.Arrays are generic so this leave a lot of types uncovered. Should the non mutable aspects and apis of
Array.*
that aren't byte arrays simply be translated as erlang lists? Are there any other options?The text was updated successfully, but these errors were encountered: