Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Dev #8

Merged
merged 31 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
e9d0def
text changes
maex0 Jan 8, 2024
48c8d27
refactoring text of comparison
maex0 Jan 8, 2024
3de4565
- conclusion refactoring
maex0 Jan 8, 2024
96c3187
added questions for lecturer
maex0 Jan 8, 2024
421c297
refactoring of text and readme
maex0 Jan 8, 2024
8b3941a
Merge branch 'main' of github.com:maex0/nerddeck into dev
maex0 Jan 8, 2024
cbd1d87
Refactoring
maex0 Jan 8, 2024
1a9ba5e
fixed bib
maex0 Jan 8, 2024
e33f86b
added headings for better structure
maex0 Jan 8, 2024
8b6f49c
refactoring and finished chapter 1.
maex0 Jan 11, 2024
21e38a9
refactoring and finished chapter 2. replaced Flash Card with flashcar…
maex0 Jan 11, 2024
abf18bc
refactoring and finished chapter 3.
maex0 Jan 11, 2024
e5abc74
refactoring and finished chapter 4.
maex0 Jan 11, 2024
268ef1d
added code coverage for f#
maex0 Jan 11, 2024
477f8f3
test code coverage for f# in pipeline
maex0 Jan 11, 2024
0660025
test
maex0 Jan 11, 2024
67560cc
test
maex0 Jan 11, 2024
5e9061c
refactoring and finished chapter 5.
maex0 Jan 11, 2024
623a143
refactoring and finished chapter 6.
maex0 Jan 11, 2024
57d8020
check pipeline
maex0 Jan 11, 2024
55286e9
check pipeline
maex0 Jan 11, 2024
d3bbba0
test
maex0 Jan 11, 2024
4f65631
check pipeline
maex0 Jan 11, 2024
ea89250
fix
maex0 Jan 11, 2024
8270140
removed questions
maex0 Jan 11, 2024
651f578
test pipeline
maex0 Jan 11, 2024
b3c499a
moved images into images folder
maex0 Jan 11, 2024
fb7d991
pipeline
maex0 Jan 11, 2024
ac35beb
include latex pdf in repository
maex0 Jan 11, 2024
26a164b
fix pipeline
maex0 Jan 11, 2024
33b6bba
moved fsharp project in correct directory
maex0 Jan 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ github.workspace }}/fsharp
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -18,10 +21,12 @@ jobs:
dotnet-version: '7.0.x'
- name: Build F#
run: dotnet build
working-directory: ${{ github.workspace }}/fsharp/NerdDeckFSharp
test:
runs-on: ubuntu-latest
needs: build
defaults:
run:
working-directory: ${{ github.workspace }}/fsharp
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -32,4 +37,3 @@ jobs:
dotnet-version: '7.0.x'
- name: Test F#
run: dotnet test
working-directory: ${{ github.workspace }}/fsharp/NerdDeckFSharp
20 changes: 0 additions & 20 deletions .github/workflows/latex.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,3 @@ jobs:
with:
working_directory: './docs'
root_file: document.tex
release_latex:
name: Create Release
needs: build_latex
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: ncipollo/release-action@v1
with:
artifacts: './docs/document.pdf'

- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: docs/document.pdf
asset_name: document.pdf
tag: ${{ github.ref }}
overwrite: true
30 changes: 0 additions & 30 deletions .github/workflows/publishdotnet.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ ehthumbs.db
*.blg
*.log
*.out
*.pdf
logo*.pdf
*.toc
*.idx
*.ilg
Expand Down
37 changes: 29 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,55 @@
![Build Status](https://github.com/maex0/nerddeck/actions/workflows/go.yml/badge.svg)
![Build Status](https://github.com/maex0/nerddeck/actions/workflows/latex.yml/badge.svg)

Welcome to NerdDeck, a project initiated during the first semester of my Master's program at [TH Rosenheim](https://www.th-rosenheim.de) in the course "Concepts of Programming Languages." In this project, I will be comparing two programming languages, [Go](https://go.dev) and [F#](https://dotnet.microsoft.com/languages/fsharp), within the context of functional programming.
Welcome to _NerdDeck_, a project initiated during the first semester of my Master's program at [TH Rosenheim](https://www.th-rosenheim.de) in the course **Concepts of Programming Languages**. In this project, I will be comparing two programming languages, [Go](https://go.dev) and [F#](https://dotnet.microsoft.com/languages/fsharp), within the context of functional programming.

## Project Overview

This repository is dedicated to exploring the paradigms of functional programming in the context of two distinct programming languages: Go and F#.

<img src="ScreenshotNerdDeck.png" alt="ScreenshotNerdDeck" width="500"/>
<img src="./images/ScreenshotNerdDeck.png" alt="ScreenshotNerdDeck" width="500"/>

## Table of Contents

- [Introduction](#nerddeck)
- [Project Overview](#project-overview)
- [Goals](#goals)
- [Paper](#paper)
- [Getting Started](#getting-started)
- [Go](#go)
- [F#](#fsharp)
- [Database](#database)
- [Database Schema](#database-schema)
- [Model](#Model)
- [Contributing](#contributing)
- [License](#license)

## Goals
## Paper

- Compare and contrast the key features of Go and F# as functional programming languages.
- Provide practical examples and use cases to demonstrate the strengths and weaknesses of each language.
- Implement the spaced repetition algorithm SM-2. Information about this algorithm can be found [here](https://www.supermemo.com/en/blog/application-of-a-computer-to-improve-the-results-obtained-in-working-with-the-supermemo-method).
I wrote a paper for this project, it contains an introduction for functional programming, for Go and F# and also for the coding project _NerdDeck_. This paper was written in LaTeX and can be found here [here](./docs/).

## Getting Started

This section is about how you can execute the code by yourself. Note that _NerdDeck_ is only a command line program!

### Go

- Verify that you have installed everything which is necessary Go on your system (info can be found here)
- Clone the repository:
`git clone https://github.com/maex0/nerddeck.git`
- Navigate to the project directory: `cd nerddeck`
- Navigate to the go project directory: `cd go`
- Execute and verify there are no build errors
- Execute and enjoy _NerdDeck_

### F# <a id="fsharp"></a>

- Verify that you have installed everything which is necessary F# on your system. [.NET 7](https://dotnet.microsoft.com/en-us/download/dotnet/7.0) is used.
- Clone the repository:
`git clone https://github.com/maex0/nerddeck.git`
- Navigate to the go project directory: `cd fsharp/NerdDeckFSharp`
- Execute `dotnet build` and verify there are no build errors
- Execute `dotnet run` and enjoy _NerdDeck_

## Database

**Disclaimer:** For the purpose of this project, a single json file is used as a simple and lightweight database to store flashcards. While this approach is suitable for educational and illustrative purposes, it may not be suitable for production usage due to limitations in scalability and concurrent access.
Expand Down Expand Up @@ -59,7 +80,7 @@ The flashcard data is stored in a JSON file with the following structure:

ID is the primary key, generated from question and answer.

![Nerddeck model](NerddeckModel.png)
![Nerddeck model](./images/NerddeckModel.png)

## Contributing

Expand Down
20 changes: 14 additions & 6 deletions docs/abbreviations.tex
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
\chapter{Abkürzungen}\label{a:Abkuerzungen}
\chapter{Appendix}

\chapter*{Acronyms}

\begin{acronym}

\acro{app}[App]{Application}
\acro{mvp}[MVP]{Minimal Viable Product}
\acro{json}[JSON]{JavaScript Object Notation}
\acro{sm2}[SM-2]{SuperMemo 2.0}
\acro{cli}[CLI]{Command Line Interface}
\acro{fp}[FP]{functional programming}
\acro{gui}[GUI]{Graphical User Interface}
\acro{fp}[FP]{Functional programming}
\acro{json}[JSON]{JavaScript Object Notation}
\acro{mvp}[MVP]{Minimal Viable Product}
\acro{repl}[REPL]{Read-eval-print loop}
\acro{sm2}[SM2]{SuperMemo 2.0}
\acro{uml}[UML]{Unified Modeling Language}

\end{acronym}

\end{acronym}
\listoffigures{}
\lstlistoflistings{}
\listoftables{}
2 changes: 1 addition & 1 deletion docs/abstract.tex
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
\chapter*{Abstract}
\thispagestyle{empty}
This paper presents a comparative analysis of functional programming paradigms in Go and F\#, focusing on key concepts such as Algebraic Data Types and First-class Functions. The \textit{NerdDeck} Flash Card application serves as a practical example to illustrate the application of functional programming principles in both languages. Despite inherent challenges arising from the impurity of both languages, the comparison reveals distinctions in their approaches, emphasizing F\#'s native support for functional programming and Go's adaptation within its multi-paradigm framework.
This paper presents a comparative analysis of functional programming paradigms in Go and F\#, focusing on key concepts such as Algebraic Data Types and First-class Functions. The \textit{NerdDeck} flashcard application serves as a practical example to illustrate the application of functional programming principles in both languages. Despite inherent challenges arising from the impurity of both languages, the comparison reveals distinctions in their approaches, emphasizing F\#'s native support for functional programming and Go's adaptation within its multi-paradigm framework.

The challenges encountered underscore the importance of balancing functional and imperative programming in each language, prompting a nuanced approach in selecting languages for projects prioritizing functional programming principles. Looking ahead, further exploration into writing purer functional code within projects like \textit{NerdDeck} is proposed. This could involve delving deeper into functional programming concepts and considering the use of purely functional languages like Haskell. As programming languages and paradigms continue to evolve, ongoing advancements may present new opportunities and challenges for functional programming practitioners.

Expand Down
Loading