I've got some small programs embedded into my app ...
# arrow
r
I've got some small programs embedded into my app which needs to be serialized and generated. Also needs to have some basic primitives and introspection abilities if possible - I've tinkered up something which kinda works, but I'm wondering if arrow has something along these lines?
y
Kinda reminds me of https://serranofp.com/inikio/ maybe
I think you can serialize coroutines btw. It needs an external library, but it's possible.
r
I'd prefer the serialized code to be reasonably human-editable
y
Hmmm. I've heard of CashApp using JS for this purpose... They built some integration layer that allows JS to control what they want in their app. Edit: it's called Zipline, and supports embedding Kotlin/JS code inside Kotlin/JVM
r
🤔 some of the commands being executed by the DSL invoke
suspend
functions interacting with the outside world
y
Apparently:
Interface functions may be suspending. Internally Zipline implements setTimeout() to make asynchronous code work as it's supposed to in Kotlin/JS.
Zipline also supports Flow<T> as a parameter or return type. This makes it easy to build reactive systems.
r
Huh, looks interesting.
Might be a bit hard to generate code in zipline though, I think it's a bit too generic for what we need.