# \[ANN\] Vaast 0.0.0 + Design discussion

**URL:** <https://discuss.ocaml.org/t/ann-vaast-0-0-0-design-discussion/18583>\
**Category:** Ecosystem\
**Tags:** design, blog, static-analysis, discussion, announce\
**Created:** [October 5, 2026, 12:02pm UTC](https://discuss.ocaml.org/t/ann-vaast-0-0-0-design-discussion/18583 "2026-10-05T12:02:35Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![fantazio](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/fantazio/32/6183_2.png) [@fantazio](https://discuss.ocaml.org/u/fantazio)\
**Post date:** [October 5, 2026, 12:02pm UTC](https://discuss.ocaml.org/t/ann-vaast-0-0-0-design-discussion/18583/1 "2026-10-05T12:02:35Z")

</div>

Hi all,

This is a bit of mixed post.

I am excited to announce the 1st prototype of [Vaast](https://github.com/fantazio/vaast) !  
Vaast is a library to handle multiple versions of the Typedtree at once. It is meant as a replacement for the current compiler-version-dependent techniques (be it preprocessing or branching).

Similarly to ppxlib for the Parsetree, it provides a single representation of the Typedtree. Unlike ppxlib, it does not select a compiler version’s representation but provides a form of super-representation which embeds the Typedtree from OCaml 4.14 to 5.5 at once. It does so via a dedicated type encoding which explicitly and precisely identifies the differences in-between versions.Vaast’s Typedtree representation is a shallow replacement for OCaml’s Typedtree, making it cheap to use and easy to integrate incrementally in existing code.

More details on its design are available on my blog:

> **[fantazio.eu](https://fantazio.eu/articles/designing_vaast.html)**

This leads us to the second part of this post: discussing the design.  
The prototype is usable as a replacement for the compiler’s Typedtree (and I [experimented it on the dead\_code\_analyzer](https://github.com/LexiFi/dead_code_analyzer/compare/master...fantazio:dead_code_analyzer:vaast)). Overall its design resembles the Typedtree but limits the breakages in user-code when updating to a more recent OCaml version.

Here is an example of code in [odoc](https://github.com/ocaml/odoc/blob/6dc58262b276af7e24b92ac5343b9f26d621122b/src/loader/typedtree_traverse.ml#L43), relying on `cppo` to handle the different versions of the Typedtree:

```OCaml
#if defined OXCAML
          | Tpat_alias (_, id, loc, _uid, _, _, _) -> (
#elif OCAML_VERSION >= (5, 4, 0)
          | Tpat_alias (_, id, loc, _uid, _ty) -> (
#elif OCAML_VERSION >= (5, 2, 0)
          | Tpat_alias (_, id, loc, _uid) -> (
#else
          | Tpat_alias (_, id, loc) -> (
#endif
              match maybe_localvalue id loc.loc with
              | Some x -> poses := x :: !poses
              | None -> ())

```

And here is the equivalent using Vaast (and discarding the OxCaml case):

```OCaml
          | Tpat_alias {id; name; _} -> (
              match maybe_localvalue id name.loc with
              | Some x -> poses := x :: !poses
              | None -> ())

```

There are some rough edges (`Texp_function`, flattenable versioned types), and, before diving deeper into building the library, I would appreciate feedback and participation of those interested in its development and its use.  
I opened a [dedicated issue](https://github.com/fantazio/vaast/issues) for that purpose.

The mid-term goal is to add utility functions for usual operations, support a few mainstream modules of compiler-libs (`Parsetree`, `Types`), and make Vaast a basic building block for static analyzers.  
The long-term goal is to interface most of compiler-libs.

Thanks !

---

_[View the full topic](https://discuss.ocaml.org/t/ann-vaast-0-0-0-design-discussion/18583)._
