写作与思考2017blog.stephenwolfram.com
什么是“计算散文”?
What Is a Computational Essay?
导读
这篇介绍 Wolfram 的“计算性文章”:把文字、代码和可执行结果放在同一文档里,让论证像故事一样展开,又能被读者亲手验证。对写作者来说,它提示一种新的研究/说明写作方式:不只给结论,还把数据和计算过程交给读者复现。
可以直接用的写作要点
- 01
把关键数据和计算过程嵌进正文,让读者能即时验证,而不是只读结论。
- 02
用可执行示例承担解释功能,让代码块成为叙事节点,前后文字说明它证明了什么。
- 03
像讲故事一样组织技术论证:问题、数据、计算、结论,避免写成产品广告。
- 04
区分“展示代码”与“让代码在文中运行”,后者更能引发读者追问和复现。
HN 评论精选
区分文学化编程与文档内执行代码的“文学化计算”。
文学化编程是把文本和代码编织在一起:你 tangle 文档,代码块被抽出来组成可运行程序。但 Org-mode 的 Babel、iPython 和 Wolfram 的计算性文章属于文学化计算,代码在文档中执行。Howard Abrams 还把这一概念扩展成文学化 DevOps,用 org-mode babel 让文档里的代码去配置本地或远程服务器上的软件。我每天工作流都用 Babel,非常酷。
deerpig查看英文原文
Literate programing is used to tangle text and code. You tangle the document and the code blocks are pulled out to create a working program. But Orgmode's Babel, iPython and Wolfram's Computational Essays are literate computing, with code being executed in the document. Howard Abrams has extended the concept to create literate devops (https://www.youtube.com/watch?v=dljNabciEGg) using orgmode babel where the code in the document is used to configure software running on local or remote servers. I use Babel as part of my daily workflow. Very cool stuff.
认可“代码作为故事”,但提醒文章有产品广告色彩且面临开源生态竞争。
如果我没记错,Mathematica 开创了处理代码时的 notebook 界面,Theodore Gray 甚至拥有相关专利。虽然这篇文章读起来像 Mathematica 和 Wolfram 语言的长篇广告,但我同意“把代码写成用来呈现想法或解决方案的故事”这一理念。遗憾的是,Jupyter notebook 免费开源且兼容其他语言内核,Mathematica 及其 notebook 界面在研究者中的影响力似乎在下滑。
oakridge查看英文原文
If I remember correctly, Mathematica started the notion of having a notebook interface when working with code, Theodore Gray even has the patent for this [0]. Even though the post reads like a longform ad for Mathematica and the Wolfram language, I do agree the notion of code written to present an idea/solution as a story. Sadly, with Jupyter notebooks being free/open source and compatible with other language kernels, there seems to be a decline in the mindshare for Mathematica and its notebook interface among researchers. [0] Patent US 8407580 B2 - Method and system for presenting input expressions and evaluations of the input expressions on a workspace of a computational system (https://www.google.com/patents/US8407580)
计算性文章的思想可追溯到 Knuth 的文学化编程。
好几位发帖者提到 Jupyter,但还有 Knuth 1984 年的文学化编程。
petters查看英文原文
Several posters mention Jupyter, but there also literate programming by Knuth from 1984.
可执行文档让研究更生动且可验证,读者能直接向数据提问。
很像 Jupyter notebooks。这是展示研究、尤其是统计类研究的好方法。对于大型数据集的任何论断,如果不把数据放在手边、随时可计算,几乎无法验证;就算把数据印在附录里,也会让人不想去验证。而且用这种方式能讲的故事生动得多。如果读者对数据某部分有疑问,很多查询可以直接问计算机,而不是问作者。
lordnacho查看英文原文
Pretty much like Jupyter notebooks. It's a great way to present research, especially statistical stuff. It's pretty much impossible to verify any statement about a large dataset without having it to hand and ready to calculate. Even having the data printed in an appendix is going to be discouraging verification. Plus the stories you can tell with this sort of thing are much more vivid. If someone has a question about some part of the data, they can ask the computer instead of the author. For a lot of queries.
同类还值得读
不要想好再写,要写来思考
Don’t think to write, write to think
这篇短文主张不要把写作当成思考完成后的记录,而要把写作本身当作思考的工具:动笔的过程会逼出想不清楚的地方。
写作与思考2022 · 553 分 · 145 评4 条写作要点编辑精选写作即思考:学会自信地写作
Writing Is Thinking: Learning to Write with Confidence
这是一篇讲“写作即思考”的博客:作者认为写作不是把想好的东西誊写出来,而是借助写作本身把想法想清楚,因此写作者应当建立信心、敢于先写烂稿。
写作与思考2019 · 529 分 · 83 评4 条写作要点编辑精选如何用写作来思考
How to think in writing
这篇文章讨论的是「用写作来思考」:作者认为写作不只是把想清楚的东西表达出来,更是想清楚本身的工具——文字落在纸上,你才有机会看见自己思路里的跳跃、含混和漏洞。
写作与思考2024 · 424 分 · 120 评4 条写作要点编辑精选写作,帮你逃离默认的人生设置
Write to Escape Your Default Setting
文章的核心主张就写在标题里:写作是帮你逃离「默认设置」的手段——日常的思维和表达都有惯性默认的默认模式,而落笔能逼你跳出来,重新看清自己到底在想什么、要说什么。
写作与思考2025 · 407 分 · 93 评4 条写作要点编辑精选写作就是思考
Writing is thinking
文章以“写作即思考”为题,讨论写作不只是把已有想法记录下来,而是帮助澄清、组织和推进思考的过程。
写作与思考2025 · 330 分 · 128 评4 条写作要点编辑精选