Why Pkg.jl uses TOML?

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?

1 Like

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

1 Like

here is the talk: Pkg3 The new Julia package manager | Karpinski & Carlsson - YouTube

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

3 Likes

Oh! Thank you.

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

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.

3 Likes

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.

2 Likes

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. One can always use a subset (variations exist), but TOML is simple, well-specified, and already had a nice implementation by @wildart.

4 Likes