As a small project for rainy sundays I am implementing a function to calculate the fibonacci sequence in various languages. The problem in itself is not too interesting and therefore provides a perfect vessel to look at some peculiarities about programming languages.
- Haskell: This post introduces direct recursion and accumulated recursion in Haskell.
- C: C as an imperative language is introduced, and Fibonacci was implemented in an iterative style.
- Java: The Fibonacci function is implemented by means of dynamic programming.
- Scala: Scala is the language, Continuation Passing style is the concept.
- Prolog: Fibonacci is here implemented in logic programming. Furthermore, we use ADTs to derive the argument to the function.
- Spreadsheet: The key idea is to abstract the concept of programming to include more than written text.
- JavaScript: Introducing the concept of events in JavaScript. This is a base for the concepts of streams, signals, etc. which will be introduced later on.
- Coq: The introduction of theorem proving using a programming language.
- R: Using R to plot the relationship between $n$ and $fib(n)$.
- Haskell Types: Implementing the Fibonacci function using dependent programming in Haskell.
- Python: Focusing on the relationship between list comprehensions and set definitions in mathematics.
- Fixed Point: Introducing the theoretical concept of fixed points.
- Julia: Using fast exponentiation.