The Rust Programming Language with community. 🦀
Music, playing piano. 🎹
Engineering & math & geoscience!
| github | https://github.com/bluss |
The Rust Programming Language with community. 🦀
Music, playing piano. 🎹
Engineering & math & geoscience!
| github | https://github.com/bluss |
Here's how you can think about state in Typst. I've been using Typst a lot lately, and the semantics around state were definitely tricky to learn!
State is a part of your document, it runs like a thread embedded in the document content. The value of a state is the result of all state updates that happened in the document up until that point.
That’s why state.update returns an invisible sliver of content that you need to return and include into the document - a state update that is not ‘placed’ in the document does not happen, and ‘when’ it happens is determined by where you place it.
Example: Only figures that are placed into the document increase the value of the figure counter.
That’s also why you need context to read state, you need to use the current document position to know where on the state’s “thread” you are.
As you can see, state does not work like a regular variable in a programming language. I hope you will come to see how this makes sense for creating documents in Typst - it’s informed both by how documents are put together, and by the aggressive caching that Typst does (as explained by previous poster).
This is all powered by uv by default. But other project managers are supported, too, just maybe less battle tested. Even pipenv can work!
The vision for this plugin started as soon as I saw Rye - before uv existed, and I've had the project since then. Already with Rye it was very useful, but Uv has now taken over the baton.
And - it should be mentioned - poetry-kernel explored this place before I did.
pyproject-local-kernel has been getting really good now.
https://github.com/bluss/pyproject-local-kernel
It enables you - when using JupyterLab - to define your notebook dependencies in a `pyproject.toml`, for example in a uv project.
It's very powerful, especially for enabling reproducible notebook environments and keeping many different notebook projects, with separate dependencies, going.
pyproject-local-kernel has now switched over to use kernel provisioning, which is perfect for this use case, and that's why it's feeling solid now.
ndarray 0.16 is released: https://github.com/rust-ndarray/ndarray/releases/tag/0.16.0
A release has been needed for a long time to say the least, and it's a very big one too. I'm happy it's out.