Lil is really really cool. I’ve never worked with vector/array languages before, so this explanation feels vaguely magical, but I know it’s gotta be fairly simple under the hood.
If you’d like to see more examples and explanation of these sorts of features Lil, The Vector Language from the reference manual might be worth looking at.
edit: in case you meant implementation-wise, it doesn’t get much simpler than how dyads_atomic() works in the Awk implementation of Lil: recursive calls for the cases where one or both arguments are lists/dictionaries, and each primitive only needs to handle being applied to a pair of atomic values.
The thing about array languages that makes them hard for me to read is that function application is polymorphic on the dimensionality of the argument, which makes naming that much more important.
Lil is really really cool. I’ve never worked with vector/array languages before, so this explanation feels vaguely magical, but I know it’s gotta be fairly simple under the hood.
If you’d like to see more examples and explanation of these sorts of features Lil, The Vector Language from the reference manual might be worth looking at.
edit: in case you meant implementation-wise, it doesn’t get much simpler than how
dyads_atomic()
works in the Awk implementation of Lil: recursive calls for the cases where one or both arguments are lists/dictionaries, and each primitive only needs to handle being applied to a pair of atomic values.The thing about array languages that makes them hard for me to read is that function application is polymorphic on the dimensionality of the argument, which makes naming that much more important.