项目作者: never-lang

项目描述 :
Never: statically typed, embeddable functional programming language.
高级语言: C
项目地址: git://github.com/never-lang/never.git
创建时间: 2018-05-26T15:41:59Z
项目社区:https://github.com/never-lang/never

开源协议:MIT License

下载


Never - Functional Programming Language

Version
Codecov

Never is a simple functional
programming language. Technically it may be classified as syntactically scoped,
strongly typed, call by value, functional programming language.

In practise Never offers basic data types, assignment, control flow, arrays,
first order functions and some mathematical functions to make it useful
to calculate expressions. Also it demonstrates how functions can be compiled,
invoked and passed as parameters or results between other functions.

Getting Started

It is easy to download and compile Never language. Just clone repository
and make the compiler in a few basic steps. To read more visit
readthedocs.io site.

Prerequisites

Never requires basic Linux installation to be built. The following tools and
libraries are needed:

  • gcc
  • glibc
  • bison / flex
  • libmath, libdl and libffi

Installing

Never can be installed in steps:

  • clone repository
  • cd never
  • mkdir build; cd build
  • cmake ..; make

asm.js wasm

To compile for asm.js or wasm targets use the following commands:

Get the latest sdk: git clone https://github.com/emscripten-core/emsdk.git

  1. cd emsdk
  2. ./emsdk install latest
  3. ./emsdk activate latest
  4. source ./emsdk_env.sh

Compile to native asm.js

  1. mkdir build && cd build
  2. emcmake cmake .. -DJS_ONLY=ON
  3. make

Compile to native wasm

  1. mkdir build && cd build
  2. emcmake cmake .. -DWASM_ONLY=ON
  3. make

Run

Now you should see never.js file in your build directory. You can overwrite ../never.js and open never.html, or modify never.html to load build/never.js file or load the file in JS console and run:

  1. python -m SimpleHTTPServer 8000
  2. # http://localhost:8000/never.html
  1. var never = Module.cwrap('never','number',['string']);
  2. never("func main() -> int { 123 }")

Contributing

All help is welcome! Using it, reporting bugs, spreading the word, writing
code samples, blogs, submitting ideas, documentation, new features. Everyone
is invited to contribute.

License

This project is licensed under the MIT License.