Top 1,000 Features Creators Events Podcasts Extensions Interviews Blog Explorer CSV

CoffeeScript

< >

CoffeeScript is an open source programming language created in 2009 by Jeremy Ashkenas.

#29on PLDB 15Years Old 65kRepos
Download source code:
git clone https://github.com/jashkenas/coffeescript/
Homepage · REPL · Try It Online · Source Code · Wikipedia · FAQ · Docs

CoffeeScript is a programming language that transcompiles to JavaScript. It adds syntactic sugar inspired by Ruby, Python and Haskell in an effort to enhance JavaScript's brevity and readability. Specific additional features include list comprehension and pattern matching. Read more on Wikipedia...


Example from Riju:
console.log "Hello, world!"
Example from hello-world:
alert "Hello World"
// Hello world in CoffeeScript alert "Hello, World!"
Example from Linguist:
console.log "Hello, World!"
Example from Wikipedia:
author = "Wittgenstein" quote = "A picture is a fact. -- #{ author }" sentence = "#{ 22 / 7 } is a decent approximation of π"
CoffeeScript Keywords
and or is isnt not on yes @ no off true false null this new delete typeof in instanceof return throw break continue debugger if else switch for while do try catch finally class extends super undefined then unless until loop of by when

Language features

Feature Supported Example Token
Standard Library
console.log "Hello, World!"
Integers
# [0-9]+
Floats
# [0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?
Hexadecimals
# 0x[0-9a-fA-F]+
Conditionals
Inheritance
Switch Statements
Exceptions
Classes
While Loops
Booleans true false
Regular Expression Syntax Sugar
Strings "
MultiLine Comments
### A comment
###
###
Print() Debugging console.log
Line Comments
# A comment
#
Semantic Indentation
Comments
Case Insensitive Identifiers X
Variable Substitution Syntax X

View source

- Build the next great programming language · About · Resources · Acknowledgements · Part of the World Wide Scroll