-
Notifications
You must be signed in to change notification settings - Fork 105
Implementing ETS #692
Comments
can i make this issue? |
@josuesantos1 sure! |
I can call rets? (Rust-ets) Can I change one thing or the other or does it need to be 100% equal to ets? |
I'll let @bitwalker weigh in on that |
hi there! 👋🏽 I've been looking at lumen for a while, really great project! I wonder is the work on this issue still desired? If so I would love to take a stab at it, I've been actively learning rust and I'm fairly confident in my elixir - it might take me a few weeks but I'm pretty sure I can crack it. Thanks! cc: @bitwalker , @bcardarella |
@hailelagi we'd welcome all contributions! @KronicDeth would be the best best to weigh in on this ticked I think |
@hailelagi There are a few things we need to get sorted internally with the runtime before we'll be ready to implement ETS, but I'm working hard to get that stuff done as soon as possible. I'll ping you here as soon as we're ready to begin implementation, and I'd be happy to let you work on that :). The main outstanding things I'm working out are how runtime functions need to integrate with the garbage collector, and additionally how runtime functions should be written to support yielding during expensive operations. Both of those are tricky in Rust, so I'm researching an approach via async Rust that ideally will provide a uniform solution to both of those questions. The trouble with going too far with implementation until those are pinned down, is that they will have a very significant impact on the APIs and implementation of their functionality, so it's not really worth going too deep on it until then. That said, if you wanted to take a crack at a standalone implementation of ETS in Rust, and then work on integrating that into the runtime once we're ready, that might be a viable approach for development - but I suspect that there will be so many runtime-specific idiosyncracies that you'd largely end up reimplementing most of it anyway. |
I see, thanks for the heads up! For now, I'd be fine with trying the library approach, and eventually when the runtime api is stable, doing a re-write, I don't mind honestly and looking forward to it :) |
See #8 as well |
Implementing ETS
Erlang Term Storage (ETS) is built on top of two data structures (depending on the options passed to
ets:new/2
) - an AVL tree in the general case (based on the paper by Adelson-Velski and Landis), and a CA tree [1][2] for ordered sets with write concurrency enabled. For our purposes, we aim to build our ETS implementation on top of WAVL trees [3]. Some interesting references are included below [4][5][6]. Work on the compiler has kept us from building this yet, so this is a great way to get involved with the project!Goals
ets:insert/2
with a list of objects to insert). Functions which are "short enough" don't need to be written as futures, but if implementation is easier that way, it's fine. NOTE: It is essential that these futures do not attempt to hold locks across yield points, if Rust will even allow that in its type system.References
The text was updated successfully, but these errors were encountered: