工作流程建议

    正如在 中演示的那样,Julia 的 REPL 为高效的交互式工作流程提供了丰富的功能。这里是一些可能进一步提升你在命令行下的体验的建议。

    最基本的 Julia 工作流程是将一个文本编辑器配合 的命令行使用。一般会包含下面一些步骤:

    • 把还在开发中的代码放到一个临时的模块中。新建一个文件,例如 Tmp.jl,并放到模块中。

    • 打肥皂,冲洗,重复。(译者注:此为英语幽默,被称为“洗发算法”julia REPL 中摸索不同的想法,把好的想法存入 。要在 tst.jl 被更改后执行它,只需再次 include 它。

    也可以通过 在浏览器中与 Julia REPL 进行交互,请到该库的主页查看详细用法。

    Whether you’re at the REPL or in IJulia, you can typically improve your development experience with Revise. It is common to configure Revise to start whenever julia is started, as per the instructions in the . Once configured, Revise will track changes to files in any loaded modules, and to any files loaded in to the REPL with includet (but not with plain include); you can then edit the files and the changes take effect without restarting your julia session. A standard workflow is similar to the REPL-based workflow above, with the following modifications:

    1. Develop your package

      Before loading any code, make sure you’re running Revise: say using Revise or follow its documentation on configuring it to run automatically.

      You can iteratively modify the code in MyPkg in your editor and re-run the tests with include("runtests.jl"). You generally should not need to restart your Julia session to see the changes take effect (subject to a few limitations, see https://timholy.github.io/Revise.jl/stable/limitations/).