3 ms·
I think my reasons are very different from robomartin's but I share the opinion that J has some pretty serious flaws. Some are brought forward from APL, some ar
by mlochbaum 5y ago
I think my reasons are very different from robomartin's but I share the opinion that J has some pretty serious flaws. Some are brought forward from APL, some are not.
It has no context-free grammar (but neither does APL). Scoping is local or global: if a variable in a function is local, even inner functions can't access it. It has namespaces (locales), but they are not first-class and are instead referenced by numbers or strings, so they can't be garbage collected. Until this year, there was no syntax to defined a function—even though control structures had dedicated syntax! System functionality has no syntactic support, so it's provided by passing a numeric code to the "foreign" operator. To enable recursive tacit functions, functions are passed by name. Not just as arguments, anywhere. The name is just a string with no context information, so if you pass a function to an explicit modifier and the name means something different in that scope it will do something different (probably a value error, fortunately). Oh, also these names store function ranks, and if you define the function later it won't pick it up, so even the tacit recursion thing is broken.
The designers of J weren't familiar with design principles that are common knowledge outside the APL world, and it really shows. J was my first programming language (well, except TI basic) and while I'm still a big fan of array programming it really held me back from learning these things as well.
- resolvent 5y agoFunctions, if you are referring to monads and dyads, can be defined using "3 : '...'" or "3 : 0\n...\n)" using "3" for monads and "4" for dyads. As for rank information, functions do carry that rank. I believe you are not defining any rank, it which case it becomes infinite rank and depending on usage, it will be applied incorrectly. For tacit recursion, there is the "$:" operator, which allows a tacit function to call itself anonymously. You may also need the agenda operator "@." to define your base case with a gerund "`". The "foreigns" table, while useful, seems like a cludgy way to introduce functions that don't or are difficult to introduce cohesively into J's notation.