Skip to content

martin045k/fsharp-starter

 
 

Repository files navigation

F# Starter

This folder contains the skeleton of a parser along with the input and output types for each analysis given in the assignment. It also contains an example of a "calculator" program in F# that reads an arithmetic expression from the command line and print the result of evaluating such expression for initial testing.

Files

F#/FsLexYacc

Getting started

Building this project requires .NET 7.0. For installation, follow the description matching your platform:

  • Windows: Installation instructions for this, can be found here.
  • macOS: Building on macOS requires the dotnet-sdk package. This can be installed using Homebrew and running brew install dotnet-sdk
  • Linux: There are many ways to install on Linux, but a good starting point might be this.

To check that you have an up-to-date version run dotnet --version to display the version number, which should be something starting with 7. If it does not, consider updating your installation, and if that doesn't work, try uninstalling your current version and installing from scratch.

The next step is getting the code, which is done by cloning this repository and using cd to change directory to the newly cloned folder. To do this, make sure that you have your SSH keys set up correctly (instructions for GitLab).

Running the code

To run the program, navigate to the directory of your cloned repository and do:

dotnet run

This should display a list of the available commands to run. Among these are the calculator, which is a good starting point.

To run the calculator do:

dotnet run calc "1 + 52 * 23"

Interactive UI

When you get further, the analysis can be explored in the interactive tool. Run the program in the dev/ folder matching your operating system.

# Windows
./dev/win.exe --open

# macOS
./dev/macos --open

# linux
./dev/linux --open

With the --open flag this should open the tool at http://localhost:3000/ in your browser.

The tool knows how to compile your program by the instructions in run.toml.

Downloading updates

It is recommended to update the binaries in dev/ regularly. You do this by running the command below matching your platform, and following the instructions when prompted:

# Windows
./dev/win.exe --self-update

# macOS
./dev/macos --self-update

# linux
./dev/linux --self-update

Evaluation

Every time you push your Git repository, your code is ready to be evaluated automatically by your teachers.

When your project has been evaluated, the results can be seen (at GitLab) in the "result" branch.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • F# 100.0%