PureScript

PureScript是一种强类型、纯函数式、最终编译JavaScript编程语言。PureScript可以开发网络应用程序、服务端应用程序,也可以借助Electron开发桌面应用程序。其语法大多与Haskell相当。此外,它还引入了行多态性和可扩展记录。[2] 不过,与Haskell相反的是,PureScript坚持严格的赋值策略。

PureScript
函数式
設計者Phil Freeman
2013年2013
穩定版本
0.13.8
(2020年5月23日2020-05-23
型態系統类型推论, 静态, 强类型
許可證三条款BSD[1]
文件扩展名.purs
網站www.purescript.org
啟發語言
Haskell, JavaScript

PureScript最初由费尔·弗里曼在2013年设计。他曾屡次尝试在保留語義的情況下,将Haskell编译成JavaScript(如使用Fay、Haste或GHCJS),但结果并不满意,於是他开始着手在PureScript上工作。[3]

示例

一个最精简的Hello world程序如下:

module Main where

import Effect.Console (log)

main = log "Hello World!"

参考文献

  1. . GitHub.
  2. . www.purescript.org. [2019-03-14]. (原始内容存档于2021-02-05).
  3. . leanpub.com. [2019-03-14]. (原始内容存档于2020-11-29).

外部链接

This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.