4 ms·
Maybe literate programming (http://en.wikipedia.org/wiki/Literate_programming http://en.wikipedia.org/wiki/Literate_programming) goes some way towards that? Or
by groundCode 11y ago
Maybe literate programming (http://en.wikipedia.org/wiki/Literate_programming http://en.wikipedia.org/wiki/Literate_programming) goes some way towards that? Or at least could be extended to do that?
- falcolas 11y agoThis is a good example of what the OP is asking for. However, you really have to see an example of it to understand the benefits. The writers of the "Physically Based Rendering: From Theory to Implementation" did this for their book, and it's pretty amazing. They would write text, then a code block: func main() { <main body variable declarations> <main body functions> } followed by another block of text, and then an expansion of the code <main body variable declarations> = var foo int var bar int64 And so on. <main body variable declarations> += var zed rune Which, when run through the "tangler", would produce: func main () { var foo int var bar int64 var zed rune } The first really interesting implementation I've seen of literate programming, and it makes me want to implement it myself.