# Lwt\_ppx binary footprint

**URL:** <https://discuss.ocaml.org/t/lwt-ppx-binary-footprint/11818>\
**Category:** Learning\
**Tags:** lwt, ppx, footprint, binary\
**Created:** [March 28, 2023, 7:15pm UTC](https://discuss.ocaml.org/t/lwt-ppx-binary-footprint/11818 "2023-03-28T19:15:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mro](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/mro/32/2496_2.png) [@mro](https://discuss.ocaml.org/u/mro)\
**Post date:** [March 28, 2023, 7:15pm UTC](https://discuss.ocaml.org/t/lwt-ppx-binary-footprint/11818/1 "2023-03-28T19:15:44Z")

</div>

just adding the dependency [`lwt_ppx`](https://opam.ocaml.org/packages/lwt_ppx/) makes the according stripped amd64 binary grow from 12MB to 21MB. Am I holding it wrong or is that normal? I am surprised syntactic sugar adds to the binary size.

I still suffer a trauma from unicode ([uucp](https://opam.ocaml.org/packages/uucp/)?) adding 4MB.

---

<div class="post-metadata">

**Author:** ![ghuysmans](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/ghuysmans/32/595_2.png) [@ghuysmans](https://discuss.ocaml.org/u/ghuysmans)\
**Post date:** [March 28, 2023, 9:19pm UTC](https://discuss.ocaml.org/t/lwt-ppx-binary-footprint/11818/2 "2023-03-28T21:19:52Z")

</div>

Refer to it only in the `preprocess` stanza, not as a library. Otherwise, you’ll include parts of the compiler into your executable…

```auto
$ cat dune
(executable (name test) (libraries lwt.unix lwt_ppx))
$ ls -l _build/default/test.exe
-r-xr-xr-x 1 ghs ghs 21520696 Mar 28 23:16 _build/default/test.exe
$ cat dune
(executable (name test) (libraries lwt.unix) (preprocess (pps lwt_ppx)))
$ dune exec ./test.exe
hello
$ ls -l _build/default/test.exe
-r-xr-xr-x 1 ghs ghs 4642352 Mar 28 23:17 _build/default/test.exe

```

---

<div class="post-metadata">

**Author:** ![mro](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/mro/32/2496_2.png) [@mro](https://discuss.ocaml.org/u/mro)\
**Post date:** [March 29, 2023, 7:06am UTC](https://discuss.ocaml.org/t/lwt-ppx-binary-footprint/11818/3 "2023-03-29T07:06:39Z")

</div>

thanks a lot, that works perfect and makes so much sense!

---

<div class="post-metadata">

**Author:** ![mro](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/mro/32/2496_2.png) [@mro](https://discuss.ocaml.org/u/mro)\
**Post date:** [March 29, 2023, 9:24am UTC](https://discuss.ocaml.org/t/lwt-ppx-binary-footprint/11818/4 "2023-03-29T09:24:41Z")

</div>

follow up question:

Is there sugar for [`try_bind`](http://ocsigen.org/lwt/latest/api/Lwt#VALtry_bind)?

Edit: I will nest `lwt%try` and `lwt%let`, nice!
