LiveScript vs J
When comparing LiveScript vs J, the Slant community recommends J for most people. In the question“What are the best (productivity-enhancing, well-designed, and concise, rather than just popular or time-tested) programming languages?” J is ranked 34th while LiveScript is ranked 67th. The most important reason people chose J is:
3 classes of operators (verbs, adverbs, and conjunctions) with verbs the most basic function that take either 1 or 2 (infix) parameters. Operators allow function composition with a minimum of parentheses.
Ranked in these QuestionsQuestion Ranking
Pros
Pro Designed for High-level functional code
LiveScript has terse syntax for common functional operations like map, and ships with a library, prelude.ls, with many of the functions most commonly used by functional programmers.
Pro Good amount of programmer flexibility
There's a huge range of features that can make common tasks faster.
Pro ECMA 6 Features
It is the declared goal of LiveScript’s creators to track ECMAScript 6. Hence, the language gives you ECMAScript 6 plus type annotations (which are optional).
LiveScript's module syntax is currently a bit behind the ECMAScript 6 specification (something that will be fixed eventually). It supports two module standards: CJS (Node.js) and AMD (RequireJS).
Pro Fixes coffeescript scoping issues
=
is used to declare variables in the current scope, in order to redeclare variables of outer scope :=
is used. This way bugs are reduced.
Pro Supported by WebStorm and Visual Studio
Pro Every function is an operator
3 classes of operators (verbs, adverbs, and conjunctions) with verbs the most basic function that take either 1 or 2 (infix) parameters. Operators allow function composition with a minimum of parentheses.
Pro Simpler Imperative language constructs as failback to functional programming
J also supports multiline functional definitions similar to BASIC/Pascal. Including error handling.
Pro Compiled language speed from interpreted language.
Each built in operator is a C/asm function, and special code further optimizes some operator combinations. Result is optimized C speed from quick parsing. Array orientation parses and compiles a function once, and applies it to all array items.
Pro 25 year old language, with core unchanged in last 10 years
Still actively developed, but most recent changes have been in libraries and IDE and platform support.
Language is considered "perfected"... though not quite.
Pro Language reference has simple one page index
Complete core programming functional tools allow writting programs and libraries without imports.
Pro No operator precedence rules
(... within each of the 3 operator classes) makes reading code easier. Very simple parsing rules.
Cons
Con Strong functional lean
LiveScript is designed to be a high level functional language. For people who prefer a more imperative approach it can be hard to get used to.
Con Compiles to unreadable javascript
JSON.stringify(
each(upCaseName)(
sortBy(function(it){
return it.id;
})(
(function(){
var i$, ref$, len$, ref1$, j$, len1$, ref2$, results$ = [];
for (i$ = 0, len$ = (ref$ = table1).length; i$ < len$; ++i$) {
ref1$ = ref$[i$], id1 = ref1$.id, name = ref1$.name;
for (j$ = 0, len1$ = (ref1$ = table2).length; j$ < len1$; ++j$) {
ref2$ = ref1$[j$], id2 = ref2$.id, age = ref2$.age;
if (id1 === id2) {
results$.push({
id: id1,
name: name,
age: age
});
}
}
}
return results$;
}()))));
Con Syntax is pure madness
quicksort=: (($:@(<#[), (=#[), $:@(>#[)) ({~ ?@#)) ^: (1<#)