Open brianhuffman opened 5 years ago
@brianhuffman, do you have in mind a good way to achieve this? Is this something you've done before?
No, I've never implemented anything like this before.
For parsing and type checking, I suppose we could just have the test suite load some of the .tex files as literate cryptol.
To keep example REPL output up to date, we might need to make a custom script or tool to help do that. One approach might be to use a special latex command for REPL commands, and another special latex command for REPL output. A tool could then collect the contents of all of these latex commands in the book, and generate an .icry
file and an .icry.stdout
file that could be run just like any other regression test. (I'm no TeX expert, but perhaps there's even a way to make TeX produce such files automatically as a side-effect of typesetting the book?)
After chatting with various folks about ways to achieve this, I'm not sure this is reasonable to fit into the 2.9 timeframe. It's going to involve some tedious TeX and/or Makefile kinds of hacking. What do you think @atomb?
Yeah, you're probably right. I know that when I've tried to do similar things in the past it's been somewhat complex. Let's bump it.
@WeeknightMVP has been exploring this same issue for our Cryptol course and has a nice set of scripts for pulling Cryptol and shell sessions from markdown.
This is pretty much done now, and has been for some time. Only the "Crash Course" chapter has really been hooked up, though.
The Programming Cryptol book contains lots of code snippets and example REPL output. We'd like for this material to stay up-to-date with newer revisions of Cryptol. But it would also be nice not to have to check all of it manually.
We should implement a test script that compiles and runs all of the example Cryptol code and REPL commands in the LaTeX documentation to make sure they continues to parse, type-check, and produce the expected output.