mirror of
https://git.pumpin.online/funkpower/typikon.git
synced 2026-10-22 18:57:13 +00:00
Every desktop shell that reads typikon today runs the binary and parses its JSON. That costs about 1.5ms and is the right answer for a calendar that changes once a day, but it is the wrong shape for anything with an FFI and no business spawning a process on every redraw. Dates cross as Julian Day Numbers, so no struct layout is part of the contract. A day is opaque and owns its strings, built once when it is reckoned: an accessor returns the same borrowed pointer every time, so a statusline polling one in a loop allocates nothing. The accessors carry every field of the JSON, so nothing on the other side needs a parser. The Python bindings and this were resolving a jurisdiction by two copies of the same logic, and the copy here leaked one per call. Both now share jurisdictions::resolve_full, which interns the combinations instead. The header is a promise made in a second file, and a second file drifts: a test reads both and fails if either has a symbol the other does not, and does the same for the LuaJIT cdef, where a stale declaration is a segfault rather than a compile error.
41 lines
1.2 KiB
TOML
41 lines
1.2 KiB
TOML
[package]
|
|
name = "typikon"
|
|
version = "1.0.0"
|
|
edition = "2021"
|
|
rust-version = "1.85"
|
|
description = "The Orthodox liturgical day: feasts, seasons and the fast, computed rather than fetched"
|
|
license = "GPL-2.0-only"
|
|
repository = "https://git.pumpin.online/funkpower/typikon"
|
|
readme = "README.md"
|
|
keywords = ["orthodox", "liturgical", "calendar", "byzantine", "pascha"]
|
|
categories = ["command-line-utilities", "date-and-time"]
|
|
|
|
[dependencies]
|
|
serde = { version = "1", features = ["derive"] }
|
|
serde_json = "1"
|
|
clap = { version = "4", features = ["derive"] }
|
|
pyo3 = { version = "0.27.2", features = ["extension-module", "abi3-py39"], optional = true }
|
|
|
|
[profile.release]
|
|
strip = true
|
|
lto = true
|
|
codegen-units = 1
|
|
|
|
[[bin]]
|
|
name = "typikon"
|
|
path = "src/main.rs"
|
|
|
|
[lib]
|
|
name = "typikon"
|
|
path = "src/lib.rs"
|
|
crate-type = ["cdylib", "rlib"]
|
|
|
|
[features]
|
|
# Only maturin turns this on. pyo3's extension-module feature leaves the Python
|
|
# symbols to be resolved by the interpreter at load time, so a normal `cargo
|
|
# build` of the CLI would fail to link if it were on by default.
|
|
python = ["dep:pyo3"]
|
|
# The C ABI. Off by default so an ordinary `cargo build` of the CLI does not
|
|
# also compile and link a shared library nobody asked for.
|
|
capi = []
|