Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider placement into the Nim std library? #1

Closed
JohnAD opened this issue Dec 1, 2021 · 1 comment
Closed

Consider placement into the Nim std library? #1

JohnAD opened this issue Dec 1, 2021 · 1 comment

Comments

@JohnAD
Copy link

JohnAD commented Dec 1, 2021

I'm halfway through writing a 128-bit decimal library for the Nim standard library (see nim-lang/RFCs#308) based on IEEE 754-2008's 128-bit specification.

Internally, it uses a 113-bit uint decimal base. So I've been working on a bad hack to make the core arithmetic work as I concentrate more on the serialization and conformance to spec.

But, looking at your code, I'd much prefer to use the work you have already done here for the arithmetic. Unfortunately, that wouldn't work if nim-nint128 is an external library.

So, I selfishly ask: would you be interested in migrating your work to Nim's internal std library?

Disclaimer: I've been on a 6+ month hiatus on my decimal project. I won't be picking it back up till 2Q2022 as I've got too many customers at the moment.

@rockcavera
Copy link
Owner

JohnAD, I know your RFC and have followed it since it was released. I don't have any knowledge about decimal128, but it sure will be a great addition to Nim stdlib.

About int128 on Nim, either as a builtin or as a stdlib package, it doesn't matter to me. I even mentioned this in the RFC that covers adding int128 to the language.

Now about your question if I would be able to add this package to Nim's stdlib. My answer is: I wish I had the time available for this. nint128 is a package that I've been making little by little for over 1 year. I do a little and stop, due to the day-to-day tasks (I'm a lawyer and not a programmer). There is still a lot to be done, especially in the issue of checking for overflows, which will require an "int256". So to bring something healthy to stdlib, I don't have availability. But anyone interested in what's been done here can do that. Therefore, I cannot commit to this at the moment. Sorry.

In advance, I thank you for the request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants