Stream: show and tell

Topic: ruby interop


view this post on Zulip Richard Feldman (Nov 04 2022 at 02:52):

this is really cool: the Ruby interop example now uses JSON as a quick-and-dirty way to send arbitrary values between Roc and Ruby:

view this post on Zulip Richard Feldman (Nov 04 2022 at 02:52):

shoutout to @Ayaz Hafiz for getting the "automatic JSON encoding and decoding" working that facilitates this!

view this post on Zulip Richard Feldman (Nov 04 2022 at 02:53):

we can make a fancier platform in the future which supports going directly to Ruby types without the JSON intermediary, and which can support sending functions to Ruby and so on...but this gets a ton of the way there, and it only took me a few minutes to change from sending strings to Ruby to sending automatically serialized near-arbitrary Roc types via JSON!

view this post on Zulip Brendan Hansknecht (Nov 04 2022 at 02:57):

So for the extra cost of encoding and decoding you get a super flexible API
..that's really cool

view this post on Zulip Ayaz Hafiz (Nov 04 2022 at 03:03):

wow, and this works without any compiler panics??

view this post on Zulip Richard Feldman (Nov 04 2022 at 04:08):

yup!

view this post on Zulip Ayaz Hafiz (Nov 04 2022 at 04:09):

we're getting really good at this programming language thing

view this post on Zulip Richard Feldman (Nov 04 2022 at 04:09):

granted, a proper glue implementation would be faster, and more flexible...and probably take more like a week of work :big_smile:


Last updated: Jul 06 2025 at 12:14 UTC