项目
在 GitHub 查看
codereport/array-language-comparisons
关于
数组语言和库的比较:APL、J、BQN、Uiua、Q、Julia、R、NumPy、Nial、Futhark、Dex、Ivy、SaC 和 ArrayFire。
开发工具实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 0
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文Array Language & Library Comparisons
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 | |
| 💛 | TinyAPL | tinyapl.rubenverg.com | TinAPL Primitives | Online REPL | |
| 💚 | 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
- REPL
- Index Base
- Axis/Rank Model
LA= Leading AxisTA= Trailing AxisAA= Axis Agnostic
- Application Model
()= ParenthesesLR= Left to RightRL= Right to Left
- Row-major or Column-Major
| 1 | 2 | 3 | 4 | 5 | |
|---|---|---|---|---|---|
| APL | 💚 | 1 (or ⎕IO) |
LA/TA |
RL |
Row |
| Kap | 💚 | 0 | LA/TA |
RL |
Row |
| TinyAPL | 💚 | 0 | LA |
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 |
- Length of Array (Leading Axis)
- Shape of Array
- Rank of Array
- Number of Elements in Array
| 6 | 7 | 8 | 9 | |
|---|---|---|---|---|
| APL | ≢ |
⍴ |
⍴⍴ |
×/⍴ |
| Kap | ≢ |
⍴ |
⍴⍴ |
×/⍴ |
| TinyAPL | ≢ |
⍴ |
ϼ |
×⍆⍴ |
| 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
- Creating an Identity Matrix
- Creating an Iota Matrix
- Reversing a Matrix Row-wise, Column-wise and in Memory
- Summing a Matrix Row-wise, Column-wise and Down to a Scalar
Leetcode / PWC Problems
- 💚 = All solutions complete
- 💛 = Some solutions missing
Progress
| Language | 1a | 1b | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
|---|---|---|---|---|---|---|---|---|---|---|
| APL | 💚 | ⛔ | 💚 | 💚 | 💚 | 💚 | 💚 | 💚 | 💚 | 💚 |
| Kap | 💚 | 💚 | 💚 | 💚 | 💚 | 💚 | 💚 | 💚 | 💚 | 💚 |
| TinyAPL | 💚 | 💚 | 💚 | 💚 | 💚 | 💚 | 💚 | 💚 | 💚 | 💚 |
| J | 💚 | 💚 | 💚 | 💚 | 💚 | 💚 | 💚 | 💚 | 💚 | 💚 |
| BQN | 💚 | 💚 | 💚 | 💚 | 💚 | 💚 | 💚 | 💚 | 💚 | 💚 |
| Uiua | 💚 | 💚 | 💚 | 💚 | 💚 | 💚 | 💚 | 💚 | 💚 | 💚 |
| Q | 💚 | 💚 | 💚 | 💚 | 💚 | 💚 | 💚 | 💚 | 💚 | 💚 |
| Julia | ⛔ | 💚 | 💚 | ⛔ | 💚 | 💚 | 💚 | 🔜 | 🔜 | 🔜 |
| MATLAB | 🔜 | ⛔ | 💚 | ⛔ | 💚 | 💚 | 💚 | 🔜 | 🔜 | 🔜 |
| NumPy | 💚 | 💚 | 💚 | ⛔ | 💚 | 💚 | 💚 | 🔜 | 🔜 | 🔜 |
| R | 🔜 | 💚 | 💚 | 🔜 | 💚 | 💚 | 💚 | 🔜 | 🔜 | 🔜 |
| Nial | 💚 | ⛔ | 💚 | 💚 | 💚 | 💚 | 💚 | 🔜 | 🔜 | 🔜 |
| Futhark | 🔜 | 💚 | 💚 | 💚 | 💚 | 💚 | 💚 | 🔜 | 🔜 | 🔜 |
| Dex | ⛔ | ⛔ | 💚 | ⛔ | 💚 | 💚 | 🔜 | ⛔ | ||
| Ivy | ⛔ | ⛔ | 💚 | 💚 | 💚 | 💚 | 💚 | 🔜 | 🔜 | 🔜 |
| SaC | 🔜 | 🔜 | 💚 | 🔜 | 💚 | 💚 | 💚 | 🔜 | 🔜 | 🔜 |
| ArrayFire | 🔜 | 🔜 | 💚 | 🔜 | 💚 | 💚 | 💚 | 🔜 | 🔜 | 🔜 |
| MatX | 🔜 | 🔜 | 💚 | 🔜 | 💚 | 💚 | 🔜 | 🔜 | 🔜 | 🔜 |
探索相关项目
加载中…