This repo contains slides and examples for my BOB2021 tutorial Sylvester: computer-based math via F# meta-programming, together with instructions for setting up the environment and its requirements.
This repo has all the tutorial files so make sure you clone this repo to your computer and get the latest updates:
git clone https://github.com/allisterb/bob2021
git fetch && git pull
If you already have .NET Core installed you can skip this step and go ahead to setting up your environment. If not, you can download the latest version of .NET Core here. Installation instructions for Windows, Debian, Ubuntu, RedHat and other Linux package managers are provided, and there are also binary releases for Arm32/64 and x86/64. Installing from binary releases is pretty simple and will make sure you have the latest release. For Windows you can just run the provided installer. For Linux the process is:
- Download the binary archive for your arch e.g. https://download.visualstudio.microsoft.com/download/pr/cd11b0d1-8d79-493f-a702-3ecbadb040aa/d24855458a90944d251dd4c68041d0b7/dotnet-sdk-5.0.103-linux-arm.tar.gz for ARM 32bit.
- Create a folder called
.dotnet
in your$HOME
and expand the contents of the archive there. - Add the following 2 entries to your
~/.basrhc
:
export DOTNET_ROOT=$HOME/.dotnet
export PATH=$PATH:$HOME/.dotnet
- Reload your login shell config with
source ~/.bashrc
. Typedotnet --version
and it should print the version of .NET available e.g.5.0.103
.
There are two environments we can use for this tutorial:
- Jupyter Notebooks using the IFSharp kernel
- Visual Studio Code
Note that you only need to have one of these!
Using Docker
In this repo there is a script run.sh
that will download a Docker image and start a Jupyter Notebooks container with the tutorial notebooks that you can open with your browser.
Manual install Alteratively if you have Python 3 installed you can install Jupyter Notebooks and the IfSharp kernel manually. (If you already have Jupyter Notebooks installed you can skip to step 3.)
- (Recommended) Create a Python 3
venv
to isolate dependencies:python3 -m venv bob2021
and activate it e.g.source bob2021/bin/activate
on Linux or on Windowsbob2021\Scripts\activate
. - Run
pip install jupyter
to install Jupyter in your environment or see the official instructions here. - Download the latest IfSharp kernel release archive here. Expand the archive and on Windows execute
ifsharp.exe
or on Linuxdotnet ifsharp.exe
in your Python environment. The official instructions for installing IfSharp are here.
- With everything installed run
jupyter notebook .
in this repository's root folder. - Jupyter Notebooks should launch and you should see this repository folder. Click on the
FSharp_Jupyter_Notebooks.ipynb
to launch a test F# notebook.
If you already have Visual Studio Code installed then you can skip to installing the F# extension Ionide. If not then installing VS Code is a similar process to installing .NET. There may be older versions available in your package manager but you can download the latest release as a binary archive from https://code.visualstudio.com/#alt-downloads. On Windows you can just run the provided installer. For Linux:
-
Download the latest binary release for your arch e.g. https://code.visualstudio.com/docs/?dv=linuxarmhf for ARM 32bit.
-
Expand the archive in your
$HOME
folder. You will have a folder likeVSCode-linux-armhf
. -
Run
./code
from there. You should see the Visual Studio Code welcome screen. -
Once you have VS Code installed search for the ionide-fsharp extension using the extensions button on the extreme left of the VS Code main window and install it. You should then have everything you need for the tutorial.
I've created a gitter chat: that I'll be monitoring so if you encounter any problems please ping me. See you there!