Subscribe / Unsubscribe Enewsletters | Login | Register

Pencil Banner

Functional languages: What they are, where they're going

Paul Krill | Feb. 18, 2016
The men behind Clojure, Scala, and F# explain what functional programming actually is and how the languages are evolving

Microsoft's Stephens sees functional capabilities extending beyond languages alone. "The most popular functional programming language in the world is Excel," he says. A simple Excel worksheet might have a column with a bunch of values in it, such as A1 X 2. "That's a pure function on A1, and A1 doesn't change, so you're computing values from that existing data."

Microsoft's Language-Integrated Query (Linq) technology also provides for functional programming, he says. "Almost every programming language now is adopting features from functional languages."

Stephens cites immutable data as critical to functional programming. Concurrency — programs with multiple threads operating on data simultaneously — also benefits from immutable data, he notes. "We call [F#] a functional-first language because it comes from a heritage of other languages." It also supports object-oriented programming and operates with C# and Visual Basic, he says.

Clojure's Hickey sees adoption of functional languages as a response to the increasing pressure facing developers, who have to take on bigger problems these days. "To do so, they must reduce the incidental complexity of their programs. It is now widely recognized that pervasive state and side effects are a primary source of complexity and bugs in programs," Hickey says. "While it is possible to reduce the amount of state in programs written in nonfunctional languages, it is dramatically easier and faster to do so in a language that makes functional programming idiomatic and the default."

What's next for the three top functional languages

The 13-year-old Scala is a primary language in data science, says Scala founder Odersky. Supported on the JVM, it has an estimated 400,000 to 500,000 users. Plans in the short term call for it to be optimized for Java 8, in which bytecode instructions from the latest standard Java upgrade would enable Scala to generate more efficient code.

In the longer term, Scala will get a cleaned-up type system, safer macros, and more platform support, with an LLVM compiler back end under consideration. Further improvements are planned to improve the usability of Scala.js, for compiling Scala to JavaScript.

The nine-year-old Clojure, also based on the JVM, has been used in finance, retail, software, and entertainment, Hickey says. "It's been applied in diverse application areas such as transaction processing and analysis, big data, network operations, predictive analytics, search, security, and consumer offerings."

The 11-year-old F# was founded by Microsoft Research by Don Syme and is overseen by the F# Foundation. It is used in a wide range of applications and runs on Linux, OS X, Android, iOS, Windows, and browsers. "What we're working on now is the make it work with .Net Core," an open source, cross-platform modular version of the .Net Framework, Stephens says. String interpolation, making it easier to write strings, is on the drawing board.


Previous Page  1  2 

Sign up for CIO Asia eNewsletters.