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

Is Proper Ratio Support on the Roadmap? #67

Open
BSlug opened this issue Jun 23, 2024 · 3 comments
Open

Is Proper Ratio Support on the Roadmap? #67

BSlug opened this issue Jun 23, 2024 · 3 comments
Labels
question Further information is requested

Comments

@BSlug
Copy link

BSlug commented Jun 23, 2024

Currently, I believe e.g. (/ 9 2) evaluates to 4. I’ve read that float support is unlikely to happen for portability reasons, but ratios could offer a middleground.

@l4haie
Copy link
Collaborator

l4haie commented Jun 24, 2024

We’re actively working towards supporting floats in ribbit, hopefully this will be done by the end of summer!

@BSlug
Copy link
Author

BSlug commented Jun 27, 2024

Will there be a way to easily exclude floats from the numerical stack, for systems such as microcontrollers where the float routines would increase the binary size considerably?

@leo-ard
Copy link
Collaborator

leo-ard commented Jun 28, 2024

yes ! This will be done through the feature system of ribbit. To have proper floats, you will need to enable the "float" feature.

It will use the underlying implementation when available. For example, if running on the C RVM, the already existing implementation of floats can be reused. Only conversions between Scheme and C need to be handled.

For hosts that don't have native support for floats, I'm not yet sure what we are going to do as emulating them would be quite a challenge and would probably result in pretty slow implementation of IEEE-754 floats. Maybe a scheme library that support ratios could be a good middle-ground

@leo-ard leo-ard added question Further information is requested labels Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants