While not about FBP directly, again some argumentation that we may find useful:
http://fpcomplete.com/the-downfall-of-imperative-programming/
While not about FBP directly, again some argumentation that we may find useful:
http://fpcomplete.com/the-downfall-of-imperative-programming/
> I think flow based programming offers another way to avoid data-races,
> without immutability. That is, an IP may be modified and passed on to the
> next processor. Right?
Yes, because access to the IP is effectively serialized by the rule that
a process can no longer touch it after it sends it on. JavaFBP does not
actually enforce this.
--
De plichten van een docent zijn divers, John Cowan
die van het gehoor ook. co...@ccil.org
--Edsger Dijkstra http://www.ccil.org/~cowan
Visualize an application built up of many such main-line programs running concurrently, passing IPs around between them. This is very like a factory with many machines all running at the same time, connected by conveyor belts. Things being worked on (cars, ingots, radios, bottles) travel over the conveyor belts from one machine to another.isualize an application built up of many such main-line programs running concurrently, passing IPs around between them. This is very like a factory with many machines all running at the same time, connected by conveyor belts. Things being worked on (cars, ingots, radios, bottles) travel over the conveyor belts from one machine to another.
We are about to study the idea of a computational process. Computational processes are abstract beings that inhabit computers. As they evolve, processes manipulate other abstract things called data. The evolution of a process is directed by a pattern of rules called a program. People create programs to direct processes. In effect, we conjure the spirits of the computer with our spells.
A computational process is indeed much like a sorcerer's idea of a spirit. It cannot be seen or touched. It is not composed of matter at all. However, it is very real. It can perform intellectual work. It can answer questions. It can affect the world by disbursing money at a bank or by controlling a robot arm in a factory. The programs we use to conjure processes are like a sorcerer's spells. They are carefully composed from symbolic expressions in arcane and esoteric programming languages that prescribe the tasks we want our processes to perform.
The factorial
is defined for a positive integer
as
(1)So, for example,
(define (factorial n)(if (= n 1)1(* n (factorial (- n 1)))))
One reason that the distinction between process and procedure may be confusing is that most implementations of common languages (including Ada, Pascal, and C) are designed in such a way that the interpretation of any recursive procedure consumes an amount of memory that grows with the number of procedure calls, even when the process described is, in principle, iterative. As a consequence, these languages can describe iterative processes only by resorting to special-purpose ``looping constructs'' such as do, repeat, until, for, and while. The implementation of Scheme we shall consider in chapter 5 does not share this defect. It will execute an iterative process in constant space, even if the iterative process is described by a recursive procedure. An implementation with this property is called tail-recursive.
[I]t seems like every programmer who gets monads posts a tutorial about them. (And each post begins with: There’s already a lot of monad tutorials on the Internet, but...) The reason is that getting monads it’s like a spiritual experience that you want to share with others. (Bartosz Milewski)
“If you can't explain it to a six year old, you don't understand it yourself.”
A meeting is called of all the people involved - not just programmers and analysts, but users and operations personnel as well. The essential logic of the program is put up on the wall, and the program designers walk through the program structure with the group. During the ensuing discussion, they realize that two new modules have to be written and some other ones have to change places. Total time to make the changes - a week!
Users: "We have this concern, blah blah blah"Programmers: "I don't see the problem."Users: "There is a problem, and we can't sign off until its resolved."Programmers: "Ok, what do you need us to do."Users: "You must do this and that."Programmers (shrugging): "Sure. If that's what it takes to put your minds at ease, we'll do it."Users (uncertain): "Ok. good. Thanks for listening."
Users: "We told you this would happen and you promised to fix it."Programmers: "No you didn't."Users (showing minutes): "Yes we did, look."Programmers: "We did what you asked, look here and there."Users: "That isn't what we asked for."Programmers: "Yes you did. You have to understand that this means blah blah blah and that is just a specific example of the general principle of blah blah blah."Users: "That isn't what we meant."Programmers: "Well, maybe you should have said what you meant."
The smart Java developer would know when to stop. Life is too short to build castles in the clouds. He’d know that a simple looped solution is more than sufficient, and of course he handles negative numbers. (Note that in our recursive solutions, a negative number results in an endless loop.)