From Imperative to Functional Programming

As an Electronic Engineer, my programming experience started with Assembly and continue with PL/M, C, C++, Delphi, Java, C# among others (imperative programming is in my blood).

I’m interested in add to my previous knowledge, skills about functional programming, but all I’ve seen until now seems very obfuscated and esoteric.

Can you please answer me these questions?

1) What is the mainstream functional programming language today (I don’t want to get lost myself studying a plethora of FP languages, just because language X has the feature Y)?

2) What was the first FP language (the Fortran of functional programming if you want)?

3) Finally, when talking about pure vs. non pure FP what are the mainstream languages of each category?

Thank you in advance

Tongue slightly in cheek, I’d answer: Lisp, Lisp, and Lisp.

For question number one, this is probably a controversial answer. People who are comfortable with the Microsoft development stack would, of course, consider F# to be more mainstream – after all, it’s right there in your developer’s tool chain, ready to be installed (or already there) on millions upon millions of PCs. The academic community is more excited about Haskell, but here also real-world usage is less than they would like to achieve. Telecom engineers swear by Erlang instead. But when taking all dialects together – Scheme for teaching and extension languages, Common Lisp for enterprise-size applications, Emacs lisp for the one true editor, Clojure for the cool young Java kids… they might just be the most-used predominantly functional language out there. (Note that programming language market share is an intensely politicized topic, and any answer you receive will be ripped to shreds by other opinions.)

Question two is easy. Unless you want to count the purely mathematical lambda calculus, Lisp was first – although it, too, was initially intended just as a mathematical modelling tool, it turned out to be easily implementable, and the rest is history. That was in the 1950s.

Question three: Common Lisp is decidedly non-pure, while Scheme more closely resembles pure axiomatic systems like Haskell, which rigorously separate side effects from computation. Again, questions about market share are always controversial, and Scheme is certainly not the purest FP language, just (I guess) the most used – even if much of this is due to cohorts of computer science freshmen. And Common Lisp is not the least-pure language either – I think all of the the various “Lisp on the JVM” tools are less pure, since leveraging the huge Java library ecosystem is one of their reasons for existence. If I were forced to guess, I’d say one of them will probably the next big winner in functional programming.

6

1) What is the mainstream functional programming language today (I don’t want to get lost myself studying a plethora of FP languages, just because language X has the feature Y)?

I’d be very hesitant to name a single one here. FP itself isn’t really mainstream at all, so calling any FP language “mainstream” would be silly.

There are a few FP programming languages that seek contact with mainstream programming, e.g. Scala, F#, and Clojure, by piggy-backing on a mainstream platform (e.g. JVM or .NET), and there are a few mainstream programming languages with at least some degree of FP support (JavaScript being the most popular).

Within the realm of FP, Lisp (Common Lisp and Scheme being the most prominent dialects, with Clojure as a relative newcomer) is probably leading the pack in terms of number-of-users, as well as library and platform support. Unless of course you count JavaScript, which is surprisingly similar to Scheme in many ways (if you can look past the syntax).

2) What was the first FP language (the Fortran of functional programming if you want)?

Definitely Lisp. No doubt about that.

3) Finally, when talking about pure vs. non pure FP what are the mainstream languages of each category?

If you want really pure, there is actually very little choice – Haskell makes a point of being completely pure (the language itself: the runtime can and usually does execute impure actions), and there are a few experimental languages that follow a similar philosophy but differ from Haskell in various ways. AFAIK, the other ones all allow impure constructs in one way or another, some being more academic about it than others.

15

1) There is none. Possible choices are F# (that comes from MS and integrates with Net framework), GHC Haskell (compiles to native code on several most popular platforms, bindings to many C and C++ libraries are available), scala (jvm choice, though it has limitations). For dynamic typing look onto Erlang (crossplatform, makes emphasis on concurrency, parallelism and network communications) and lisp descendants: clojure (for JVM platform), racket scheme (native code).

2)lambda calculus. It is only math model, though. The first implemented FP language was Lisp and later SASL.

3)For pure FPL it is currently haskell – the only widespread pure lazy FPL (though GHC dialect has impure features). For impure there is no clear leader. SML family is dying except F#, so I’d probably stick with F# (They say it has problems with Mono) or some Racket dialect.

In addition to Pure/Impure holywar beware of Static/Dynamic typing holywar. I clearly stay on Static side, but I’m well aware that many prefer Dynamics (lisp dialects, Erlang and so on).

12

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật