Code

Lambdascript adds functional programming to Python

Pro
Image: IDGNS

11 January 2017

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 much 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 emphasises 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 (translating and compiling) 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.

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.

 

 

IDG News Service

 

Read More:


Back to Top ↑

TechCentral.ie