3 ms·
I was going to say "wouldn't BQN have dicts since it's trying to be a more accessible, modern, from-the-ground-up designed APL and dictionaries are pretty damn
by vanderZwan 4y ago
I was going to say "wouldn't BQN have dicts since it's trying to be a more accessible, modern, from-the-ground-up designed APL and dictionaries are pretty damn useful?" but then I noticed your username so I guess that answers that.
So now I'm curious: why didn't you include some version these features in BQN? They seem pretty nice to have!
EDIT: will you ever write a "let's learn BQN by figuring out how the self-hosted compiler is implemented!" article? I doubt I'll use BQN soon but I find it a fascinating, extremely interesting language, and I'm just super-curious how you implemented the self-hosting compiler.
- mlochbaum 4y agoLanguages with multidimensional arrays (APL, BQN, J, but not K) have trouble with dicts because an index into an array is a list of numbers, and an index into a dict is an arbitrary value. Many primitives, and especially selection, are designed around lists of numbers and don't transfer to dicts. In K, where the index into a list is one number, there's still a requirement that the keys in a dict all have the same level of nesting, but this isn't bad in practice. BQN will eventually have hashmaps implemented as in a more mainstream/conventional way, as objects. There's a model at https://github.com/mlochbaum/bqn-libs/blob/master/hashmap.bqn https://github.com/mlochbaum/bqn-libs/blob/master/hashmap.bq... . I don't think studying the compiler is a very good way to learn BQN, but I would like to write up parts of it (limited by time and motivation of course). I did some chat sessions on this sort of compilation during early development; see the links at the bottom of https://mlochbaum.github.io/BQN/implementation/ https://mlochbaum.github.io/BQN/implementation/ .