Ki - Lisp for JavaScript
Written by Kay Ewbank   
Sunday, 22 June 2014

A new functional language has been released for JavaScript. Ki enables the use of functional idioms and data structures directly in JavaScript.

 

kibanner

According to the language’s website, ki’s syntax and semantics are heavily inspired by Clojure. It is a functional programming language that expands into JavaScript through a very thin layer of sweet.js macros. Using ki means you can make use of functional programming idioms and immutable data structures. ki can be used to write entire applications, individual components (e.g. state management) or just functional one-liners.

One advantage of Lisp and similar languages is their extensibility. The actual language of Lisp has a minimal syntax, but you can then extend it. Common Lisp even has the motto of “the programmable programming language." If you’re programming Lisp, and you come across a feature that would make your program easier to write but that is missing from Lisp, you can just add it for yourself.

Ki as it comes has support for lambdas, lexical scoping, namespaces, local bindings, recursion, persistent data structures, lazyness, data literals, keywords, multiple arity functions, backcall-style continuations, multimethods, atoms and macros, and source maps. Ki also has threading macros that make it easy to concatenate computations.

Ki has been created by Luca Antiga of Orobix, specialists in image analysis and data engineering, and the company has used ki to handle mutable state for some apps. Antiga says ki could be used to create domain-specific languages through macros. A ki port of the React.js tutorial is included on the ki website as an example of this in action.

Antiga told I Programmer:

The macros in ki are designed to play particularly well with mori, a library providing "ClojureScript's persistent data structures and supporting API from the comfort of vanilla JavaScript", which are the real asset for writing pure, functional code.

Joking that ki is the Flappy Bird of programming languages, Antiga added that Ki is very tiny and that all the heavy lifting is done by sweet.js and mori.

Ki is offered under the liberal MIT license and can be downloaded from the ki language website (http://ki-lang.org/).

 

Banner


Google Intensive AI Course - Free On Kaggle
05/11/2024

Google is offering a 5-Day Gen AI Intensive Course designed to equip data scientists with the knowledge and skills to tackle generative AI projects with confidence. It runs on the Kaggle platform from [ ... ]



AI Propels Python To Top Language on GitHub
30/10/2024

This year's Octoverse Report reveals how AI is expanding on GitHub and that Python has now overtaken JavaScript as the most popular language on GitHub. The use of Jupyter Notebooks has also surged.


More News

 

espbook

 

Comments




or email your comment to: comments@i-programmer.info

Last Updated ( Monday, 23 June 2014 )