* Delimited continuations in OCaml go to 3.12 and 64
@ 2010-08-23 1:34 oleg
2010-08-23 21:38 ` [Caml-list] " Yoann Padioleau
0 siblings, 1 reply; 4+ messages in thread
From: oleg @ 2010-08-23 1:34 UTC (permalink / raw)
To: caml-list
The library delimcc implements multi-prompt delimited control operators
for byte- and native-code OCaml. The library now can be used with
OCaml 3.12.0, on x86_32 and x86_64 (aka amd64) platforms.
The byte-code part of the previous versions of delimcc could
already be used with OCaml 3.12 (although I didn't know that). Since
OCaml byte-code is portable, the byte-code delimcc should work on
any supported architecture. In this version, some adjustments have
been made to scAPI to make in more portable. It should be stressed
that there are _no_ distinct versions of the native-code delimcc, for
32- and 64-bit architectures. Rather, the same code (without any
64-bit--specific ifdefs) works on x86_32 and x86_64. Only
C code differs between byte-code and native-code versions of the
library; the OCaml code is shared, across the versions and the
architectures. The current version of delimcc probably works on other
architectures like arm, although I have no means of testing that.
The byte- and native-code versions of library has been tested on i386
Linux and FreeBSD platform and on amd64 Linux platform. The code is at
http://okmij.org/ftp/continuations/caml-shift.tar.gz
I thank Jim Pryor for help with testing.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Caml-list] Delimited continuations in OCaml go to 3.12 and 64
2010-08-23 1:34 Delimited continuations in OCaml go to 3.12 and 64 oleg
@ 2010-08-23 21:38 ` Yoann Padioleau
2010-08-24 1:20 ` Jake Donham
2010-08-24 6:53 ` Generators in OCaml oleg
0 siblings, 2 replies; 4+ messages in thread
From: Yoann Padioleau @ 2010-08-23 21:38 UTC (permalink / raw)
To: oleg; +Cc: caml-list
Is there any tutorial on why such features are useful ?
Concrete examples of their use. For instance can you implement
python generators and its yield stuff by using this library ?
The only reference mentioned in the source is a technical report that
does not look very easy to read.
On Aug 22, 2010, at 6:34 PM, oleg@okmij.org wrote:
>
>
> The library delimcc implements multi-prompt delimited control operators
> for byte- and native-code OCaml. The library now can be used with
> OCaml 3.12.0, on x86_32 and x86_64 (aka amd64) platforms.
>
> The byte-code part of the previous versions of delimcc could
> already be used with OCaml 3.12 (although I didn't know that). Since
> OCaml byte-code is portable, the byte-code delimcc should work on
> any supported architecture. In this version, some adjustments have
> been made to scAPI to make in more portable. It should be stressed
> that there are _no_ distinct versions of the native-code delimcc, for
> 32- and 64-bit architectures. Rather, the same code (without any
> 64-bit--specific ifdefs) works on x86_32 and x86_64. Only
> C code differs between byte-code and native-code versions of the
> library; the OCaml code is shared, across the versions and the
> architectures. The current version of delimcc probably works on other
> architectures like arm, although I have no means of testing that.
>
> The byte- and native-code versions of library has been tested on i386
> Linux and FreeBSD platform and on amd64 Linux platform. The code is at
>
> http://okmij.org/ftp/continuations/caml-shift.tar.gz
>
> I thank Jim Pryor for help with testing.
>
> _______________________________________________
> Caml-list mailing list. Subscription management:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Caml-list] Delimited continuations in OCaml go to 3.12 and 64
2010-08-23 21:38 ` [Caml-list] " Yoann Padioleau
@ 2010-08-24 1:20 ` Jake Donham
2010-08-24 6:53 ` Generators in OCaml oleg
1 sibling, 0 replies; 4+ messages in thread
From: Jake Donham @ 2010-08-24 1:20 UTC (permalink / raw)
To: Yoann Padioleau; +Cc: oleg, caml-list
On Mon, Aug 23, 2010 at 2:38 PM, Yoann Padioleau <padator@wanadoo.fr> wrote:
> Is there any tutorial on why such features are useful ?
> Concrete examples of their use. For instance can you implement
> python generators and its yield stuff by using this library ?
Here is an example of a particular use of Delimcc to implement fibers for Lwt:
http://ambassadortothecomputers.blogspot.com/2010/08/mixing-monadic-and-direct-style-code.html
I don't know exactly how python generators work but I would imagine
that you can implement them with Delimcc.
Jake
^ permalink raw reply [flat|nested] 4+ messages in thread
* Generators in OCaml
2010-08-23 21:38 ` [Caml-list] " Yoann Padioleau
2010-08-24 1:20 ` Jake Donham
@ 2010-08-24 6:53 ` oleg
1 sibling, 0 replies; 4+ messages in thread
From: oleg @ 2010-08-24 6:53 UTC (permalink / raw)
To: padator; +Cc: caml-list
Yoann Padioleau wrote:
> Is there any tutorial on why such features are useful ?
> Concrete examples of their use.
Thank you for the question! I think you may find many examples
of delimited continuations on the following web site:
http://okmij.org/ftp/Computation/Continuations.html
Notable examples are the probabilistic programming language HANSEI,
normalization of MapReduce bodies by evaluation, and a framework to
program CGI applications in `direct style' (as if they were regular
console applications). Delimited continuations proved quite useful for
writing code generators: to perform let- or if-insertions in the
generated code, one has two choices: write the generator in a monadic
style or CPS, or use a `direct style' relying on delimited
control. Experience seems to show that direct-style generators are
more perspicuous.
> For instance can you implement python generators and its yield stuff
> by using this library ?
Yes! Here is the complete code
http://okmij.org/ftp/ML/generator.ml
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-08-24 6:53 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-23 1:34 Delimited continuations in OCaml go to 3.12 and 64 oleg
2010-08-23 21:38 ` [Caml-list] " Yoann Padioleau
2010-08-24 1:20 ` Jake Donham
2010-08-24 6:53 ` Generators in OCaml oleg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox