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

Idea: Convert to RST/Sphinx and use doctest. #412

Closed
pipermerriam opened this issue Jan 8, 2019 · 3 comments
Closed

Idea: Convert to RST/Sphinx and use doctest. #412

pipermerriam opened this issue Jan 8, 2019 · 3 comments
Labels
general:enhancement New feature or request

Comments

@pipermerriam
Copy link
Member

I was perusing the spec and see there are a lot of code blocks with example code.

If this spec were to be converted to RST/Sphinx then you could benefit from using doctest allowing you to verify that your example implementations pass some set of test vectors, etc.

For Reference: http://www.sphinx-doc.org/en/stable/ext/doctest.html

We use doctest in most of our python repositories and it is the single most important thing that ensures our documentation is up-to-date and doesn't diverge from the code itself.

@ralexstokes
Copy link
Member

i will +1 this idea, with the caveat that we should probably wait for some kind of spec release candidate i have heard rumors about...

but the closer the spec is to executable the better -- this would also motivate us to actually write and maintain spec test vectors which are helpful to implementers and anyone else aiming to understand the spec (just like unit tests in your codebase).

and while we are on the topic, it's worth noting that the logical extreme of this is just turning the spec into literate K (or Coq or whatever) so that any tests we write turn into formal specifications

@hwwhww hwwhww added the general:enhancement New feature or request label Jan 11, 2019
@JustinDrake
Copy link
Collaborator

Executable or semi-executable specs are a good idea. I'm slowly working towards one in Go, Vitalik may be working on one in Python, and RuntimeVerification may write one in K.

Anyone who wants to take this on please reopen :)

@JustinDrake
Copy link
Collaborator

I think this can be closed given #835 is closed. Feel free to reopen :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
general:enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants