Open nicferrier opened 2 years ago
Hey @nicferrier, I thought I had responded, but realized just today I didn't. Apologies!
To be honest, I am not sure. I haven't done a project in Rust since Risp. If you end up writing a solution, would be curious to see it!
I love that you did this and I think it's a pretty useful... I added String handling to it for a laugh.
Then I got to thinking... could I add more complex functionality? Say, an http request mechanism.
So I added an httpget implementation to the base environment, using Reqwest.
But that set me wondering further... my implementation of httpget is very blocking. But could the httpget return a function which would provide async access to the response?
would produce the headers as a list or something, and:
would attempt to download the body (and cache it) and convert to json... etc...
This returning closures from Risp functions would be cool but I started to fall over my Rust knowledge... I know how to do this in C but I can't see how to return a function from here that would close a non-cloneable value like a reqwest response.
This is going to be the case with a lot of systems programming like things... file descriptors etc... are all non-clonable.
If you don't mind me asking, how would you do this?