Somehow J is shorter? I need someone who speaks both J and APL to tell me if they are the same.
Never learned J, but I always return to APL. I guess J to APL is like latin alphabet to chinese characters. You don't need a special keyboard for APL, just like you don't need a special keyboard for Chinese. Sometimes I really don't understand why they started J. Native English speaker's mentality? We never needed special keyboard for diacritics, let alone east asian languages. With an input method for APL characters, J does not even save the number of keystrokes.
I was wrong. The two one-liners for J and APL are different. The original paper [0] gives the original APL implementation of the above J one-liner.
I'm not going to delve deep into the algorithm, but the following quote from the paper fascinates me.
It is voracious for work space. For concreteness, consider
the case n←8 . The intermediate expression p[;c] has shape
(!8),(2!8),2 , requiring 9031704 bytes on IBM-based APL
systems.
I am not a J guru, but that is just the concise implementation. There are others in the references previously cited. J is an interpreted language, and when doing db stuff, it memory maps files for speed. I know this is not the same, but I will now look into it, since I haven't done any J tracing unless a program blows up.
I also use Dyalog APL,and I don't have a special keyboard. The symbols are MORE like mathematical symbols to me. It's just that it is easier to share code in J's plain ASCII text. Some systems still don't show APL characters correctly, or the user doesn't know how just yet. I was also trying to study K and Kona, so J was the better fit.
Is it possible to programmatically transliterate APL code to J? It would be great in either interactive or scripting to try out the J interpreter, so my code
1+2-3×4÷5
could be converted to
1+2-3*4%5
automatically. I guess only Dyalog APL supports function trains, and J has more modern features. It would be interesting to use J as a backend. I really wish GNU APL could support function trains soon.
I haven't run across any in my J studies, but J has evolved away from base APL, so I think it might be possible to do a direct tranliteration, but would miss some niftier ways of doing it in J. I am merely a student of J and APL, though fascinated every day by both of them. I usually go back and forth from Dyalog APL to J depending on the task or the read that sets me off on discovery.
Never learned J, but I always return to APL. I guess J to APL is like latin alphabet to chinese characters. You don't need a special keyboard for APL, just like you don't need a special keyboard for Chinese. Sometimes I really don't understand why they started J. Native English speaker's mentality? We never needed special keyboard for diacritics, let alone east asian languages. With an input method for APL characters, J does not even save the number of keystrokes.
[0] https://dfns.dyalog.com/n_queens.htm