2 ms·
The Turbo memoization framework sounds interesting, but I don't see any code samples for what it looks like for Rust users, or how it compares to other Rust mem
by rattray 4y ago
The Turbo memoization framework sounds interesting, but I don't see any code samples for what it looks like for Rust users, or how it compares to other Rust memoization/caching libraries…
- leighmcculloch 4y agoIn several places it is mentioned as a Rust library, but I don't see any links to it. Using google search I'm not finding a Rust library named "Turbo". Is the library open source, or available on crates.io / in a public repo somewhere?
- rattray 4y agoRight, they link to this docs page when referring to the memoization library: https://turbo.build/pack/docs/core-concepts https://turbo.build/pack/docs/core-concepts And the github link at the top of the page links here: https://github.com/vercel/turbo https://github.com/vercel/turbo but, despite being called "turbo", that seems to actually be the repo for Turbopack (the webpack alternative) not "Turbo" the library. Even digging a bit into the crates, I'm not sure where this supposed library lives: https://github.com/vercel/turbo/tree/main/crates https://github.com/vercel/turbo/tree/main/crates
- pitaj 4y agoThe content of that "Core Concepts" page sounds a lot like https://github.com/salsa-rs/salsa https://github.com/salsa-rs/salsa
- jridgewell 4y agoThe engine here are the creates called "turbo-tasks" and "turbo-tasks-*" extend it with more features. See a bit in https://github.com/vercel/turbo/blob/main/architecture.md#turbo-tasks https://github.com/vercel/turbo/blob/main/architecture.md#tu...
- rattray 4y agogotcha, cool – thank you!
- jridgewell 4y agoDocumentation here is one of the areas we need to work on. There's a bit in https://github.com/vercel/turbo/blob/main/architecture.md#turbo-tasks https://github.com/vercel/turbo/blob/main/architecture.md#tu... A small example of code that uses this is https://github.com/vercel/turbo/blob/main/crates/turbo-tasks-env/src/dotenv.rs https://github.com/vercel/turbo/blob/main/crates/turbo-tasks..., which defines how we can load a `.env` file using FS read caching, cached `read` and `read_all` functions, etc.
- rattray 4y agoAh, very helpful/interesting – thank you! Seems neat.