| ▲ | BiteCode_dev 11 hours ago | |||||||
You don't really often need an array language, just like you don't really often need regexes. When when you have a problem that perfectly fits the bill, they are very good at it. The problem is they are terrible at everything else. I/O, data validation, manipulation strings, parsing, complex logic trees... So I feel like just like regexes, there should be an array language parser embedded in most languages, that you opt in locally for just this little nudge. In Python, it would be nice to be able to "import j" like you "import re" in the sdlib. The entire J code base, including utility scripts, a console, a stdlib and a regex engine, is 3mb. | ||||||||
| ▲ | ogogmad 5 hours ago | parent | next [-] | |||||||
I don't know if you're aware that there's a formal analogy between matrix operations and regex operations:
To make the analogy between array programming and regex even more precise: I think you might even be able to make a regex engine that uses one boolean matrix for each character. For example, if you use the ASCII character set, you'd use 127 of these boolean matrices. The matrices should encode transitions between NFA states. The set of entry states should be indicated by an additional boolean vector; and the accepting states should be indicated by one more boolean vector. The regex operations would take 1 or 2 NFAs as input, and output a new NFA. | ||||||||
| ▲ | ogogmad 6 hours ago | parent | prev [-] | |||||||
I suspect the same regarding the analogy with regex, but I still haven't finished learning an array language. Do you know what you'd use an array language for? | ||||||||
| ||||||||