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


Supersimple - Deep Insights From Data
02/04/2024

Announcing $2.2 Million in pre-seed funding, the Estonian startup Supersimple has launched an AI-native data analytics platform which combines a semantic data modeling layer with the ability to answer [ ... ]



Explore SyncFusion's Blazor Playground
16/04/2024

Syncfusion has provided an in-browser environment where you can write, compile and run code that uses Blazor components and get it previewed live.


More News

 

raspberry pi books

 

Comments




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

Last Updated ( Monday, 23 June 2014 )