# \#cps

**URL:** https://discuss.ocaml.org/tag/cps/563.md

[Latest](https://discuss.ocaml.org/latest.md) · [Categories](https://discuss.ocaml.org/categories.md) · [Tags](https://discuss.ocaml.org/tags.md)

---

## [\[BLOG\] Flambda2 Ep. 4: How to write a purely functional compiler, by OCamlPro](https://discuss.ocaml.org/t/blog-flambda2-ep-4-how-to-write-a-purely-functional-compiler-by-ocamlpro/16512)

<div class="topic-metadata">

**Author:** [@OCamlPro](https://discuss.ocaml.org/u/OCamlPro)\
**Replies:** 6\
**Last updated:** [May 30, 2025, 10:27am UTC](https://discuss.ocaml.org/t/blog-flambda2-ep-4-how-to-write-a-purely-functional-compiler-by-ocamlpro/16512 "2025-05-30T10:27:12Z")

</div>

Greetings Cameleers! We’re back with another deep dive into the Flambda2 Optimizing Compiler! Our latest entry in the Flambda2 Snippets blog series is out ! Flambda2 Ep. 4: How to write a purely functional compiler Be…

---

## [Manual CPS is faster than CPS monad. Is it expected?](https://discuss.ocaml.org/t/manual-cps-is-faster-than-cps-monad-is-it-expected/13560)

<div class="topic-metadata">

**Author:** [@Kakadu](https://discuss.ocaml.org/u/Kakadu)\
**Replies:** 6\
**Last updated:** [December 3, 2023, 5:13pm UTC](https://discuss.ocaml.org/t/manual-cps-is-faster-than-cps-monad-is-it-expected/13560 "2023-12-03T17:13:54Z")

</div>

I was experimenting with monads, and discovered that CPS monad performs slower than manual CPS transformation. It seems the case for OCaml, Racket and Chicken Scheme. In OCaml the difference can be 2-3x. In GHC they per…

---

## [Question on continuations](https://discuss.ocaml.org/t/question-on-continuations/11320)

<div class="topic-metadata">

**Author:** [@ddickstein](https://discuss.ocaml.org/u/ddickstein)\
**Replies:** 3\
**Last updated:** [February 6, 2023, 10:46am UTC](https://discuss.ocaml.org/t/question-on-continuations/11320 "2023-02-06T10:46:56Z")

</div>

Is it possible to define printf in terms of sprintf without the use of ksprintf (or any of the other formatted output functions with continuations)? My actual use case involves a custom GADT, not format strings, but I t…

---

## [Continuation Style confusioon](https://discuss.ocaml.org/t/continuation-style-confusioon/10910)

<div class="topic-metadata">

**Author:** [@Kombajn](https://discuss.ocaml.org/u/Kombajn)\
**Replies:** 3\
**Last updated:** [December 4, 2022, 8:24pm UTC](https://discuss.ocaml.org/t/continuation-style-confusioon/10910 "2022-12-04T20:24:15Z")

</div>

I was given a task, to create a cps version of fold\_left, with its first argument being in continuation style aswell. So the signature should be: (’a -\> ’b -\> (’a -\> ’c) -\> ’c) -\> ’a -\> ’b list -\> (’a -\> ’c) -\> ’c I ma…
