the 'J' Language
What is J?
J is a concise and powerful language
for communicating mathematical ideas unambiguously,
not least between humans and computers.
Full details and software can be found at
J has the usual built-in operations like
% (divide), and
^ (exponential or power).
Some other important mathematical ideas are expressed in J as
a character followed by a colon or a full stop.
'not' is represented in J by
'matrix inverse' by
'root' (including 'square root') by
and 'Taylor coefficient' by
J really is best thought of as a language -
objects are nouns, functions are verbs
whose action may be modifed by adverbs like
(see below), etc.
While learning J I have sometimes found it helpful
to point and read aloud!
For example, the following brief dialogue between myself and the computer:
x=. i. 10
0 1 2 3 4 5 6 7 8 9
mean=. +/ % #
may be read as:
Excellent introductory documentation,
including examples of statistical applications in J,
can be obtained from
Keith Smillie's home page.
Jim Weigang's home page (for APL),
(journal of the British APL Association),
My own embryonic "Introduction to J" is available as zipped postscript
or US letter
I hope to update and expand it soon. Honest.
ME: x is defined to be a list of the first 10 nonnegative integers
i. is an inbuilt J verb)
ME: what is x?
(J sentences typed into a computer are either definitions,
or instructions to evaluate something,
i.e. implicit questions of the type
'what do you understand by ...?')
(note that whatever I type is indented but the computer's replies are not)
ME: sum over x
(more formally, insert a '
+' between the items of x,
and evaluate the resulting expression)
ME: what is the number of items in x?
# is another inbuilt J verb)
ME: "mean" is defined to be "sum over" divided by "number of items in"
(note that verbs - functions - in J can be defined directly,
without reference to dummy arguments etc.
This is particularly useful because much of mathematics, such as
studies verbs rather than nouns)
ME: what is the mean of x ?
(I have now taught the computer the definition of "mean").
J code like the above is conveniently stored in text files called
You may like to look at:
a script of J utilities (contained in the following zipfile).
a zipfile of various J scripts
(expands to form
jfw/jehswww and subdirectories thereof).
J has a very steep learning curve,
and I have only been using J in earnest since November 1995.
Please don't treat my J code as necessarily a good example.
The J scripts I have made available on the WWW are somewhat
outdated, but I hesitate to disseminate newer test versions.
Note in particular that some of the
@ symbols ('atop')
should be replaced by
following changes in J version 3.03.
I have no connection with J's developers and vendors,
except as a delighted customer.
My (Current) Top 10 Reasons for Using J
Like APL (but much more so),
J is a powerful language for expressing mathematical concepts,
for quickly trying out crazy ideas to see which ones aren't so crazy
and for catalysing insights into the underlying maths.
Unlike APL, J uses just standard ASCII.
J is not designed by a committee -
it is the brainchild of one person (Ken Iverson),
with additional input by Roger Hui and feedback from other users.
J didn't have to be downwardly compatible with anything
(don't think of it as APL++!)
The J development environment makes it easy to split up a huge
programming task into manageable chunks.
Divide and conquer.
The J language is fully portable
(in theory to any system with a C compiler).
The PC implementation for professional developers can be linked
to other software by DLLs, OLE etc.
(specific user interfaces on the one hand,
number-crunching engines on the other).
The PC implementation makes MS-Windows programming bearable.
Impressive-looking user interfaces can be produced with minimum pain.
A version of J (including all documentation)
is freely available from
You can try before you buy,
and end-users will not have to pay any extras to use software
produced in J.
Before 1996 I used a commercial APL,
whose vendors wanted £1500 per annum from the Statistics Department
for continuing support.
The complete J system takes around 5 Mb disk space.
Small is beautiful.
This frees my CD-Rom
(that I bought with every intention of programming in C++)
so that I can listen to music while working late at night.
Essential for morale.
Pertinent (& Impertinent) Quotes
In science, each new point of view calls forth a revolution in nomenclature.
A good notation has a subtlety and suggestiveness which at times
make it almost seem like a live teacher.
It is a profoundly erroneous truism, repeated by all copy books and by
eminent people when they are making speeches,
that we should cultivate the habit of thinking of what we are doing.
The precise opposite is the case.
Civilization advances by extending the number of important operations
which we can perform without thinking about them.
Alfred North Whitehead,
Introduction to Mathematics.
This page is maintained by