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

already merged into std? #34

Closed
evbo opened this issue Feb 17, 2022 · 4 comments
Closed

already merged into std? #34

evbo opened this issue Feb 17, 2022 · 4 comments

Comments

@evbo
Copy link

evbo commented Feb 17, 2022

Hi,

I'm curious if it's still worth it using this crate or hasn't std already merged in this code according to?:
rust-lang/rust#86761

So just doing f32::from_str(the_str).unwrap() should get the float parsed fast now with Lemire algorithm right?

@aldanor
Copy link
Owner

aldanor commented Feb 17, 2022

Yep, it has been pretty much fully integrated into the std now! (perhaps it should be clarified in the readme)

This crate has served its purpose as a transitional step towards having the fast-float algorithm in the std, with various details and corner cases polished here performance-wise; it may still be useful though under older rustc versions.

@Alexhuszagh
Copy link
Contributor

@evbo The partial parser is also useful, since the if you have input where you don't want to first identify the valid part of the float then parse (due to performance hits or just implementing the internal logic), the partial parser is still very useful.

@evbo
Copy link
Author

evbo commented Mar 2, 2022

@Alexhuszagh got it, so if there's a near zero percent chance of someone typing an invalid float number (in some file I'm parsing) then I could use this for a speed up. Why didn't the partial parser get merged into std?

@evbo evbo closed this as completed Mar 2, 2022
@Alexhuszagh
Copy link
Contributor

Alexhuszagh commented Mar 2, 2022

@evbo It would require an RFC, which is a relatively long process, and there are concerns of too many methods being introduced into std for what is a relatively niche case, with good third party libraries available (both this, and my own).

I hope this makes sense? There were discussions of merging the partial parser but they went nowhere (at least with the amount of effort I was willing to put in, someone else might be able to convince the language design team this is a good idea if they are willing to put in the effort).

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

3 participants