sharkdp / numbat

A statically typed programming language for scientific computations with first class support for physical dimensions and units
https://numbat.dev
Apache License 2.0
1.13k stars 46 forks source link

DateTime: Enhancements #323

Open sharkdp opened 7 months ago

sharkdp commented 7 months ago

A few enhancements that I thought about while reviewing #287. Let's discuss them here and potentially implement later:

A few useful functions would be:

RossSmyth commented 1 month ago

Would probably good to take some inspiration from burntshushi's new lib https://github.com/BurntSushi/jiff

sharkdp commented 1 month ago

Would probably good to take some inspiration from burntshushi's new lib

Yes! I thought the same thing when I read about it. Would be interesting to port from chrono to jiff as a small experiment. jiff might be beneficial for us due to its TZ database handling strategy, which would solve https://github.com/sharkdp/numbat/issues/344 after all.

BurntSushi commented 1 month ago

Would be interesting to port from chrono to jiff as a small experiment.

I'm doing some of these myself and adding APIs to Jiff as a result of those experiments. So if you do this, please reach out. I'd love to hear feedback. I'm keen to iterate for the next ~year and get Jiff to 1.0.

BurntSushi commented 1 month ago

Looking at your list, I believe Jiff should support doing everything there, except for automatic locale support. For locale, I'm hoping an integration with icu will make that work, although I haven't done any exploration there.

sharkdp commented 1 month ago

@BurntSushi I ported Numbat from chrono to jiff here: https://github.com/sharkdp/numbat/pull/511

I wrote some comments, which might be helpful for you to get some insights into the chrono-to-jiff journey by someone who's not yet familar with jiff.

sharkdp commented 1 month ago

The jiff PR has now been merged, which checks off two items from our list: