Elixir implementation
Closed this issue · 8 comments
Haven't started work but here's a placeholder.
Elixir is a dynamic, functional language designed for building scalable and maintainable applications. Elixir leverages the Erlang VM
I wish to make this a library for elixir too.
https://hex.pm/packages/libsodium dependent library
OK sounds good!
Do you have a series of tests? Looking for something that goes from the simple features to the more complicated ones.
Yes, the tests are at the bottom of netcode.c:
https://github.com/networkprotocol/netcode.io/blob/master/c/netcode.c
@gafferongames Can you generate some samples of the connect token / connect token data packets? I'm currently trying to write a decoder for it.
https://github.com/fire/netcode/blob/master/lib/netcode/ConnectTokenData.ex
https://github.com/fire/netcode/blob/master/lib/netcode/ConnectToken.ex
Can you call into C from Elixir? The Rust guy called into C for test data as needed, and then gradually replaced those portions with Rust code. This might be a good strategy for your port?
For example:
int netcode_generate_connect_token( int num_server_addresses,
NETCODE_CONST char ** server_addresses,
int expire_seconds,
uint64_t client_id,
uint64_t protocol_id,
uint64_t sequence,
NETCODE_CONST uint8_t * private_key,
uint8_t * connect_token );
Well my approach is to use an elixir implementation of the code, but it's possible to write a shared library that is loaded into elixir.
I'll take a look.
Yes I just mean as a transition, obviously you end up with 100% Elixir in the end.