Skip to content

otherfunc/otherfunc-apl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

otherfunc-apl

APL subset interpreter with Unicode glyphs, ASCII aliases, and SIMD-friendly array storage.

Implementation

  • All numeric values are f64; arrays stored as contiguous Vec<f64> for autovectorization
  • Right-to-left evaluation with strand notation (adjacent values form vectors)
  • 17 scalar functions (element-wise with scalar extension), 7 structural functions, 4 operators
  • Operators: reduce (/), scan (\), each (¨), outer product (∘.f)
  • Unicode APL glyphs and ASCII aliases: iota for , rho for , rev for , mul for ×, div for ÷, etc.
  • Default instruction limit: 10,000,000 (configurable via with_instruction_limit())

Install

cargo install --path .

Usage

# Inline code
apl "2+3"
apl "+/⍳100"
apl "∘.×⍳5"

# ASCII aliases
apl "+/iota 100"

# From file
apl -f program.apl

As a Library

use otherfunc_apl::AplInterpreter;
use otherfunc_core::Interpreter;

let mut apl = AplInterpreter::new();
let output = apl.execute("+/⍳100", "").unwrap();
assert_eq!(output, "5050");

Tests

cargo test -p otherfunc-apl    # 33 tests

About

APL subset interpreter with Unicode glyphs

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages