# Why Pkg.jl uses TOML?

**URL:** <https://discourse.julialang.org/t/why-pkg-jl-uses-toml/63411>\
**Category:** Package Management\
**Tags:** toml\
**Created:** [June 23, 2021, 1:23am UTC](https://discourse.julialang.org/t/why-pkg-jl-uses-toml/63411 "2021-06-23T01:23:26Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![philipGaudreau](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/philipgaudreau/32/26398_2.png) [@philipGaudreau](https://discourse.julialang.org/u/philipGaudreau)\
**Post date:** [June 23, 2021, 1:23am UTC](https://discourse.julialang.org/t/why-pkg-jl-uses-toml/63411/1 "2021-06-23T01:23:26Z")

</div>

Everything is in the title.

It says in the docs:

> _toml_ files are not only used by the _package_ manager; they are also used by _Julia’s_ code loading, and determine e.g. what using Example should do.

What were the reasons behind the choice of TOML over another markup language like YAML, JSON, etc.? What are the benefits?

---

<div class="post-metadata">

**Author:** ![Tomas\_Pevny](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tomas_pevny/32/25466_2.png) [@Tomas\_Pevny](https://discourse.julialang.org/u/Tomas_Pevny)\
**Post date:** [June 23, 2021, 3:50am UTC](https://discourse.julialang.org/t/why-pkg-jl-uses-toml/63411/2 "2021-06-23T03:50:10Z")

</div>

I think Stefan justify it in his talk on Juliacon intruducing the Pkg. If I recall well, the reason was simplicity.

---

<div class="post-metadata">

**Author:** ![Krastanov](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/krastanov/32/6817_2.png) [@Krastanov](https://discourse.julialang.org/u/Krastanov)\
**Post date:** [June 23, 2021, 4:39am UTC](https://discourse.julialang.org/t/why-pkg-jl-uses-toml/63411/3 "2021-06-23T04:39:53Z")

</div>

here is the talk: [Pkg3 The new Julia package manager | Karpinski & Carlsson - YouTube](https://www.youtube.com/watch?v=HgFmiT5p0zU)

Also, package managers in other languages use TOML, so the choice makes it less esoteric

---

<div class="post-metadata">

**Author:** ![philipGaudreau](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/philipgaudreau/32/26398_2.png) [@philipGaudreau](https://discourse.julialang.org/u/philipGaudreau)\
**Post date:** [June 28, 2021, 5:38am UTC](https://discourse.julialang.org/t/why-pkg-jl-uses-toml/63411/4 "2021-06-28T05:38:35Z")

</div>

Oh! Thank you.

Interesting, it was indeed hard to find. At least now it is pinned for a future intrigued user.

---

<div class="post-metadata">

**Author:** ![Oscar\_Smith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oscar_smith/32/25343_2.png) [@Oscar\_Smith](https://discourse.julialang.org/u/Oscar_Smith)\
**Post date:** [June 28, 2021, 5:44am UTC](https://discourse.julialang.org/t/why-pkg-jl-uses-toml/63411/5 "2021-06-28T05:44:31Z")

</div>

The three main potential competitors were xml, JSON, and YAML. xml is awful, and JSON doesn’t support comments. YAML could have conceivably been used.

---

<div class="post-metadata">

**Author:** ![ericphanson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ericphanson/32/215186_2.png) [@ericphanson](https://discourse.julialang.org/u/ericphanson)\
**Post date:** [June 28, 2021, 10:16am UTC](https://discourse.julialang.org/t/why-pkg-jl-uses-toml/63411/6 "2021-06-28T10:16:48Z")

</div>

To be fair, you can’t really use comments in Project.toml’s either as Pkg will delete them. But presumably that’s easier to fix than it is to switch formats.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [June 28, 2021, 11:11am UTC](https://discourse.julialang.org/t/why-pkg-jl-uses-toml/63411/7 "2021-06-28T11:11:58Z")

</div>

> [@Oscar\_Smith](#):
>
> YAML could have conceivably been used.

Besides superficial differences (eg using whitespace for syntax), YAML is possibly to baroque for the purposes of Pkg.jl. Eg it can have cycles in its DAG, and a [tag system](https://yaml.org/spec/1.0/#model-tag). One can always use a subset (variations exist), but TOML is simple, well-specified, and already had a nice implementation by @wildart.
