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


Rust's Rapid Rise on TIOBE Index
10/07/2024

Rust is making spectacular progress up the TIOBE index and JavaScript is also on the up and experiencing a personal best. Kotlin is maintaining its inclusion in the top 20 and the gap at the very top  [ ... ]



Girls In Tech Has Closed
12/07/2024

Girls in Tech, the nonprofit devoted to "the engagement, education, and empowerment of women in technology" has closed due to lack of funding, leaving behind a blank website. 


More News

 

kotlin book

 

Comments




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

Last Updated ( Monday, 23 June 2014 )