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

Implement a proper 'numerical tower' in core or std #4231

Closed
brendanzab opened this issue Dec 20, 2012 · 10 comments
Closed

Implement a proper 'numerical tower' in core or std #4231

brendanzab opened this issue Dec 20, 2012 · 10 comments

Comments

@brendanzab
Copy link
Member

I'm not sure how feasible this currently is. We would have to think in terms of compile-time, zero-cost abstractions. On #rust:

erickt: once we get default methods we can make proper mathematical groups, semigroups, rings, and etc

Relevant articles on Wikipedia:

Other things to consider in the same vein are units of measure, range types and mod types. Perhaps these could be implemented via traits and default methods.

@brendanzab
Copy link
Member Author

An interesting paper on numerical towers in Typed Racket: http://www.ccs.neu.edu/racket/pubs/padl12-stff.pdf

@erickt
Copy link
Contributor

erickt commented Dec 20, 2012

A couple more links for interesting algebraic systems from Haskell [1], [2] and Felix [3] that I think would be pretty straightforward to migrate over to Rust:

1: Haskell Numeric Classes
2: Haskell Constructive Algebra
3: Felix Algebraic Typeclasses

@emberian
Copy link
Member

emberian commented Jul 8, 2013

@bjz default methods have mostly arrived!

@glaebhoerl
Copy link
Contributor

@catamorphism
Copy link
Contributor

This doesn't seem to have been nominated properly. Nominating in order to clear the milestone. I don't think this blocks production-readiness.

@catamorphism
Copy link
Contributor

We agreed that if this is going to be a milestone bug, it should be more specific. De-nominating.

@metajack
Copy link
Contributor

Triage bump.

Work is ongoing on cleaning up the traits in libstd.

@thestinger
Copy link
Contributor

I think we're in agreement that this should be done out-of-tree. Once there's a fleshed out library, proposing an inclusion of it in the standard library via an RFC would make sense.

@ticki
Copy link
Contributor

ticki commented Dec 16, 2015

I would love to see this reopened. This would definitely boost the abilitiy to write generic code (without external libraries). Though there are some caveats.

@brendanzab
Copy link
Member Author

I think this would be better off as a third-party lib first. Then it can be combined at a later date if it is deemed good enough.

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

8 participants