GithubHelp home page GithubHelp logo

siathalysedi / node-apl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from planetapl/node-apl

0.0 3.0 0.0 4.76 MB

An ancient programming language adapted to a JavaScript-dominated world

License: MIT License

Shell 0.83% HTML 1.17% Python 0.03% CoffeeScript 35.17% CSS 2.28% JavaScript 58.99% APL 1.53%

node-apl's Introduction

  _   _  ____ _   _          _
 | \ | |/ ___| \ | |        | |
 |  \| | |  _|  \| |      __| |__
 | |\  | |_| | |\  |     / _   _ \
 |_| \_|\____|_| \_|    / / | | \ \
    _    ____  _        | | | | | |
   / \  |  _ \| |       \ \_| |_/ /
  / _ \ | |_) | |        \__   __/
 / ___ \|  __/| |___    ____| |____
/_/   \_\_|   |_____|  |___________|

Build Status

An APL compiler written in CoffeeScript
Runs on NodeJS or in a browser

In-browser demo (See also: Paul L Jackson's web site and repl.it)

Supports: most primitives, dfns ({⍺ ⍵}), nested arrays, complex numbers (1j2), infinities (¯ or ), forks and hooks, strand assignment ((a b)←c), index assignment (a[b]←c), user-defined operators ({⍺⍺ ⍵⍵})

Doesn't support: traditional functions (∇R←X f Y), non-zero index origin (⎕IO), comparison tolerance (⎕CT), prototypes, NaN-s, modified assignment (x+←1), control structures (:If), object-oriented features, namespaces

Usage

Install NodeJS.

Download apl.js and make it executable:

wget http://ngn.github.io/apl/lib/apl.js
chmod +x apl.js

Running ./apl.js without arguments starts a REPL.

Running it with an argument executes an APL script:

./apl.js filename.apl

It can be require()d as a CommonJS module:

var apl = require('./apl');
console.log(apl('1 2 3 + 4 5 6').toString());

or used in an HTML page:

<script src="http://ngn.github.io/apl/lib/apl.js"></script>
<script>
    var result = apl('1 2 3 + 4 5 6'); // apl is a global variable
</script>

Editor support

Vim keymap and syntax

node-apl's People

Contributors

ngn avatar jayfoad avatar www avatar shaunxcode avatar

Watchers

Arnstein Henriksen avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.