AntLang – A modern APL system
Published online 2016-11-01
Why AntLang?¶
Because they can’t be enough APLs!
OK, there is a bit more to it: AntLang is intended to be practical.
It does multi-threading, system-interaction, easy File-I/O and many many more.
Syntax¶
Most of the syntax is inspired by K and Q, because they are very convenient and compact languages.
However, they do some steps in the false direction, like making a difference between verbs and functions.
In AntLang, verbs are functions and functions are verbs, so both of the above examples execute correctly.
AntLang does not allow juxtaposition, which allows statically parsing AntLang code without knowing the type of things.
It makes source code a bit longer sometimes, but it implementing AntLang very easy compared to K or J, which is why there already exist multiple implementations (hsAntLang, minAntLang, tryAntLang, ....) .
APL is the only language I know, that does not allow writing classic BNF parsers, so for me, this is a big improvement.
However, it does not allow something like “atom atom atom”, since it would be interpreted as “atom function atom”.
Semantics¶
Arrays make it really hard to talk about deeply nested things, like trees or so, which is why AntLang uses sequences instead.
However, you can still think in arrays using sequences.
It only has two concisely chosen adverbs: reduce and pair each.
Most other APL adverbs are implemented as classic verbs, which is allowed in terms of static parsing, so that functions can be easily passed to other functions.
Conclusion¶
It is definitely a good idea to try out AntLang, becuase it brings static parsing and functional programming to APL, which is definitely something you have to try.
You can get more information and even read its source code on
GitHub: github.com/ac1235/AntLang