r/rust • u/tomhoule • Aug 06 '17
Purescript waterslide, a library to share your data type definitions between Rust and Purescript
https://github.com/tomhoule/purescript-waterslide-rs
38
Upvotes
r/rust • u/tomhoule • Aug 06 '17
View all comments
Show parent comment
4
u/tomhoule Aug 06 '17 edited Aug 06 '17
Thanks :) I did it for Purescript since it's what I use but if you look at the code it's actually very straightforward with custom derive, and I think it would be easy to do the same thing for Elm or Typescript.
I have zero experience with the Node FFI and Neon so take this with a grain of salt, but since it's geared toward JSON, as long as your types are not much more complicated than JSON (and are plain data), it should be straightforward to share the definitions.
I have to admit I didn't think about that use case but it would be really cool if it works well and I'd be happy to support it. (I mostly had Rust backends communicating with Purescript browser apps in mind).
edit: did the cross-posting