Lambdascript adds functional programming to Python

The language project, still in the alpha stage, works with Python expressions and emphasizes literate programming

Lambdascript adds functional programming to Python
Credit: flickr/Acid Pix

Lambdascript, a pure functional language built atop Python 3, provides a bridge between Python and functional programming, in yet another nod to a software development paradigm that has been attracting plenty of attention lately.

The Haskell-influenced language uses several Python features and benefits from modules written in Python, according to the project's GitHub page. "Once a public version [is] released, it should be able to compile very well-written modules to be used in pure Python programs -- or even in other Lambdascript programs," the documentation states. The language is presently in an alpha release stage.

Set to work with either CPython3 or PyPy3 implementations of the language, Lambdascript emphasizes literate programming, with a full program being a Markdown document and lexical binding inside each block of code in the document. Tail-recursion support is featured along with currying of functions. "Pure Python can be [embedded] in the Markdown document by using fenced code blocks and indicating python as the language of the block," the GitHub repo states. "Any other block of code will be interpreted as Lambdascript code."

Python has become the subject of much experimentation, with several efforts transpiling it to JavaScript. Other projects have been launched to boost the language's performance. And Google last week detailed Grumpy, which transpiles Python code into Go.

An organizer of the Silicon Valley Python Meetup, Python programmer Glen Jarvis, said he saw value in Lamdbascript.  "On first glance, yes I do. If, for no other reason, than to better communicate and learn functional programming paradigms using the familiar context of Python."

Functional programming, which can enable better-structured code while requiring developers to change their perspective on coding, has become popular of late. Languages like Scala, F#, Clojure, and even Java have accommodated functional capabilities, and functional programming has emerged in Python with Coconut, a Python dialect.

From CIO: 8 Free Online Courses to Grow Your Tech Skills