﻿ Vector, the Journal of the British APL Association

# Current issue

Vol.26 No.4

## Volumes

British APL Association

Archive articles posted online on request: ask the archivist.

Volume 22, No.4

# APL/J/K are Top of the League

When I mentioned to a friend that I programmed in APL he informed me APL was currently top of the league of programming languages, as found on mathschallenge.net, under Project Euler. This is “a series of challenging mathematical/computer programming problems that require more than just mathematical insights to solve.” The introductory message on the website continues:

“Although mathematics will help you arrive at elegant and efficient methods, the use of a computer and programming skills will be required to solve most problems. Please be warned that the problems are challenging and you are unlikely to make much progress if you have no knowledge of programming. Having said that, this is both the perfect environment and opportunity to learn new techniques and refine your programming skills.”

The website is very user friendly and the problems, which range from pretty easy to very difficult, are all well conceived. Points are awarded for each problem solved according to the difficulty of the problem and the server will award you these points when you key in the correct answer. The typical answer to a problem is many digits long, so guessing is out of the question. And the server will block your entries for a while if you have too many tries at once. There are currently 126 problems, each worth between 2 and 20 points, which are being tackled by 1372 active users. Active in this context means those of the 3125 registered users who have solved a problem within the last 180 days. A problem or two are being added every few weeks.

As I write the highest possible score of 1915 points is held by 21 people. Roger Hui has 1895 points, so has a rating of 99%. He is 20 points short because he hasn’t got around to solving the most recent problem. Obviously these statistics are all gradually changing with time. These figures are for the middle of August 2006. In August last year there were only 619 active users, showing a growth of more than 100% per year. There were then 102 problems.

To become a registered user you must provide a name, a password and an email address. There is no charge. You may also name your preferred programming language. Your options are:

 No of users Ave rating No of users Ave rating Pencil/Paper 52 6% ECMAScript 5 59% APL/J/K 29 46% Ada 3 15% Assembler 7 38% PHP 24 11% BASIC 52 19% Maple 3 5% C/C++ 347 19% LISP 34 17% C# 52 17% Spreadsheet 9 4% Delphi 52 31% Matlab 22 20% Haskell 40 26% Fortran 2 48% Java 137 21% Tcl 4 79% Mathematica 28 34% Magma 1 45% Perl 56 24% ML 3 35% Python 184 30% Smalltalk 3 29% Ruby 62 15% Erlang 2 40%

You must be very careful not to name APL/J/K as your preferred language when you first register, because your score at this moment will be zero and your rating will be 0%. Then, as soon as you solve a problem and become an active user you will have a detrimental effect on APL/J/K’s statistics! You don’t have to declare a preferred programming language: 159 of the 1372 active users have not declared a preference. If you ever reach the stage where your rating is above APL/J/K’s average rating then you can edit your profile and declare your preference!

Comparatively few active users seem to have realised this. What is more, you can deregister your preference and join the 159 others of unknown preference at any time. Many active users, all those with less than the average rating for their preferred language, could enhance this average rating by deregistering their preference.

You can see from the table that, of all the more popular languages, APL/J/K has the highest average rating. It is officially recognised by the website as “the language of choice for the highest scoring users.” There is a rule that before a language can be considered for this honour it must have at least 1% representation, i.e. have at least 14 users. Those languages that do not qualify have been shaded. So, as the title of this article proclaims, APL/J/K are top of the league according to Project Euler. But is this a significant achievement? I think it is. High scorers in Project Euler need to be both intelligent and diligent. An intelligent person is not going to be diligent with blunt tools. There must be some pleasure in the programming if such a person is to spend so many hours without pecuniary reward.

I registered on 9 July 2005 and solved the ten easiest problems on the first day. 37 days later I had solved 77 problems and had a rating of 70%. I was working hard. Then I continued my normal life and now, a year later, I have solved 91 problems but have a rating of only 66%. High scoring is a challenge and anyone achieving it is spending valuable time programming. Had APL been half as good my score would have been much less than half as good.

```script began 5:07:05
caching off
debug mode off
cache time 3600 sec
cached index is fresh
recompiling index.xml
index compiled in 0.1767 secs