Introduction to functional programming (10-minute edition)

Source: Internet
Author: User
Tags mathematical functions

What can I do in ten minutes? I chose the definition of functional programming on Wiki to see how much I can read in ten minutes (on the premise that I can understand the content ), because the first half of this Wiki is introductory and there is not much complicated logic to understand, the reading is smooth and the results are as follows:

1. Open a browser, search for keywords from Google, and open the Wiki webpage,30 seconds.

2. Read the introduction section,5 minutes

In computer science,Functional ProgrammingIs a programming paradigm that treats computation as the evaluation of mathematical functions and avoids state and mutable data. it emphasizes the application of functions, in contrast to the imperative programming style, which emphasizes changes in state. [1] functional programming has its roots in the lambda calculus, a formal system developed in the 1930 s to investigate Function Definition, function application, and recursion. extends functional programming extends ages can be viewed as elaborations on the lambda calculus. [1]

In practice, the difference between a mathematical function and the notion of a "function" used in imperative programming is that imperative functions can have side effects, changing the value of already calculated computations. because of this they lack referential transparency, I. e. the same language expression can result in different values at different times depending on the state of the executing program. conversely, in functional code, the output value of a function depends only on the arguments that are input to the function, so calling a functionFTwice with the same value for an argumentXWill produce the same resultF (x)Both times. Eliminating side-effects can make it much easier to understand and predict the behavior of a program, which is one of the key motivations for the development of functional programming. [1]
At this point, the total time is three minutes.

Functional Programming versions, especially purely functional ones, have largely been emphasized in academia rather than in commercial software development. however, prominent functional programming ages such as scheme, [2] [3] [4] [5] Erlang, [6] [7] [8] ocaml, [9] [10], and Haskell, [11] [12] have been used in industrial and administrative cial applications by a wide variety of organizations. functional programming also finds use in industry through domain-specific programming extensions ages like R (statistics), [13] [14] Mathematica (symbolic math ), [15] J and K (Financial Analysis )[Citation needed], And XSLT (XML ). [16] [17] widespread declarative domain specific ages like SQL and lex/YACC, use some elements of functional programming, especially in eschewing mutable values. [18] Spreadsheets can also be viewed as functional programming ages. [19].

Programming in a functional style can also be accomplished in versions that aren't specifically designed for functional programming. for example, the imperative Perl programming language has been the subject of a book describing how to apply Functional programming concepts. [20] JavaScript, one of the most widely employed ages today, incorporates functional programming capabilities [21].

At this point, the total time is 5 minutes 30 seconds.

2. Read the history section,5 minutes, Read-only part

Lambda calculus provides a theoretical framework for describing functions and their evaluation. although it is a mathematical modeling action rather than a programming language, it forms the basis of almost all functional programming languages today. an equivalent theoretical formulation, Combinatory logic, is commonly perceived as more abstract than lambda calculus and preceded it in advance. it is used in some esoteric languages ages including unlambda. combinatory logic and lambda calculus were both originally developed to achieve a clearer approach to the foundations of mathematics. [22]

An early functional-flavored language was lisp, developed by John McCarthy while at MIT for the IBM 700/7000 series scientific computers in the late 1950 s. [23] lisp introduced into features now found in Functional Languages, though lisp is technically a multi-paradigm language. scheme and Dylan were later attempts to simplify and improve lisp.
At this point, the total time is 7 minutes 30 seconds.

Information processing language (IPL) is sometimes cited as the first computer-based functional programming language. it is an assembly-style language for manipulating lists of symbols. it does have a notion of "generator", which amounts to a function accepting a function as an argument, and, since it is an assembly-level language, code can be used as data, so IPL can be regarded as having higher-order functions. however, it relies heavily on mutating list structure and similar imperative features.

Kenth E. Iverson developed the APL programming language in the early 1960 s, described in his 1962 bookA programming language(ISBN 9780471430148 ). APL was the primary influence on John Backus's FP programming language. in the early 1990 s, Iverson and Roger hui created a successor to APL, the J programming language. in the mid 1990 s, Arthur Whitney, who had previusly worked with Iverson, created the K programming language, which is used commercially in financial industries.

John Backus presented the FP programming language in his 1977 Turing Award Lecture can programming be liberated from the Von norann style? A functional style and Its algebra of programs. he defines functional programs as being built up in a hierarchical way by means of "combining forms" that allow an "Algebra of programs"; in modern language, this means that functional programs follow the principle of compositionality. backus's paper popularized research into functional programming, though it emphasized function-level programming rather than the lambda-calculus style which has come to be associated with functional programming.
At this point, the total time is 10 minutes 30 seconds.

The total time is about 10 minutes.
This is a case with no representativeness. Subsequent tests will be conducted and statistical results will be generated gradually.
You are welcome to share your test results.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.