jarun/bcal

Add API so this can be used as library?

matthiasbeyer opened this issue · 1 comments

Hi,

for reference: https://www.reddit.com/r/commandline/comments/elcprz/bcal_storage_expression_and_generalpurpose/fdhwhy0/

We talked about whether it would be a nice idea to provide an API for this software, so it can be used as a library. My special use-case is to provide language bindings for Rust, but others might also create language bindings for other programming languages.

This might be a twofold change:

  • Create a string-in string-out API, where a user of the API can submit a string that gets parsed and calculated and gets back a string that represents the result
  • Provide a higher-level API where the result is an object that has a value and a unit, so others can then continue using these values.
    The end-game would then be to provide a higher-level input library, of course. Where a user of the library would submit an expression object that gets then calculated by the library... so basically the user submits an AST.

If you want help designing the API, I'd be glad to help.

jarun commented

If you want help designing the API, I'd be glad to help.

Other than defects, I am not investing time on bcal anymore. The current features serve my use-cases. That's the reason I specifically requested you to raise a PR directly.