I was experimenting with this package being written in rust, as importing rich, attrs, json, requests, etc. in python is costly. Maturin bindings would be near-instant and performant, however there were some obstacles:
- How to define a pure-rust crate and wrap it with pyo3 externally to extend it, without unit tuple structs or inner abstractions? While at it, rust and python semantics varies a lot - args kwargs vs macros.
- Find a non Ai-slop package for rich-like formatting or markdown to ansi styling. Should be easily doable with some
regrets regexes and applying crossterm or owo-colors methods on strings.
- Should the library use crossbeam channels for async/decoupled logs? Complexity would skyrocket, will need to manage worker and lifetimes, synchronization, atexit waiting, backpressure, etc.
pyo3-stub-gen works, but I'm not a big fan of hidden complexity for python users.
- Any way to go DRY with every
#[new] method to use builder-like or smart-default?
For the time being, will make this a pure-python package and paying close attention to import times.
I was experimenting with this package being written in rust, as importing rich, attrs, json, requests, etc. in python is costly. Maturin bindings would be near-instant and performant, however there were some obstacles:
regretsregexes and applying crossterm or owo-colors methods on strings.pyo3-stub-genworks, but I'm not a big fan of hidden complexity for python users.#[new]method to use builder-like orsmart-default?For the time being, will make this a pure-python package and paying close attention to import times.