# Export Code to Pseudocode?

I'm writing a paper and all my code is in Mathematica. The snippets are mostly simple, and consist of loops, maps, variables, and conditionals. I'd like add it to my paper, however, not many academic journals accept verbatim code in a specific language, and I'm short on time, so here is my question:

Does anyone know of a package that translates Mathematica functions and code to pseudo-code?

Of course there is no universal syntax pseudo-code, but I'll accept anything that is adequately general (bonus points for robust exportability to $\LaTeX$). Here are some examples of this utility in other languages:

When writing papers I always do the translation by hand, but enough is enough, Mathematica should excel at a high-level translation problem like this and at least get the bulk of the work done for me! I use the pseudocode environment from the fancybox package to typeset pseudocode into $\LaTeX$.

Please note that I fully intend on trying to write an answer to this myself, so don't down vote for the lack of code just yet! :)

-
+1, but I always wanted a package able to do it the other way around and can interpret my "Now get all those solutions" pseudocode comments –  belisarius Oct 29 at 6:09
Me too! Alas that direction is much much harder :/ I have a friend who believes that smart and visual programming languages in the next 10 years will have this ability. –  M.R. Oct 29 at 6:21
Perhaps SpokenString or CompilePrint could come in handy. –  Simon Woods Oct 29 at 11:52
But now with all those upvotes you sure gotta deliver ;-) –  Yves Klett Oct 29 at 13:35
IMO this is problematic due to the ill-defined nature of "pseudocode", dependent as it is on the expectations of the audience. I actually dislike pseudocode descriptions in papers since normally they are written in an inappropriately procedural style and often contain various bugs due to the fact that they can't actually be executed to check for correctness. I would suggest translating to some widely used, free and open language such as Python and providing the code in the supplementary materials. Another good alternative to pseudocode is a flowchart. –  Oleksandr R. Oct 29 at 19:14
show 1 more comment