Ramda wants to put the function in functional JavaScript

The library will help developers put together an apps from small functions with simple interfaces

Concise, functional programming in JavaScript is the focus of a project in development called Ramda, which is being unveiled this month.

The open source project brings a general-purpose, functional library to JavaScript, which its authors said makes for crisp, reliable code. "Functional programming is about recognizing common patterns across different situations and finding common solutions for dealing with them," said co-author Scott Sauyet, owner of the Four Winds Software consulting firm. "We try to capture many of these patterns in Ramda."

Using Ramda, co-developer Michael Hurley, said, should also enable testability, since Ramda methods are stateless and referentially transparent.

While acknowledging there are already functional libraries for JavaScript, such as Underscore, Ramda's developers said the library's focus on composing functions would attract developers' attention. "Since Ramda curries its functions, you can compose functions with very little code. You can also compose with Underscore/Lodash, but that is not really their focus. The lack of automatic currying in those libraries makes function composition a bit awkward," Hurley said.

Ramda lets developers snap together an application from small functions with simple interfaces, Sauyet said. Using the library should feel as much like JavaScript as possible, according to Ramda's documentation.

Thus far, Ramda's developers have mostly focused on data manipulation in development of the library, but they have lately begun to emphasize capabilities related to user interface development. Currently in the equivalent of an alpha stage of release, Ramda is ready for experimental use, but not for production use. "There is still much to do before a 1.0 release, and we have not really developed an overall road map," Sauyet said. Better documentation, a more complete build system, and possibly different bundles for different usages are on the agenda.

The name Ramda is a pun on "lambda," as in lambda calculus, the theoretical foundation of the functional programming paradigm, Hurley said. Functional capabilities recently were added to Java via Project Lambda, in version 8 of the venerated enterprise development platform.

This story, "Ramda wants to put the function in functional JavaScript," was originally published at InfoWorld.com. Get the first word on what the important tech news really means with the InfoWorld Tech Watch blog. For the latest developments in business technology news, follow InfoWorld.com on Twitter.

Recommended
Join the discussion
Be the first to comment on this article. Our Commenting Policies