Editing 1312: Haskell
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 8: | Line 8: | ||
==Explanation== | ==Explanation== | ||
− | |||
− | The | + | The comic pokes fun at {{w|Haskell (programming language)|Haskell}}, a {{w|Functional programming|functional programming language}}. Functional programming languages are based on the mathematical concept of a function, that is two calls to a function always produce the same results given the same inputs. {{w|Side effect (computer science)|Side effect}}s of a function call are changes to the program state or observable interactions with the outside world, other than returning a value. As a simple example, if a <code>sum</code> function changes a global variable, or prints the sum before returning it, those are side effects. Functions in most other languages frequently have side effects, typically making them hard to analyze. Functional programming languages seek to avoid side effects when possible. When side effects are required (for instance input and output), they are isolated to {{w|monad_(functional_programming)|monads}}, which are ways of representing sequential steps in functional programming. |
− | + | The first joke says that Haskell only has no side effects because no one ever uses Haskell programs. This is a common misconception, in fact in Haskell effects are first class values. This means that you can use effects just like any value, assign them to a variable, pass them around, or manipulate them to make new and different effects. Even in a traditional procedural programming language like {{w|C (programming language)|C}}, if the program does not run it can't have side effects. | |
− | The title text is a joke about Haskell's {{w|lazy evaluation}}. The basic concept is that a value is not computed until it is actually used. Thus, it is possible to have a name representing the entire infinite list of {{w|Fibonacci number|Fibonacci numbers}}. However, until a particular element of the list is accessed, no work is actually done. The joke plays on "called" (referring to calling a function) vs. "called for" (requesting) | + | The title text is a joke about Haskell's {{w|lazy evaluation}}. The basic concept is that a value is not computed until it is actually used. Thus, it is possible to have a name representing the entire infinite list of {{w|Fibonacci number|Fibonacci numbers}}. However, until a particular element of the list is accessed, no work is actually done. The joke plays on "called" (referring to calling a function) vs. "called for" (requesting): thus Haskell may have value but no one has either invoked it to get that value or requested such a language. |
− | + | In reality, Haskell is indeed actively used, though it is not one of the most popular languages. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | In reality, Haskell is indeed actively used, though it is not one of the most popular languages | ||
==Transcript== | ==Transcript== |