#Bravo - Comprehensive ETS bindings for Gleam

1 messages · Page 1 of 1 (latest)

storm coral
#

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.

https://hex.pm/packages/bravo

#

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

neon pine
#

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?

storm coral
storm coral
#

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.

neon pine
neon pine
storm coral
#

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