Would anyone recommend learning J / K / APL?

I came across J / K / APL a few months ago, having worked in several ways

+42
programming-languages j apl k
Apr 14 '09 at 13:44
source share
10 answers

Thousands of years ago I was an APL programmer. By the thousands, I mean back in the year 70, when a custom character set meant that we had special printing terminals with an APL keyboard and character set, as well as IBM selectical typeballs with special characters, etc.

I went to Ken Iverson's lecture, “Why the APL Was Cool.”

His thesis was this. Once, a long division was a serious mathematical work for graduate students. The designation of such things as repeating decimal expansions is associated with a large pile of mathematical symbolism. Once upon a time, even something like a “negative” number needed to be clarified.

Over the years — when we better understood these abstractions, we came up with a much more compact notation for complex concepts.

The point of the APL (both J and K) is to summarize large algorithms into neat notations.

I am currently a Python programmer. I found that my early acquaintance with the APL distorted my brain, prompting me to ask "what does this mean?" and "is it a reusable operation?" and "what is a meaningful summary for all this algorithmic fluff?"

Also, since I am pursuing Project Euler , the problems with the Python “lite functional programming” supported by my Gene-soaked APL flashbacks are both very helpful in solving the exercises.

+50
Apr 14 '09 at 14:04
source share

I have worked in J and APL for most of the past 25 years and can fully recommend both. I will still come back to this or that when I have some form of ad-hoc data analysis, and I also used it in Project Euler.

If you are interested in Project Euler, then J is definitely the one to choose. Its support for infinite integers and primes makes it very suitable.

+14
Jan 27
source share

J is my main programming language for Project Euler and for personal use at work. I have never come across the best language for handling arrays, and the silent programming paradigm is useful and makes you think as soon as you hang it. (Useful, because it really makes you think.) It is difficult to achieve the level of knowledge at the initial level in this language, and reading the code of other people is an intellectually disciplined activity, but perseverance has big gains due to language strength, flexibility and conciseness.

However, the reason I reserve it for personal use at work is because (1) no one else uses it at work, (2) the learning curve is steep enough, so it’s not wise for me to ask my colleagues about volume, pick it up and (3) the fact that you can create complex programs in one line of code makes it difficult to read a line of code, especially if you do not write it yourself. (I expect to spend at least half an hour studying a line of code that uses ten or more statements, unless they are used in such a way that I fully understand the fundamental principles.)

Some examples of J functions:

1) Any function defined to work on a single number can be used to work with arrays of arbitrary rank. For example:

totient=: * -.@%@~.&.q: NB. Finding the totient of 10 totient 10 NB. Finding the totient of all numbers from 1 to 10 totient"0 (1+i.10) 

This is exactly the same function, just working on the atoms (singleton components) of the 1xN input array. In the same way, you can take a function defined for working with ranks of two arrays (matrices) and apply it to any array of a higher rank, simply using the connection "(rank)".

2) You can take almost any theoretically reversible function in J and invert it by "iterating it backward". For example,

 NB. Converts an array of binary digits to a decimal number (#.) 1 0 1 5 NB. Converts a decimal number to an array of binary digits (#.^:_1) 5 1 0 1 
+13
May 2 '10 at 2:06
source share

I have been earning a living from the APL since 1980. I look to continue to do this for a few more years. It is not only very interesting to use APL, the language offers excellent debugging features. Modern implementations are full-fledged functional languages ​​and object-oriented.

I have met many people for many years asking me how long I realize that I can continue the APL. These guys were dbase and PL / 1 and ALGOL, Pascal and Forth, C and Focus, and other programmers. Got?!

+10
Sep 08 '09 at 18:08
source share

J is a bit like a genie: you need to keep it inside the bottle. Maintaining a lot of batch software in J is a serious pain. Maintaining interfaces (Windows or websites, because yes, you can configure J to respond to Apache to create web output) in J - an experimental, little-known circle of hell.

On the other hand, using J is great if you want to: analyze, sift, analyze, crunch, etc. some data to fight it, find out the small grain of the algorithm or impress the boarding schools using the shortest way to calculate how many triangles fit in a circle and what does not.

I came very close to adding J as a transaction switch in my career profile at careers.stackoverflow.com , but I ended up leaving it. For me, using J is fine; producing J, however, is not.

EDIT:

It was a long time ago. I still think poorly about complete J solutions in production (that is, all your MVCs). Starting with the original answer, I used J as COM in a C # project, where J has a large matrix that would be inconvenient to manage in C # with great satisfaction.

Part of our job is to make data models and code talk. It is not just overcoming this quality and J has a very concise syntax. In several systems, unlike J, there are simple ones to work with the IDE and have sufficient support to organize the code in a human way. The capabilities of J über-matrix do not compensate for what is missing.

+10
Jan 18
source share

I think your 3 points indicate that you DO NOT NEED to learn J. However, I cannot think of any situation where learning a new language is harmful.

Taking time to learn something that interests you (or any new language) always improves your other programming skills. You study different approaches to problems that you can implement differently with other languages.

Also, with minimal J syntax, this would be a good language to ensure that you get the right results when implementing the solution in another language.

+8
Apr 14 '09 at 13:52
source share

In Eldar days, I was an APL developer, coding in assembler 370. I put J in OS2, but did not learn how to use it for real work. I am currently working in Java and PHP and am evaluating Python. After the first three sections of the Python tutorial, I was struck by a lot of similarities with the APL, which brought me here.

I highly recommend learning APL or J as an intellectual exercise. This will change your programming approach (distorting your brain) and probably help your Python coding. There are also several jobs for APL and J programmers, and probably fewer programmers than jobs.

+7
May 13 '09 at 17:35
source share

I worked as an APL programmer several years ago in the 1970s. I love this language, but have not used it for many years.

This is a great language for some things, but I really can't use it for web development, for example.

Statistical and matrix operations are great for this. You can solve the problem of programming a liner of 3 characters. It is much easier to prove the correctness of this LP implementation than the one that takes pages in C, for example.

So, if you want to learn this for the joy of learning, I say, follow him. To improve your job prospects, there may be many other things to find out that will impress the potential employer even more.

+6
May 07 '09 at 2:27
source share

This is a fun confirmation for me, a fifty year old man.

Earlier today, I decided to learn the new 21st century programming language after a 27-year hiatus in zero programming. I chose Python, at random, for fear of the gi-based and object-oriented world we all live in.

To my great pleasure, my years of earning a living as an APL guy in the early 80s mean that I literally hush up the material, instantly understanding :) I just thought I'd share it.

+5
Jul 12 2018-12-12T00:
source share

Yes, learn APL / J / K, it will give you a unique look at what is possible.

I point out that @MPelletier "how many triangles fit into the circle" and implies "... but not for real problems" is a bit short-sighted. Yes, the J Software IDE lacks some things, but creating one's own IDE is not a big problem, and a good IDE can mask a bad language (shortening from 20 lines to 20 characters should not be a sneeze.) I do APL if @KaiJaeger has if not longer, and my mind may be distorted, but I have never been happy with programming anything else.

+4
Mar 25 2018-11-17T00:
source share



All Articles