Working on a pretty interesting YouTube video
@code_report where's "TinyAPL (3.15min)"
@RubenVerg The graphic didn't look as nice so I have a Kap/TinyAPL truncated one. I will definitely cover it in the YouTube video though : )

@code_report @RubenVerg oh no. That's bad Kap numbers. We're you using the JVM version? (The Linux native and Web versions are much slower).

Do you have the test code? I'd love to do an analysis to see where the time is spent. They're are some pathological cases where Kap can be terribly slow.

That said, the language was never designed to be the fastest. So maybe it's expected.

@loke @RubenVerg The code is all here. More than possible it is picking up the wrong Kap version. I used Claude to set up most of the benchmarking code: https://github.com/codereport/max-odd-binary/tree/main/solutions
max-odd-binary/solutions at main · codereport/max-odd-binary

Contribute to codereport/max-odd-binary development by creating an account on GitHub.

GitHub

@code_report @RubenVerg Thank you for doing this test, it allowed me to find an optimisation opportunity. The rotate test (rotating an array one step) is now 4 times faster for character arrays and about 6 times faster for boolean arrays.

The change adds a bit of code, because in addition to a general optimisation, it's not specialised in the common case of a 1-dimensional array.

https://codeberg.org/loke/array/commit/81c7f8a410ea0f6c0d58b1212701942902ea3374

Optimisation of rotate · 81c7f8a410

array - Implementation of Kap, an array-based programming language inspired by APL.

Codeberg.org