Skip to content

Rust crate with maturin bindings rewrite #1

@Tremeschin

Description

@Tremeschin

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions