Write literate code in Markdown, then use Literature to extract code blocks that you can pass to any compiler.