I've been working on a ETS library for a few days now. It's still in early development, but it's definitely usable. As of v2.0.0, it's also now type safe! Feedback will be appreciated.
#Bravo - Comprehensive ETS bindings for Gleam
1 messages · Page 1 of 1 (latest)
v2.0.0 is breaking, so if you're one of the 4 people that installed v1.0.0, then you'll probably have to update your gleam.toml to update
Cool!! ETS is great 🙂
So according to the Readme, the difference to carpenter is how types are handled, is that correct?
Carpenter ensures type safety by restricting objects to simple key-value pairs, much like a Dict.
Bravo, however, does not impose much of any restriction at all.
I'm not sure I fully understand, it looks to me like the values can be of any type but it must be the same type, isn't that just like a Dict as well?
Just released v2.1.0! https://github.com/Michael-Mark-Edu/bravo/blob/main/CHANGELOG.md#v210
funny that you post that at the same time I did
I wrote that with the context of what I had written there previously, which went along the lines of "Bravo sacrifices type safety (no longer true) to completely relax any restriction about what you can put it" and I was still thinking about that when I wrote that. I'll look over it now that you mention it
Carpenter uses a key-value pair system, which is similar to Gleam dict. Bravo uses tuples for everything, which is how ETS works on the Erlang side.
right, I see, well that's a good change then!
I don't think sacrificing type safety is something that's ever wanted in Gleam, and I'm not sure there are good use cases for ets tables with differently typed values anyways
gotcha, I see it sticks close to the Erlang api yeah, curious how you are planning to do matching if at all, I find the Erlang API a bit horrendous for that
I know ETS has functions for advanced matching, but I have only looked into that a little bit. It might be an Erlang type-hellhole that I want to avoid, but only time will tell