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

Could rustdoc annotate complexity? #2859

Closed
i30817 opened this issue Jul 10, 2012 · 8 comments
Closed

Could rustdoc annotate complexity? #2859

i30817 opened this issue Jul 10, 2012 · 8 comments
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@i30817
Copy link

i30817 commented Jul 10, 2012

I liked using glazedlist javadocs because their documentation had a simple O(n) notation for concrete implementations of datastructures
(ex : http://publicobject.com/glazedlists/glazedlists-1.8.0/api/ca/odell/glazedlists/BasicEventList.html )

I wonder if it would be possible to generalize this sort of thing into the doc tool, and maybe to infer the minimum complexity of a new piece of code (composition)?

I don't know if it is feasible

@bblum
Copy link
Contributor

bblum commented Jul 10, 2012

I can't speak to inferring, which seems hard, but I'd like to see complexity written in the rustdoc for our libraries. (Haskell's docs do this admirably.) I started doing this with dlist.rs.

@catamorphism
Copy link
Contributor

Inferring would be very hard (unsolved research problem). Having a rustdoc field for it seems pretty straightforward.

@Aatch
Copy link
Contributor

Aatch commented Apr 29, 2013

Having a field is fine, but still just nice-to-have, no milestone.

@ghost ghost assigned emberian Jul 5, 2013
@emberian
Copy link
Member

emberian commented Jul 5, 2013

Absorbing this for rustdoc2

@emberian
Copy link
Member

#8125

/cc @Seldaek

I see this implemented purely in the doc comments, using markdown:

## Complexity

Space    Time
-----    ----
O(n)    O(n^2)

@Seldaek
Copy link
Contributor

Seldaek commented Aug 15, 2013

If it's markdown, it'll render as markdown, I don't need to do anything :)

@emberian
Copy link
Member

I'm going to close this, since I don't think more special-casing of certain things in the doc comment is desirable. You can add whatever docs you want in the markdown.

@Kerollmops
Copy link
Contributor

Just for information, criterion.rs can probably help to achieve this kind of inference, I find some informations about Google Benchmarks doing such detections.

Criterion.rs is an external crate so it will probably be difficult to inject the inferred complexity into the documentation at doc compilation time, but... I put this here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

7 participants