On 2013-05-29 14:36, Felix wrote:
>> [...]
>> Continuations should work, too, but it is non-trivial to construct a
>> continuation that doesn't close over all sorts of crazy stuff like the
>> input ports from which the interpreter reads library files etc. Fiddling
>> around with green threads to delimit the continuations and using the
>> facilities to inject "external dependencies" into the serialization
>> context of protobuf should do the job, though.
> 
> Well, ports for example will never be fully serializable (with the
> exception of "standard" ports). Have you seen "suspensions"?
> 
>   https://wiki.call-cc.org/eggref/4/suspension
> 
> They currently use "s11n" but "protobuf" would be the better
> mechanism.
> [...]

Hello Felix,

yes, I'm aware of suspension and the magic going on inside that egg is
precisely what I referred to by "fiddling around with green threads".

In fact, protobuf can easily act as a drop-in replacement for s11n and I
just verified that it does work just fine with suspensions! So I can say
with more confidence now that continuation serialization through
protobuf is functional.

Apply the attached patch to the the suspension egg, install it and see
for yourself :-)

Ciao,
Thomas


-- 
When C++ is your hammer, every problem looks like your thumb.

=== modified file 'suspension.meta'
--- suspension.meta	2011-03-25 14:05:18 +0000
+++ suspension.meta	2013-05-29 13:58:20 +0000
@@ -2,7 +2,7 @@
 
 (
  (synopsis "Serialized limited continuations")
- (needs s11n)
+ (needs protobuf)
  (category lang-exts)
  (license "BSD")
  (author "felix")

=== modified file 'suspension.scm'
--- suspension.scm	2010-08-16 14:49:14 +0000
+++ suspension.scm	2013-05-29 13:59:01 +0000
@@ -1,13 +1,13 @@
 ;;;; suspension.scm
 
+(require-library srfi-18 protobuf)
 
 (module suspension (with-limited-continuation 
 		    continuation-drop
 		    continuation-suspend
 		    continuation-resume) 
-  (import scheme chicken ports)
-
-(use srfi-18 s11n)
+  (import scheme chicken ports srfi-18
+	  (only protobuf-generic serialize deserialize))
 
 (declare (disable-interrupts))
 

_______________________________________________
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to