Skip to content
This repository has been archived by the owner on Jun 24, 2024. It is now read-only.
/ ngn-apl Public archive
forked from eli-oat/ngn-apl

An APL interpreter written in JavaScript. Can be installed as an offline Progressive Web App.

License

Notifications You must be signed in to change notification settings

sohang3112/ngn-apl

 
 

Repository files navigation

ngn/apl

NOTE: I'm archiving this repository since my changes here were successfully merged upstream via my PR to allow installing as an offline PWA.

Try using it online here. It can also be used as a PWA (Progressive Web App) on a computer / phone - even without internet!

Screenshot


An APL interpreter written in JavaScript. Runs in a browser or NodeJS.

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

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

Used in Paul L Jackson's web site, repl.it, and tio.run.

Offline usage with NodeJS

Run apl.js with Node to start a REPL:

node apl.js

An APL script can be given as argument:

node apl.js filename.apl

apl.js can be require()d as a CommonJS module from JavaScript:

var apl=require('./apl')
var r=apl('1 2 3+4 5 6')

or used in an HTML page:

<script src='apl.js'></script>
<script>var r=apl('1 2 3+4 5 6')</script>

Editor support

About

An APL interpreter written in JavaScript. Can be installed as an offline Progressive Web App.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 69.1%
  • APL 27.1%
  • HTML 3.8%