Skip to content

cmatheja/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 contain 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. Installation

  • 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.

Running the code

To run the program 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 dev/ folder matching you 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 to git, the program is ready to be evaluated automatically by your teachers.

The results as they are produced, 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%