sile-typesetter / sile

The SILE Typesetter — Simon’s Improved Layout Engine
https://sile-typesetter.org
MIT License
1.64k stars 98 forks source link

Cleanup scratch vs. state vs. private namespaces #1417

Open alerque opened 2 years ago

alerque commented 2 years ago

Right now we have an absolute scramble of packages with private variables, global scratch variables with inconsistent naming, and some global state variables with no documentation about what types and methods are expected.

I think we need to refactor this so that private implementation details are kept private, so that multiple SILE processes can be run at once (state and scratch don't clobber each other), and so that we know what changes to public APIs are considered breaking.

alerque commented 2 years ago

Huge progress has been made on this especially in #1373 and a lot of the package idempotency related commits, but there is more to do. We still have a bunch of global scratch stuff. Luckily most of it is undocumented and we can consider them private, so changing them won't be an official breaking change. But we're not quite out of the woods here yet...