• Stars
    star
    147
  • Rank 251,432 (Top 5 %)
  • Language Cuda
  • License
    MIT License
  • Created about 2 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A comparison of array languages & libraries: APL, J, BQN, Uiua, Q, Julia, R, NumPy, Nial, Futhark, Dex, Ivy, SaC & ArrayFire.

Array Language & Library Comparisons

image

This is a collection of idioms and small programs in APL, J, BQN, Julia, R, NumPy, Nial, Futhark & SaC.

There are several sites that do these kinds of comparisons:

General Array Language Specific Array Library Specific
Rosetta Code BQN-Dyalog Dictionary ArrayFire-MATLAB-NumPy
Programming-Idioms BQN-Dyalog Dictionary ArrayFire-Eigen
J-Dyalog APL Rosetta ArrayFire-Numpy
Q-APL Dictionary MatX-MATALB-NumPy

Language / Library Websites

Language ๐Ÿ’ฒ Main Website Help / Docs Online REPL
๐Ÿ’š Dyalog APL dyalog.com Dyalog Help TryAPL
๐Ÿ’› Kap kapdemo.dhsdevelopments.com Kap Ref Kap Interpreter
๐Ÿ’š J jsoftware.com J NuVoc J Playground
๐Ÿ’š BQN mlochbaum.github.io/BQN BQN Docs BQNPAD
๐Ÿ’š Uiua uiua.org Uiua Docs UiuaPAD
๐Ÿ’š Q ๐Ÿ’ฒ code.kx.com/q Q Ref ๐Ÿšซ
๐Ÿ’™ Julia julialang.org Julia Docs Replit
๐Ÿ’™ MATLAB ๐Ÿ’ฒ mathworks.com/products/matlab.html MATLAB Help ๐Ÿ’ฒ
๐Ÿ’™ NumPy* numpy.org NumPy Docs Replit
๐Ÿ’™ R r-project.org R Docs JDoodle
๐Ÿ’œ Nial nial-array-language.org Nial Dictionary TIO
๐Ÿ’œ Futhark futhark-lang.org Futhark Docs ๐Ÿšซ
๐Ÿ’œ Dex github.com/google-research/dex-lang InDex ๐Ÿšซ
๐Ÿ’œ Ivy pkg.go.dev/robpike.io/ivy Ivy Docs ๐Ÿšซ
๐Ÿ’œ๐Ÿ’— SaC sac-home.org SaC Docs ๐Ÿšซ
๐Ÿ’— ArrayFire* arrayfire.com ArrayFire Docs ๐Ÿšซ
๐Ÿ’— MatX* nvidia.github.io/MatX MatX API Ref ๐Ÿšซ
๐Ÿ’— ATen* - ATen Docs ๐Ÿšซ
๐Ÿ’— Eigen* eigen.tuxfamily.org Eigen Dox Godbolt

* Library, not an actual language

  • ๐Ÿ’š Main (APL-Family) Array Languages
  • ๐Ÿ’› Fringe (APL-Family) Array Languages
  • ๐Ÿ’™ Main (Non-APL-Family) Array Languages
  • ๐Ÿ’œ Fringe / Research Array Languages
  • ๐Ÿ’— Array Compiler Backends / Array Libraries

Comparisons

  1. REPL
  2. Index Base
  3. Axis/Rank Model
    1. LA = Leading Axis
    2. TA = Trailing Axis
    3. AA = Axis Agnostic
  4. Application Model
    1. () = Parentheses
    2. LR = Left to Right
    3. RL = Right to Left
  5. Row-major or Column-Major
1 2 3 4 5
APL ๐Ÿ’š 1 (or โŽ•IO) LA/TA RL Row
Kap ๐Ÿ’š 0 LA/TA RL Row
J ๐Ÿ’š 0 LA RL Row
BQN ๐Ÿ’š 0 LA RL Row
Uiua ๐Ÿ’š 0 LA RL Row
Q ๐Ÿ’› 0 ๐Ÿšซ RL Row
Julia ๐Ÿ’š 1 AA () Column
MATLAB ๐Ÿ’š 1 LA () Column
NumPy ๐Ÿ’š 0 AA () Row
R ๐Ÿ’š 1 AA () Column
Nial ๐Ÿ’› 1 AA LR Row
Futhark ๐Ÿ’› 0 ๐Ÿšซ LR Row
Dex ๐Ÿ’› 0 ()
Ivy ๐Ÿ’› 1 (or origin) ๐Ÿšซ RL Row
SaC ๐Ÿšซ 0 LA () Row
ArrayFire ๐Ÿšซ 0 LA () Column
MatX ๐Ÿšซ 0 LA () Row
  1. Length of Array (Leading Axis)
  2. Shape of Array
  3. Rank of Array
  4. Number of Elements in Array
6 7 8 9
APL โ‰ข โด โดโด ร—/โด
Kap โ‰ข โด โดโด ร—/โด
J # $ $$ */@$
BQN โ‰  โ‰ข โ‰ขโ‰ข ร—ยดโ‰ข
Uiua โงป โ–ณ โงปโ–ณ โงปโ™ญ
Q count ๐Ÿšซ ๐Ÿšซ count raze
Julia size(a, 1) size(a) ndims(a) length(a)
MATLAB length(a) size(a) rank(a) numel(a)
NumPy len(a) a.shape np.ndim(a) a.size
R dim(a)[1] dim(a) length(dim(a)) length(a)
Nial first shape shape valence tally
Futhark length ๐Ÿšซ ๐Ÿšซ flatten |> length
Dex size* ๐Ÿšซ ๐Ÿšซ
Ivy 1 take rho rho rho rho rho ,
SaC shape(a)[0] shape(a) shape(shape(a)) prod(shape(a))
ArrayFire a.dims()[0] a.dims()* a.numdims()* a.elements()
MatX a.Shape()[0] a.Shape() a.Rank() TotalSize(a)

๐Ÿ’› Means the REPL has certain limitations

  • Q REPL has no HOME, END, or any arrows (CTRL or not)
  • Nial REPL has no CTRL left or right arrow
  • Futhark REPL has no HOME, END, or DEL
  • Dex REPL as no UP, DOWN and does not work with rlwrap

If you are using Q, Nial, Futhark or other languages with REPL limitations, you can get around this by invoking with rlwrap. On Linux using the Q REPL:

sudo apt install rlwrap
rlwrap taskset -c 2 ./q

Note that even when using rlwrap, some of the limitations will remain (such as CTRL + arrows).

Other Comparisons

  1. Creating an Identity Matrix
  2. Creating an Iota Matrix
  3. Reversing a Matrix Row-wise, Column-wise and in Memory
  4. Summing a Matrix Row-wise, Column-wise and Down to a Scalar

Leetcode / PWC Problems

# Problem ๐Ÿ“น
1 ๐Ÿ’› P0485 - MCO (Max Consecutive Ones) -
2 ๐Ÿ’š P1351 - Count Negatives YouTube Solution
3 ๐Ÿ’› P1614 - Maximum Nesting Depth of the Parentheses YouTube Solution | II
4 ๐Ÿ’š P1672 - Richest Customer Wealth YouTube Solution
5 ๐Ÿ’š P1822 - Sign of the Product of Array YouTube Solution
6 ๐Ÿ’› P2319 - Check if Matrix Is X-Matrix YouTube Solution
7 ๐Ÿ’› P0674 - LCIS (Longest Continuous Increasing Subsequence) -
8 ๐Ÿ’› P00064 - Maixmum Gap -
9 ๐Ÿ’› PWC198 P1 - Maximum Gap Count -
  • ๐Ÿ’š = All solutions complete
  • ๐Ÿ’› = Some solutions missing

Progress

Language 1a 1b 2 3 4 5 6 7 8 9
APL ๐Ÿ’š ๐Ÿšซ ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š
Kap ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š
J ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š
BQN ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š
Uiua ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š
Q ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š
Julia ๐Ÿšซ ๐Ÿ’š ๐Ÿ’š ๐Ÿšซ ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š ๐Ÿ”œ ๐Ÿ”œ ๐Ÿ”œ
MATLAB ๐Ÿ”œ ๐Ÿšซ ๐Ÿ’š ๐Ÿšซ ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š ๐Ÿ”œ ๐Ÿ”œ ๐Ÿ”œ
NumPy ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š ๐Ÿšซ ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š ๐Ÿ”œ ๐Ÿ”œ ๐Ÿ”œ
R ๐Ÿ”œ ๐Ÿ’š ๐Ÿ’š ๐Ÿ”œ ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š ๐Ÿ”œ ๐Ÿ”œ ๐Ÿ”œ
Nial ๐Ÿ’š ๐Ÿšซ ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š ๐Ÿ”œ ๐Ÿ”œ ๐Ÿ”œ
Futhark ๐Ÿ”œ ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š ๐Ÿ”œ ๐Ÿ”œ ๐Ÿ”œ
Dex ๐Ÿšซ ๐Ÿšซ ๐Ÿ’š ๐Ÿšซ ๐Ÿ’š ๐Ÿ’š ๐Ÿ”œ ๐Ÿšซ
Ivy ๐Ÿšซ ๐Ÿšซ ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š ๐Ÿ”œ ๐Ÿ”œ ๐Ÿ”œ
SaC ๐Ÿ”œ ๐Ÿ”œ ๐Ÿ’š ๐Ÿ”œ ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š ๐Ÿ”œ ๐Ÿ”œ ๐Ÿ”œ
ArrayFire ๐Ÿ”œ ๐Ÿ”œ ๐Ÿ’š ๐Ÿ”œ ๐Ÿ’š ๐Ÿ’š ๐Ÿ’š ๐Ÿ”œ ๐Ÿ”œ ๐Ÿ”œ
MatX ๐Ÿ”œ ๐Ÿ”œ ๐Ÿ’š ๐Ÿ”œ ๐Ÿ’š ๐Ÿ’š ๐Ÿ”œ ๐Ÿ”œ ๐Ÿ”œ ๐Ÿ”œ

More Repositories

1

Algorithms

STL Algorithm Cheat Sheet + example code from STL Algorithm Video Series.
C++
232
star
2

Content

Links, slide decks and other material for conference & meetup talks, podcast appearances and publications.
C++
206
star
3

SICP-2020

Repository for material related to Programming Languages Virtual Meetup coverage of the Structure and Interpretation of Computer Programs textbook.
Racket
157
star
4

LeetCode

Solutions to LeetCode problems in C++, Python, Haskell, APL, Java, Ruby, Rust, Racket, Scala, Kotlin, C#, F#, Clojure, Elixir, Swift, Julia, Smalltalk, Nim, Raku, BQN, Nial, SaC, Futhark, D, Q, J, K, R.
C++
154
star
5

CTfP-2021

Repository for material related to the Programming Languages Virtual Meetup coverage of the Category Theory for Programmers book.
Scala
129
star
6

blackbird

A header-only library that defines common SKI combinators from Combinatory Logic.
C++
52
star
7

jello

A Python script for wrapping Jellyfish (a fork of Jelly) so you can more easily play with the language.
Python
51
star
8

jsource

J Language Source Code. Livestream links โฌ‡๏ธ
C
38
star
9

HackerRank

Solutions to HackerRank problems in C++, Python, Java, JavaScript, APL & Haskell.
C++
30
star
10

plr

GitHub repo backing Programming Language Ranking website โฌ‡๏ธ
JavaScript
28
star
11

top10

A selection of 10 problems solved in different programming languages
C++
25
star
12

An-Algorithm-Library

A C++ algorithm library that extends the C++ standard algorithms found in <algorithm> & <numeric>
CMake
22
star
13

kjunior

K Junior is an MIT licensed open source array language written by Arthur Whitney.
C
20
star
14

plgraph

Python
19
star
15

Programming-Language-Meetups

19
star
16

adsp2

HTML
17
star
17

cl-cpp

Code from livestreams of Combinatory Logic in C++
C++
16
star
18

CodeChef

Solutions to CodeChef problems in C++, Java, Python, Haskell, BASH and Rust.
C++
16
star
19

7L7W-2022

Repository for material related to the Programming Languages Virtual Meetup coverage of the Seven Languages in Seven Weeks book.
Ruby
15
star
20

scrabble

A scrabble game that helps you train.
Python
15
star
21

Advent-of-Code-2022

Solutions to Advent of Code 2022 in APL & BQN (and Python if I'm lazy)
BQN
14
star
22

rust-tx

A exploration of the Rust language through implementing an APL-inspired Tensor library.
Rust
13
star
23

racket-algorithms

A package containing many useful algorithms (borrowed from many other programming languages).
Racket
12
star
24

jellyfish

A fork of Jelly (recreational programming language inspired by J) that fixes bugs I have run into and extends the language.
Python
10
star
25

Advent-of-Code-2021

Solutions to Advent of Code 2021 in APL
APL
9
star
26

katas

BQN
9
star
27

city-strides-hacking

Python scripts that build optimal routes for node collection
HTML
8
star
28

useful_function_objects

Some useful function objects.
C++
7
star
29

rust-iterx

Rust library that provides several functions on the Iterator trait not found in std::iter or Itertools.
Rust
6
star
30

Pharo-NDArray

Library for n-dimensional arrays and common array programming language algorithms and combinators.
Smalltalk
6
star
31

dovekie

A library that defines common SKI combinators from Combinatory Logic.
Python
6
star
32

bqn-code

A compilation of BQN solutions to various coding challenges.
BQN
6
star
33

codereport.github.io

SCSS
5
star
34

topcoder

C++
5
star
35

Hoogle-Translate

4
star
36

The_Q_Programming_Language

4
star
37

Cplusplus

C++
4
star
38

ranges-examples

C++
4
star
39

crafting-interpreters

Challenges and code for lox/clox from the Crafting Interpreters book by Bob Nystrom
Rust
4
star
40

maya

A small GPU-accelerated, combinator-enabled algorithm-fusing array programming language.
C++
4
star
41

cl

www.combinatorylogic.com
HTML
4
star
42

mex

A playground for exploring array language & combinator ideas.
C++
3
star
43

LearningList

3
star
44

Data-Structures

3
star
45

Codeforces

C++
3
star
46

HackerEarth

C++
3
star
47

kap

This is a fork of the open source Kap language hosted at https://codeberg.org/loke/array/
Kotlin
3
star
48

bluebird

A library that defines common SKI combinators from Combinatory Logic.
Rust
2
star
49

ki

C++
2
star
50

birds-cpp

An implementation of the combinators from combinatory logic in C++
C++
2
star
51

Versus

C++
2
star
52

Google-Code-Jam

Java
2
star
53

rust-parallel-scans

Playground for scans in Rust
Rust
2
star
54

mastermind

The game of MasterMind in different languages
BQN
2
star
55

moar_functional_fahller

Some small improvements to the C++23 pairwise + transform example from Bjรถrn Fahller's code::dive 2023 talk: Moar Functional with C++23
C++
2
star
56

Advent-of-Code-2023

Solutions to advent of code in BQN & Python
BQN
2
star
57

Pharo-Leetcode

Smalltalk
1
star
58

Advent-of-Code-2020

Solutions to Advent of Code 2020 in C++, APL, Smalltalk & Haskell
C++
1
star
59

combinators

Haskell
1
star
60

functions-and-operators

Swift
1
star
61

PharoAlgorithms

Smalltalk
1
star
62

tacittalk

Tacit Talk is a podcast about programming languages, combinators, algorithms and more!
HTML
1
star
63

Dyalog-Competition

APL
1
star
64

papers

Repository for papers
TeX
1
star
65

RealWorldHaskellExercises

Haskell
1
star
66

meeting-notes

BQN
1
star
67

runforthefunofit

HTML
1
star
68

Pharo-Advent-of-Code-2020

Smalltalk
1
star
69

cleanblog

HTML
1
star
70

realm-of-racket

Racket
1
star
71

LEWG-numeric-algorithms-task-force

1
star
72

hw

TeX
1
star
73

FM2GP-2024

Repository for material related to the Programming Languages Virtual Meetup coverage of From Mathematics to Generic Programming
1
star