PureScript is an open source programming language created in 2013 by Phil Freeman.

#74on PLDB | 11Years Old | 5kRepos |

Download source code:

`git clone https://github.com/purescript/purescript`

A strongly-typed language that compiles to JavaScript

- Tags: programming language
- PureScript is developed on GitHub and has 8,515 stars
- There are at least 5,443 PureScript repos on GitHub
- PureScript compiles to JavaScript
- PureScript is written in PureScript, Haskell, JavaScript, Markdown, JSON, Bourne shell, YAML, CSS, Less, Yacc, Make, Dhall, XML
- The Google BigQuery Public Dataset GitHub snapshot shows 382 users using PureScript in 826 repos on GitHub
- There are 4 Project Euler users using PureScript
- PureScript LSP implementation
- GitHub supports syntax highlighting for PureScript
- Learn PureScript on exercism.
- There is 1 Jupyter Kernel for PureScript
- There is a central package repository for PureScript
- 4 PLDB concepts link to PureScript: mal, nulan, PureScript, Reason

Example from the web:

```
import Prelude
import Effect.Console (log)
greet :: String -> String
greet name = "Hello, " <> name <> "!"
main = log (greet "World")
```

Example from hello-world:

```
module Main where
import Debug.Trace
main = trace "Hello World"
```

Example from Linguist:

```
module Control.Arrow where
import Data.Tuple
class Arrow a where
arr :: forall b c. (b -> c) -> a b c
first :: forall b c d. a b c -> a (Tuple b d) (Tuple c d)
instance arrowFunction :: Arrow (->) where
arr f = f
first f (Tuple b d) = Tuple (f b) d
second :: forall a b c d. (Category a, Arrow a) => a b c -> a (Tuple d b) (Tuple d c)
second f = arr swap >>> first f >>> arr swap
swap :: forall a b. Tuple a b -> Tuple b a
swap (Tuple x y) = Tuple y x
infixr 3 ***
infixr 3 &&&
(***) :: forall a b b' c c'. (Category a, Arrow a) => a b c -> a b' c' -> a (Tuple b b') (Tuple c c')
(***) f g = first f >>> second g
(&&&) :: forall a b b' c c'. (Category a, Arrow a) => a b c -> a b c' -> a b (Tuple c c')
(&&&) f g = arr (\b -> Tuple b b) >>> (f *** g)
class ArrowZero a where
zeroArrow :: forall b c. a b c
infixr 5 <+>
class ArrowPlus a where
(<+>) :: forall b c. a b c -> a b c -> a b c
```

Feature | Supported | Example | Token |
---|---|---|---|

Strings | ✓ | "Hello world" | " |

MultiLine Comments | ✓ | {- A comment -} | {- -} |

Line Comments | ✓ | -- A comment | -- |

Semantic Indentation | ✓ | -- https://github.com/purescript/documentation/blob/master/language/Syntax.md -- Syntax is whitespace sensitive. The general rule of thumb is that declarations which span multiple lines should be indented past the column on which they were first defined on their subsequent lines. foo = bar + baz | |

Doc comments | ✓ | -- https://github.com/purescript/documentation/blob/master/language/Syntax.md -- | `bool` performs case analysis for the `Boolean` data type, like an `if` statement. bool :: forall a. Boolean -> a -> a -> a bool true x _ = x bool false _ x = x | |

Comments | ✓ |

title | date | score | comments |
---|---|---|---|

Show HN: PureScript - a functional language which compiles to Javascript | 10/31/2013 | 2 | 0 |