First Steps to Open Sourcing Rakaly: Foundations banner

First Steps to Open Sourcing Rakaly: Foundations

Date written: August 3, 2020

There are many layers that need to come together to make Rakaly work. I initially started developing Rakaly 6 months ago, and at the beginning I wasn’t sure how the project should be constructed. While the initial scaffolding was fluid to support whatever impulse I had, over time sub-projects emerged. These sub-projects can be extracted and open sourced to the benefit of others. Today the first step was taken and the parser for text and ironman data has been open sourced.

The Parser

The parsing layer in Rakaly is called Jomini. It’s such a low level parser (nothing specific to EU4) that I doubt anyone but me will find it useful, but it provides a foundation for not only EU4 specifics but also other titles like Imperator, HOI4, Stellaris.

To give the quickest of examples. Jomini can take the following input:

human = yes

And deserialize it directly to a more ergonomic data structure:

use jomini::{JominiDeserialize, TextDeserializer};

#[derive(JominiDeserialize, PartialEq, Debug)]
pub struct Model {
    human: bool,

More examples can be found in the documentation.

As depicted in the example, Jomini is written in Rust. The core reasons behind this:

Jomini throughput

Jomini throughput

Graph notes:

Why Open Source

I decided to start open sourcing Rakaly for the following reasons:

Occasionally projects will open source their components to signal their abandonment of the code. This is not the case here. I’m always bursting at the seams for ideas to implement for Rakaly and there are some great ideas given in the Discord. It’s safe to say Rakaly isn’t running out of steam.

The Future

While the parser provides the foundation for Rakaly and save files, it can expand into other areas. For instance, certain game files contain logic like has_level > 2 instead of = that is seen in save files. I’d like to support conditionals (a somewhat niche requirement) without sacrificing performance when parsing save files.

Hopefully this is but the first layer to be open sourced. While I’m unsure if everything will ultimately be open sourced.

I’ve written many PDS parsers over the years across many languages. I don’t have nearly the same level of pride in them and so I’m secretly hoping that I can consolidate them all to use the same logic and just expose a semi-ergonomic interface for each language.

Feel free to get in contact via Discord or hi [(at)]