You can edit almost every page by Creating an account and confirming your email.

PureScript: Difference between revisions

From EverybodyWiki Bios & Wiki
WikiMasterBot2 (talk | contribs)
Moved page from wikipedia:en:PureScript (history)
ย 
WikiMasterBot2 (talk | contribs)
m A page with same name was found on Wikipedia. Feel free to revert this edit and add the template nobots to keep this article wikipedia:en:PureScript (history)
Tag: Replaced
Line 1: Line 1:
<!-- Please do not remove or change this AfD message until the issue is settled -->
{{Kept on Wikipedia}}
{{AfDM|page=PureScript (2nd nomination)|year=2019|month=July|day=5|substed=yes|origtag=afdx}}
<!-- End of AfD message, feel free to edit beyond this point -->
{{Infobox programming language
| name = PureScript
| logo = PureScript Logo.png
| paradigm = [[Functional programming|Functional]]
| year = 2013
| latest release version = 0.13.0
| latest release date = {{Start date and age|2019|05|30}}
| influenced_by = [[Elm (programming language)|Elm]], [[F Sharp (programming language)|F#]], [[Haskell (programming language)|Haskell]], [[Koka (programming language)|Koka]], [[OCaml]], [[Roy (programming language)|Roy]], [[Standard ML]]
| typing = [[static typing|Static]], [[strong typing|Strong]], [[type inference|Inferred]]
| designer = Phil Freeman
| website = [http://www.purescript.org www.purescript.org]
| license = [[Permissive license|Permissive]] ([[Modified BSD License]])<ref name=license>{{cite web|url=https://github.com/purescript/purescript/blob/master/LICENSE|title=purescript/purescript|website=GitHub}}</ref>
| file_ext = .purs
}}
ย 
PureScript is a [[strongly-typed]], [[Purely_functional_programming|purely-functional]] [[programming language]] that compiles to [[JavaScript]]. It can be used to develop web applications, server side apps, and also desktop applications with use of [[Electron (software framework)|Electron]]. Its syntax is mostly comparable to that of [[Haskell (programming language)|Haskell]]. In addition, it introduces [[row polymorphism]] and extensible records.<ref>{{Cite web|url=http://www.purescript.org/|title=PureScript|website=www.purescript.org|access-date=2019-03-14}}</ref> Also, contrary to Haskell, PureScript adheres to a strict [[Evaluation strategy|evaluation strategy]].
ย 
== History ==
PureScript was initially designed by Phil Freeman in 2013. He started to work on PureScript as various attempts to compile Haskell to JavaScript while preserving its semantics (e.g. using Fay, Haste, or GHCJS) didn't work to his satisfaction.<ref>{{Cite web|url=https://leanpub.com/purescript/read#leanpub-auto-about-the-author|title=Read PureScript by Example {{!}} Leanpub|website=leanpub.com|access-date=2019-03-14}}</ref>
ย 
Since then it has been picked up by the community and is developed on [[GitHub]]. Additional core tools developed by the community include the dedicated build tool "Pulp"<ref>{{Citation|title=A build tool for PureScript projects|date=2019-03-08|url=https://github.com/purescript-contrib/pulp|publisher=PureScript Contrib|access-date=2019-03-14}}</ref>, the documentation directory "Pursuit"<ref>{{Cite web|url=https://pursuit.purescript.org/|title=Pursuit|website=pursuit.purescript.org|access-date=2019-03-14}}</ref>, and the package manager "Spago"<ref>{{Citation|title=๐Ÿ PureScript package manager and build tool powered by Dhall and package-sets: spacchetti/spago|date=2019-03-14|url=https://github.com/spacchetti/spago|publisher=spacchetti|access-date=2019-03-14}}</ref>
ย 
ย 
== Features ==
PureScript features [[Eager_evaluation|strict evaluation]], [[persistent data structures]] and [[type inference]]. The PureScript type system shares many features with those of similar functional languages like [[Haskell (programming language)|Haskell]]: [[Algebraic data type|algebraic data types]] and [[Pattern matching|pattern matching]], [[Higher-kinded type|higher kinded types]], [[Type class|type classes]] and [[Type_class#Functional_dependencies|functional dependencies]], and [[Higher-rank polymorphism|higher-rank polymorphism]]. PureScript's type system adds support for [[Row polymorphism|row polymorphism]] and extensible records.<ref>{{Citation|title=Documentation for the PureScript language, compiler, and tools.: purescript/documentation|date=2019-03-14|url=https://github.com/purescript/documentation|publisher=PureScript|access-date=2019-03-14}}</ref> However, PureScript lacks support for some of the more advanced features of Haskell like [[Generalized_algebraic_data_type|GADTs]] and [[Type_family|type families]].
ย 
The PureScript compiler attempts to produce readable JavaScript code, where possible. Through a simple FFI interface it also allows the reuse of existing JavaScript code.<ref>{{Citation|title=Documentation for the PureScript language, compiler, and tools.: purescript/documentation|date=2019-03-14|url=https://github.com/purescript/documentation|publisher=PureScript|access-date=2019-03-14}}</ref>
ย 
PureScript supports [[incremental compilation]], and the compiler distribution includes support for building [[source code editor]] plugins for iterative development<ref>{{Citation|title=purs ide: Editor and tooling support for the PureScript programming language|date=2019-04-21|url=https://github.com/purescript/purescript/tree/dfbd19da85c92d82ed4c3184f950f74da5332e3f/psc-ide|access-date=2019-04-21}}</ref>. Editor plugins exist for many popular text editors, including [[Vim_(text_editor)|Vim]], [[Emacs]], [[Sublime Text]], [[Atom_(text_editor)|Atom]] and [[Visual Studio Code]].
ย 
== Code Examples ==
Here is a minimal [["Hello, World!" program|"Hello world" program]] in PureScript:<syntaxhighlight lang="haskell" line="1">
module Main where
ย 
import Effect.Console (log)
ย 
main = log "Hello World!"
</syntaxhighlight>
ย 
Here, the type of the program is inferred and checked by the PureScript compiler. A more verbose version of the same program might include explicit type annotations:<syntaxhighlight lang="haskell" line="1">
module Main where
ย 
import Prelude
ย 
import Effect (Effect)
import Effect.Console (log)
ย 
main :: Effect Unit
main = log "Hello World!"
</syntaxhighlight>
ย 
== See also ==
{{Portal|Free and open-source software}}
* [[Elm_(programming_language)|Elm]]: A domain-specific programming language for declaratively creating web browser-based graphical user interfaces
* [[TypeScript]]: A strongly-typed programming language that transpiles to JavaScript
ย 
== References ==
{{Reflist|2}}
ย 
== External links ==
* [http://www.purescript.org www.purescript.org]
ย 
{{Programming languages}}
ย 
[[Category:Functional languages]]
[[Category:Pattern matching programming languages]]
[[Category:Programming languages created in 2013]]
[[Category:Statically typed programming languages]]
[[Category:2013 software]]
{{Source Wikipedia}}

Revision as of 00:29, 29 April 2020