Functional programming is a programming paradigm which makes it easy to create, reason about, and compose functions.
8
votes
0answers
165 views
Functional Programming: efficiently handling whole world changes? [duplicate]
Imagine we're creating a multiplayer dungeon crawl (a roguelike) using FP where we emphasize pure functions and immutable data structures. We generate a dungeon composed of rooms, corridors, heroes, ...
2
votes
3answers
184 views
Functional Programming: right ideas about concurrency and state?
FP proponents have claimed that concurrency is easy because their paradigm avoids mutable state. I don't get it.
Imagine we're creating a multiplayer dungeon crawl (a roguelike) using FP where we ...
0
votes
0answers
24 views
Question about vpython? [closed]
I have zero programming experience and I am just learning how to use vpython. I am trying to make an object follow a certain path described by a function. Is there any way to do this in vpython? If ...
4
votes
5answers
378 views
Is there any difference between pointers and references? [duplicate]
References and pointers do the same thing as I know. Is there any difference between them?
If there is no difference, why we call them reference not pointer?
5
votes
2answers
234 views
Is Haskell/Clojure actually unsuited for dynamic systems such as particle simulation?
I've been told in previous questions that functional programming languages are unsuited for dynamic systems such as a physics engine, mainly because it's costly to mutate objects. How realistic is ...
0
votes
0answers
63 views
NGL programming language?
Are there some online resources about the NGL language, please? Google
did not helped much this time. In fact, the only relevant information I was
able to find is the one on Wikipedia...
...
6
votes
2answers
146 views
What is “Semantics visibility”?
I'm reading 97 Things Every Programmer Should Know, now I'm positioned in "Apply Functional Programming Principles", and there is a paragraph that says:
...A leading cause of defects in imperative ...
8
votes
1answer
151 views
Functional Reactive/Relational Programming – Is there a difference?
I've been using Reactive Cocoa (by GitHub), a Functional Reactive Programming API for use with the Cocoa libraries for a while now, but have just read "Out of the Tar Pit", the paper that supposedly ...
1
vote
1answer
86 views
Ring of numbers where adjacent entries sum up to a prime
Given a number n, find a permutation of the numbers 1...n such that all adjacent entries sum up to primes. If such a permutation does not exist, throw an error.
Is there a purely-functional way to do ...
1
vote
1answer
85 views
Permuting a list of numbers by pushing and popping onto a stack
Suppose we have some long stack of numbers. There is another intermediate stack, and a destination stack to be returned in the end. The only two operations allowed is transferring the top of the old ...
21
votes
1answer
437 views
Performance of single-assignment ADT oriented code on modern CPUs
Working in immutable data with single assignments has the obvious effect of requiring more memory, one would presume, because you're constantly creating new values (though compilers under the covers ...
7
votes
1answer
256 views
Are “normal order” and “call-by-name” the same thing?
I was studying the book Structure and Interpretation of Computer Programs and in section 1.1.5 The Substitution Model for Procedure Application the author explains the concepts of normal order and ...
-1
votes
1answer
113 views
max(x-y,0) is loop-computable [closed]
I use the programming language Loop: http://en.wikipedia.org/wiki/LOOP_%28programming_language%29
I know that the every primitve recursive function is loop computable and vice versa but I would like ...
7
votes
2answers
321 views
implement cons function in Java - type safety question
I am working on a small functional library written in Java, which mimics the a functional style of programming. I am stuck with a undesirable type cast in one of my method definitions and would love ...
1
vote
1answer
102 views
LOOP program only need inc and zero
I have 4 different commands in LOOP programming language:
y=Zero()
y=Val(x)=copy x and put it in register y
y=Inc(x)=x+1
y=Dec(x)=x-1
Finally I also have
loop n times {
...
...