# LiveScript (programming language)

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/LiveScript_(programming_language)
> Markdown URL: https://mediated.wiki/source/LiveScript_(programming_language).md
> Source: https://en.wikipedia.org/wiki/LiveScript_(programming_language)
> Source revision: 1334492038
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

Functional programming language

For the primary web scripting language initially known as LiveScript, see [JavaScript](/source/JavaScript).

This article relies excessively on references to primary sources. Please improve this article by adding secondary or tertiary sources. Find sources: "LiveScript" programming language – news · newspapers · books · scholar · JSTOR (May 2015) (Learn how and when to remove this message)

LiveScript Paradigms multi-paradigm, functional, object-oriented Designed by Jeremy Ashkenas, Satoshi Murakami, George Zahariev Developers (same) First appeared 2011; 15 years ago (2011) Stable release 1.6.1 / 14 July 2020; 5 years ago (2020-07-14)[1] Typing discipline dynamic, weak Scope Lexical OS Cross-platform License MIT Filename extensions .ls Website livescript.net Influenced by JavaScript, Haskell, CoffeeScript, F#

**LiveScript** is a [functional](/source/Functional_programming) [programming language](/source/Programming_language) that [transpiles](/source/Source-to-source_compiler) to [JavaScript](/source/JavaScript). It was created by [Jeremy Ashkenas](/source/Jeremy_Ashkenas), the creator of [CoffeeScript](/source/CoffeeScript), along with Satoshi Muramaki, George Zahariev, and many others.[2] (The name may be a homage to the beta name of JavaScript; for a few months in 1995, it was called LiveScript before the official release.[3])

## Syntax

LiveScript is an indirect descendant of [CoffeeScript](/source/CoffeeScript).[4] The following ["Hello, World!" program](/source/%22Hello%2C_World!%22_program) is written in LiveScript, but is also compatible with CoffeeScript:

hello = ->
  console.log 'hello, world!'

While calling a function can be done with empty parens, hello(), LiveScript treats the exclamation mark as a single-character shorthand for function calls with zero arguments: hello!

LiveScript introduces a number of other incompatible idioms:

### Name mangling

At compile time, the LiveScript parser implicitly converts [kebab case](/source/Kebab_case) (dashed variables and function names) to [camel case](/source/Camel_case).

hello-world = ->
  console.log 'Hello, World!'

With this definition, both the following calls are valid. However, calling using the same dashed syntax is recommended.

hello-world!
helloWorld!

This does not preclude developers from using camel case explicitly or using [snake case](/source/Snake_case). Dashed naming is however, common in idiomatic LiveScript[5]

### Pipes

Further information: [Anonymous pipe](/source/Anonymous_pipe), [Named pipe](/source/Named_pipe), and [Pipeline (Unix)](/source/Pipeline_(Unix))

A [pipe operator](/source/Anonymous_pipe) |> passes the result of an expression on the left of the operator as an argument to the expression on the right of it. LiveScript supports these, as do some other functional languages such as [F#](/source/F_Sharp_(programming_language)) and [Elixir](/source/Elixir_(programming_language)); the argument passed in F# is the last one, but in Elixir is the first one.

"hello!" |> capitalize |> console.log
# > Hello!

### Operators as functions

When parenthesized, operators such as not or + can be included in pipelines or called as if they are functions.

111 |> (+) 222
# > 333

(+) 1 2
# > 3

## References

1. **[^](#cite_ref-1)** ["LiveScript Releases"](https://github.com/gkz/LiveScript/tags). *[GitHub](/source/GitHub)*. Retrieved 21 February 2021.

1. **[^](#cite_ref-2)** ["LiveScript contributors page"](https://github.com/gkz/LiveScript/graphs/contributors). *[GitHub](/source/GitHub)*. Retrieved 20 June 2015.

1. **[^](#cite_ref-3)** ["Chapter 4. How JavaScript Was Created"](https://speakingjs.com/es5/ch04.html). *speakingjs.com*. [Archived](https://web.archive.org/web/20200227184037/https://speakingjs.com/es5/ch04.html) from the original on 2020-02-27. Retrieved 2017-11-21.

1. **[^](#cite_ref-4)** ["LiveScript - a language which compiles to JavaScript"](http://livescript.net/).

1. **[^](#cite_ref-5)** ["prelude.ls - a functionally oriented utility library in LiveScript"](http://www.preludels.com/).

v t e JavaScript Code analysis ESLint JSHint JSLint Subsets,* supersets JS++ Source* TypeScript (ArkTS) Transpilers AtScript Babel ClojureScript CoffeeScript Dart Elm Emscripten Google Closure Compiler Google Web Toolkit Haxe LiveScript Morfik Nim Opa PureScript ReScript WebSharper Concepts JavaScript library JavaScript syntax Debuggers Chrome DevTools Firefox Inspector (formerly Firebug) Komodo IDE Safari Web Inspector Documentation generators JSDoc Editors (comparison) Ace Cloud9 IDE Atom CodeMirror Brackets Light Table PhpStorm Orion Visual Studio Visual Studio Express Visual Studio Code Visual Studio Team Services Vim Engines List of JavaScript engines Frameworks Comparison of JavaScript frameworks List of JavaScript libraries Related technologies Ajax AssemblyScript asm.js CSS DOM HTML HTML5 JSON WebAssembly WebAuthn Package managers npm pnpm yarn Bun Module bundlers Bun esbuild Vite Webpack Server-side Active Server Pages Bun CommonJS Deno JSGI Node.js Unit testing frameworks (list) Jasmine Mocha QUnit People Douglas Crockford Ryan Dahl Brendan Eich John Resig Jesse James Garrett Outline Index Wikibook

---
Adapted from the Wikipedia article [LiveScript (programming language)](https://en.wikipedia.org/wiki/LiveScript_(programming_language)) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/LiveScript_(programming_language)?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
