SUPPORT THE WORK

GetWiki

LiveScript

ARTICLE SUBJECTS
aesthetics  →
being  →
complexity  →
database  →
enterprise  →
ethics  →
fiction  →
history  →
internet  →
knowledge  →
language  →
licensing  →
linux  →
logic  →
method  →
news  →
perception  →
philosophy  →
policy  →
purpose  →
religion  →
science  →
sociology  →
software  →
truth  →
unix  →
wiki  →
ARTICLE TYPES
essay  →
feed  →
help  →
system  →
wiki  →
ARTICLE ORIGINS
critical  →
discussion  →
forked  →
imported  →
original  →
LiveScript
[ temporary import ]
please note:
- the content below is remote from Wikipedia
- it has been imported raw for GetWiki
{{for|the primary web scripting language initially known as LiveScript|JavaScript}}{{primary sources|date=May 2015}}







factoids
dynamic typing>dynamic, weakJavaScript, Haskell (programming language)>Haskell, CoffeeScript, F#| operating system = Cross-platformMIT License>MITlivescript.net}}| file ext = .ls}}LiveScript is a functional programming language that compiles to JavaScript. It was created by Jeremy Ashkenas—the creator of CoffeeScript—along with Satoshi Muramaki, George Zahariev, and many others.WEB,weblink LiveScript contributors page, 20 June 2015, For a brief period in the 1990s, LiveScript was the name of JavaScript.WEB,weblink W3 Web Education Community Group, 20 June 2015,

Syntax

LiveScript is an indirect descendant of CoffeeScriptweblink The following hello world 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 (dashed variables and function names) to camelcase.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 camelcase explicitly or using snakecase. Dashed naming is however, common in idiomatic LiveScripweblink

Pipes

Like a number of other functional programming languages such as F# and Elixir, LiveScript supports the pipe operator, |> which passes the result of the expression on the left of the operator as an argument to the expression on the right of it. Note that in F# the argument passed is the last argument, while in Elixir it is the first."hello!" |> capitalize |> console.log
  1. > Hello!

Operators as functions

When parenthesized, operators such as not or + can be included in pipelines or called as if they were functions.111 |> (+) 222
  1. > 333
(+) 1 2
  1. > 3

References

{{Reflist}}

External links

  • {{Official website}}


- content above as imported from Wikipedia
- "LiveScript" does not exist on GetWiki (yet)
- time: 2:40pm EDT - Tue, Aug 20 2019
[ this remote article is provided by Wikipedia ]
LATEST EDITS [ see all ]
GETWIKI 09 JUL 2019
Eastern Philosophy
History of Philosophy
GETWIKI 09 MAY 2016
GETWIKI 18 OCT 2015
M.R.M. Parrott
Biographies
GETWIKI 20 AUG 2014
GETWIKI 19 AUG 2014
CONNECT