Skip to main content

F# - A Functional Programming Language - The Future

Great news from the grant Microsoft
Language features such as lambda expressions in C# and generics in .NET 2.0 have roots in functional languages, and LINQ is directly based on functional programming techniques. Through LINQ and Parallel FX, ideas from functional languages are helping us address some of the biggest challenges facing the industry today, from the impedance mismatch between data and objects to the challenges of the multi-core and parallel computing space.


From Wiki

Play new style (functional Java) with Java


Microsoft to push functional programming into the mainstream with F#

By Ryan Paul | Published: October 23, 2007 - 08:26AM CT

Microsoft has announced that support for the F# functional programming language will be fully integrated into Visual Studio. This marks a bold new commitment to facilitating functional programming on the .NET platform and could potentially help legitimize functional programming in enterprise environments. Microsoft's promotion of F# to a fully-supported language in Visual Studio is also indicative of the extreme versatility of the .NET platform and Microsoft's Common Language Runtime.

F# began its life as a Microsoft Research project to demonstrate the efficacy of .NET as a platform for mixing multiple distinct programming paradigms. F# is heavily inspired by the OCaml programming language, and a subset of F# and OCaml are largely compatible. F# offers developers many valuable and compelling features without sacrificing much runtime efficiency. F# supports type inference, pattern matching, high-order functions, and currying. F# also supports interactive execution, which means that F# programs can be run like scripts or inputted in an interactive top-level environment similar to the Python shell or Ruby's IRB. F# also has full access to the .NET APIs and components written in other .NET languages.

The advantages of functional programming

Unlike imperative or procedural programming languages, in which computation is typically performed by altering program state, functional programming languages operate on the principles of mathematical evaluation and reduction. Such programming languages are deeply rooted in formal mathematical logic and computational theory. Functional programming languages are largely based on the system of lambda calculus devised by Alonzo Church, in which numerical values, sequences, data structures, basic mathematical computations, and even recursion can be expressed entirely with nested functions.

The close association with lambda calculus and category theory makes functional languages a powerful tool for understanding and programmatically modeling concepts like catamorphisms and recursion. For some programmers, learning to see the ineffable theoretical perfection of functional programming languages is a profoundly illuminating experience that opens the mind to a completely new way of perceiving and understanding computer programming. In some cases, certain functional programming languages are also valued because functional purity is highly conducive to referential transparency and minimizes the potential for side effects.

Outside of the academic world, functional programming idioms are valued because they are often far more expressive than imperative or procedural equivalents. Modern dynamic scripting languages like Python and Ruby, for instance, offer first-class functions in order to boost developer productivity. Even C# offers some features—like LINQ—that are heavily based on functional programming concepts. The ability to mix F# and C# in .NET applications makes it far easier for software developers to use the programming paradigms that are best suited for each individual task.

Functional programming on .NET

Microsoft's decision to productize F# represents a particularly significant step forward for the .NET platform. Microsoft took an equally significant step when it unveiled the Dynamic Language Runtime earlier this year. The .NET platform now fully, officially, and equally supports functional, dynamic, and conventional imperative programming paradigms in an interoperable manner all with a single runtime. This is a tremendous accomplishment and strong evidence of the .NET platform's success and long-term viability.

"[W]e aim to continue the flow of good ideas from functional programming world into mainstream development," wrote Microsoft developer division vice president S. Somasegar in a blog entry. "Furthermore, the somewhat mathematical slant of functional programming just seems naturally appealing to professionals whose primary domain is described with mathematical notation—domains such as financial, scientific and technical computing. On top of the syntactic appeal, the strong type system yields the sort of guarantees which are often crucial in these domains, and enables a superb tooling experience through Visual Studio."

Although this is the first time that Microsoft has treated functional programming on .NET as a product instead of an experiment, many independent developers have long used functional programming languages on top of .NET. The open-source NemerleStandard ML and Lisp implementations for .NET. programming language, for instance, supports extremely impressive features like macros and is preferred over F# by some programmers in the Ars community. There are also several

As the C# programming language and .NET continue to evolve, developers can undoubtedly look forward to seeing more dynamic and functional programming concepts move out of scripting and academia to augment and complement more conventional programming techniques. Microsoft's efforts to push dynamic and functional programming into the mainstream are one of many signs that the art of software development is enjoying a profound renaissance.

Comments

Popular posts from this blog

Netty Cookbook - free ebook for Java Developer

Introduction Netty.io is a popular open source library that greatly simplifies the development of network applications on top of the JVM.  It abstracts the burden to deal with tedious low level details and allows you to concentrate on your business logic instead.  It is used by high profile companies like Red Hat, Twitter or Facebook and designed from the ground up to handle high throughput at low latency, even with thousands of connections at the same time. In this book, you are going to build both client and server using netty best practices, which are communicating with each other in a completely asynchronous fashion.  We are going to explore the netty pipeline, how you can reuse existing protocol handlers and how to write your own. Source code for book  https://github.com/trieu/netty-cookbook Table of Contents Chapter 1: Communicating in Asynchronous World with Netty (15 pages) Introduction Recipe 1.1 Building an asynchronous TCP server and client Recipe 1.

Vì sao chúng ta cần ứng dụng Dataism cho đời sống

Dataism là một triết lý cho rằng dữ liệu là nền tảng của thực tại.  Theo triết lý này, dữ liệu là thứ tạo ra mọi thứ, từ các sự kiện trong thế giới thực đến suy nghĩ và cảm xúc của con người. Trong bối cảnh cuộc cách mạng công nghiệp 4.0 và sự phát triển mạnh mẽ của công nghệ thông tin. Tên gọi "Dataism" được đặt ra để mô tả một quan điểm cho rằng dữ liệu, đặc biệt là dữ liệu số và thông tin, chính là một nguyên tắc lớn trong tự nhiên và xã hội. Nguyên gốc của Dataism không thể được liên kết chặt chẽ với một cá nhân hay tổ chức cụ thể, nhưng một số tác giả và nhà nghiên cứu nhất định đã đóng góp vào việc phát triển và mô tả triết lý này. Một số tác giả nổi tiếng trong lĩnh vực này bao gồm: Yuval Noah Harari: Tác giả của cuốn sách nổi tiếng "Sapiens: Lược sử loài người" và "Homo Deus: Lược sử tương lai", Harari đã đề cập đến khái niệm Dataism trong việc mô tả sự tiến hóa của con người và xã hội.  https://dataethics.eu/humanism-dataism-future-scenario/ Wiki

Các lý thuyết tâm lý học cổ điển về động lực sống của con người

Hôm nay, mình viết 1 bài post tóm tắt theo kiến thức cơ bản về tâm lý học, theo những gì mình đã đọc + kinh nghiệm sống của cá nhân mình.  sự thật thú vị là Sigmund Freud là thầy của Carl Jung và Adler. Điểm chung:  cả 3 Bác đều tập trung nghiên cứu về các nguyên lý cơ bản mà tâm trí, ý thức của con người hoạt động.  Bản chất là các dữ liệu trong bộ não, ở trạng thái vô thức ảnh hưởng trực tiếp đến cách con người nhận thức về thế giới xung quanh họ, bao gồm cả đạo đức, cách suy nghĩ, cảm xúc và ý chí.  Một người không thể hành động mà không có 1 động lực tác động trong suy nghĩ của họ, nó phải có nguyên nhân. Hầu hết các nguyên nhân nằm trong mode "vô thức", bạn rất ít khi tự nhận ra chúng  Điểm khác biệt và đặc trưng: 1) #SidmundFreud  mô hình tâm lý của Freud tập trung vào  1.1 cõi vô thức con người,   1.2 tình dục và động lực sinh sản là năng lượng chính trong cõi vô thức 1.3 các chấn thương tâm lý nhưng bị ý thức kiềm chế lâu ngày 1.4 các ham muốn (như ham muốn tình dục)