Previous | Next --- Slide 8 of 50
Back to Lecture Thumbnails
kristinayige

Just curious, what are some use cases for Haskell language?

legoat

Haskell is a great general functional programming language. Functional programming is a different style of programming than traditional von Neumann-style languages (like C and C++). Although equally powerful, functional programming encourages us to think in terms of applying and composing functions to sets of data, which can be extremely efficient in some cases compared to serial languages like C, which may require heavy use of loops to accomplish the same thing. An example of a (very simple) functional programming model is MapReduce.

John Backus' Turing Award lecture is a good argument for functional languages: https://dl.acm.org/doi/10.1145/359576.359579.

terribilis

Looking into functional programming languages, I see that they don't support loop statements or conditional statements. In order to achieve similar results or control you would instead have to use a function call. One of functional programmings main advantages is that it works very well with parallel programming.

hamood

How does this relate to MapReduce? I'm guessing one of the big advantages of using MapReduce is that the "map" step can be done in parallel like shown in the slide. What about the "reduce" step?

awu

@hamood looks like it's not a direct relation https://en.wikipedia.org/wiki/MapReduce

derrick

When we're thinking about using sequences instead of arrays for these examples, how exactly does that change this implementation? It seems that if we wanted to parallelize map that takes in a sequence, we would have to do it in order instead of being able to parallelize mapping elements in some arbitrary order instead. What's the logic with using sequences instead?

sirej

Sequences are an abstraction that can be implemented in different ways. For example, it could be a c-style array in memory like you mentioned, or it could be a sequence of data that is contained in files on disk, or across different machines. Either way, they are all different ways to implement the concept of "a sequence of values". The benefit of this abstraction is to allow us to think about operations on sequences and see that it applies to all these different implementations.

Please log in to leave a comment.