This commit is contained in:
jverzani
2024-05-22 07:55:20 -04:00
parent f710cded15
commit 771bb06aa3
50 changed files with 120 additions and 426 deletions

View File

@@ -61,13 +61,13 @@ julia> 2 + 2
* The [Pluto](https://github.com/fonsp/Pluto.jl) package provides a *reactive* notebook interface. Reactive means when one "cell" is modified and executed, the new values cascade to all other dependent cells which in turn are updated. This is very useful for exploring a parameter space, say. Pluto notebooks can be exported as HTML files which make them easy to read online and by clever design embed the `.jl` file that can run through `Pluto` if it is downloaded.
The `Pluto` interface has some idiosyncracies that need explanation:
The `Pluto` interface has some idiosyncrasies that need explanation:
* Cells can only have one command within them. Multiple-command cells must be contained in a `begin` block or a `let` block.
* By default, the cells are *reactive*. This means when a variable in one cell is changed, then any references to that variable are also updated like a spreadsheet. This is fantastic for updating several computations at once. However it means variable names can not be repeated within a page. Pedagogically, it is convenient to use variable names and function names (e.g., `x` and `f`) repeatedly, but this is only possible *if* they are within a `let` block or a function body.
* To not repeat names, but to be able to reference a value from cell-to-cell, some Unicode variants are used within a page. Visually these look familiar, but typing the names requires some understanding of Unicode input. The primary usages is *bold italic* (e.g., `\bix[tab]` or `\bif[tab]`) or *bold face* (e.g. `\bfx[tab]` or `\bff[tab]`).
* The notebooks snapshot the packages they depend on, which is great for reproducability, but may mean older versions are silently used.
* The notebooks snapshot the packages they depend on, which is great for reproducibility, but may mean older versions are silently used.
## Augmenting base `Julia`
@@ -121,7 +121,7 @@ In a terminal setting, there is a package mode, entered by typing `]` as the lea
Packages can be updated through the command `Pkg.update()`, and removed with `Pkg.rm(pkgname)`.
By default packages are installed in a common area. It may be desirable to keep packages for projects isolated. For this the `Pkg.activate` command can be used. This feature allows a means to have reproducible environments even if `Julia` or the packages used are upgraded, possibly introducing incompatabilities.
By default packages are installed in a common area. It may be desirable to keep packages for projects isolated. For this the `Pkg.activate` command can be used. This feature allows a means to have reproducible environments even if `Julia` or the packages used are upgraded, possibly introducing incompatibilities.
For these notes, the following packages, among others, are used:
@@ -150,7 +150,7 @@ In a `Jupyter` notebook or `Pluto` notebook, commands are typed into a notebook
Commands are executed by using `shift-enter` or a run button near the cell.
In `Jupyter` multiple commands per cell are allowed. In `Pluto`, a `begin` or `let` block is used to collect multiple commmands into a single cell. Commands may be separated by new lines or semicolons.
In `Jupyter` multiple commands per cell are allowed. In `Pluto`, a `begin` or `let` block is used to collect multiple commands into a single cell. Commands may be separated by new lines or semicolons.
On a given line, anything **after** a `#` is a *comment* and is not processed.