Computer Languages A to Z: J

by Gary L. Ratliff Sr. (eronstuc)

In the first article in this series on APL, we introduced Dr. Kenneth Iverson, who developed the APL notation in 1957. He was hired by IBM in 1960 to develop this notation for use on the IBM360. Much later, he went to work for Sharpe in the development of its APL systems. He received the Turing Award, and later in 1989 began to develop the J language, along with Roger Hui and Arthur Whitney. It appears to be a variant of APL which does not use any symbols not found on an ASCII keyboard.

Like APL, J is proprietary. It may be obtained for free from Jsoftware, (http://www.jsoftware.com). It is available for many platforms. I have installed it on both the 2009-1 Kde and 2009-2 Gnome versions of PCLINUXOS. It relies upon Java being installed. There is a 64bit version. However, as this could not find any useful Java64 system, it would not function. Unlike most installs, you will not want to install this as root. Doing so would place the code in /root, and thus make it necessary to run this as root all the time. This is not a good practice. To obtain this download (the 32 bit version), download j602a_linux32.sh from the jsoftware web site.

Installing and setting up J

Installation is very simple. When the installation began, you should have selected the save option. Simply open a terminal and move to the location of the script. Then execute this command to run the script:

sh j602a_linux32.sh -install

You will soon be presented with a menu of commands to use to run J. However, we are going to create simple scripts to change the path for us. The jconsole command would be run to run the J interpreter, once you have learned enough about the J language to actually run it. The jwd command contains a terminal with several menu items which will aid you in exploring the J system. Open either kwrite or gedit, depending on which version of PCLINUXOS you are in. Next, create the scripts for jwd, jbreak and jconsole:

#!/bin/sh
cd /home/gary/j602/bin
./jwd

#!/bin/sh
cd /home/gary/j602/bin
./jconsole

#!/bin/sh
cd /home/gary/j602/bin
./jbreak

Of course, you will substitute your own name in the path to the file. These scripts simply allow the execution of the programs without typing in the path. Now the directory /home/gary/bin should be found on the PATH, and may be verified by executing echo $PATH. If this is not the case, then it may be set there with the command PATH=/home/gary/bin:$PATH, which would establish this as the first item in the search PATH. Once you have created the files, you will need to make them executable. This is done by executing chmod +x jwd, chmod +x jconsole, and chmod +x jbreak. Finally, you will move them into the /home/gary/bin directory with mv jwd /home/gary/bin/. Once all the files have been created and moved into the /home/gary/bin folder, we are ready to launch J for the first time. Open a terminal and enter the command jwd.

pic

The first thing you will see is a welcome page and an ijx page. The welcome page contains information for new users. Your most likely choice, once you have clicked the Exit to J Session button, would be to select the Help menu.

pic

The primer is one source of easy lessons to introduce you to J. Another introduction is in the Labs. However, these get into the use of J much faster. Also, many of the labs will require acquiring other packages from J software. When you read the prices on the J software page, should you desire the source code, you'll quickly discover that these begin at $10,000 and continue to $400,000. You quickly begin to really appreciate what value open source software has. And you also come to appreciate those who devote their time and effort into providing you with Linux.

pic

Another source is the book J For C Programmers. This book is written for those who already use the C language. It states early on that the more a person has used C, the more foreign they are likely to find the J language. It states that most computer languages deal with numbers as single items, and must create programming loops to deal with extracting items from lists or larger structures, one number at a time. The J language and APL, for example, deal with lists and arrays as the basic unit of computations. My first encounter with APL, and the experience of duplicating what had taken four pages in BASIC in only 67 APL characters, was just such an awakening.

pic

And still another helpful book is "Learning J." by Roger Stokes. This provides an introduction to all the features of the dictionary, which are common to all ports of the language. This refrains from treatment of some items as load 'plot' or load 'debug,' which are covered in the labs.

Again, you will need to learn the language on their own. This article simply points out that there is a very powerful computer language named J, which may be obtained and tried. If you enjoyed APL, you should find J equally exciting.