typeid icon indicating copy to clipboard operation
typeid copied to clipboard

new Rust implementation

Open rrrodzilla opened this issue 1 year ago • 1 comments

Hey everyone,

I've got a new Rust implementation of the TypeId spec that I'd love to share. It's called mti and it offers a different approach by adding extensions to strings, allowing them to behave and parse like TypeIds while maintaining type safety.

What's cool about this implementation:

  1. It's split into three crates:

  2. The TypeIdSuffix and TypeIdPrefix crates are designed for independent use. They've been thoroughly fuzz tested, prop tested, and formally verified.

  3. Both the mti and TypeIdPrefix crates include an optional prefix sanitization feature, which guarantees a valid prefix is created even from bad data.

  4. This split design allows for some neat tricks in high-volume data pipeline processing. For example, you can generate prefixes and suffixes separately and combine them later to maintain high throughput.

I've been using this in a distributed actor framework I'm working on, and it's been pretty slick so far.

Future plans:

  • Exposing these crates to JavaScript and PHP, reusing the Rust core.

Thanks for all your hard work on the spec! Let me know if you need any more info or if you'd like to include this implementation.

rrrodzilla avatar Jul 12 '24 21:07 rrrodzilla

@rrrodzilla Thanks for putting together this crate. It looks great.

Two quick thoughts:

  1. In the crate's README (https://crates.io/crates/mti) the link to Jetify is jetify.io but that's a dead page, it should actually be jetify.com – if you don't mind updating it :)

  2. Let's go ahead and advertise your implementation in our typeid README. Do you want to go ahead and send me a PR modifying this table: https://github.com/jetify-com/opensource/blob/main/typeid/typeid/README.md#community-provided-implementations – we'd be happy to approve it and merge it in.

loreto avatar Jul 15 '24 14:07 loreto