Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

About functional style programming [closed]

I have read a paper discussing von Neuman style programming. The paper's name is Can Programming Be Liberated from the von Neumann Style? A Functional Style and Its Algebra of Programs

My question about the functional Style programming languange (refered by the author John Backus) is this:

Is the functional Style in this paper exactly or approxiately meaning the same things when we refer that of function programming language like HASKELL or ERLANG?

like image 686
parsifal Avatar asked Sep 01 '12 10:09

parsifal


People also ask

What is a functional programming closure?

A closure is a programming technique that allows variables outside of the scope of a function to be accessed. Usually, a closure is created when a function is defined in another function, allowing the inner function to access variables in the outer one.

What is functional style of programming?

Functional programming is a programming paradigm in which we try to bind everything in pure mathematical functions style. It is a declarative type of programming style. Its main focus is on “what to solve” in contrast to an imperative style where the main focus is “how to solve”.

Is closure a functional programming language?

In programming languages, a closure, also lexical closure or function closure, is a technique for implementing lexically scoped name binding in a language with first-class functions. Operationally, a closure is a record storing a function together with an environment.

Is functional programming coming back?

Object-oriented and imperative programming aren't going away, but functional programming is finding its way into more codebases.


2 Answers

If you want to look at a language that is directly inspired by the FP language described in that paper, you might want to look at J.

like image 179
Jörg W Mittag Avatar answered Oct 22 '22 16:10

Jörg W Mittag


Here is a helpful blog post: Why concatenative programming matters.

In short, these are two different techniques. Wikipedia calls them Functional Programming and Function-Level Programming respectively. Also there are Point-Free of Tacit Programming, Concatenative Languages and Stack-Oriented Languages - so exact naming may vary depending on who you ask.

As the blog post points, functional (or applicative) languages (Erlang, Haskell, ML, Scheme) are poorly suited for function-level (or concatenative) programming. However, there is Pointless Haskell library to help writing function-level programs in Haskell. Note how type signatures for usual things such as an empty list differ from Prelude. The library can be installed from Hackage by cabal install pointless. See examples.

For relevant languages, see Forth, APL, Joy and Cat. The J language mentioned by Jorg is a descendant of APL and FP.

like image 3
nponeccop Avatar answered Oct 22 '22 14:10

nponeccop