Home First Encounter Current Status GNU License Downloads Getting Started Examples Mississippi Overview of A Structure of Data Syntax Relation to other APLs Language Reference System Fns and Vars Functions Where next Quibbles Materials Vector Home |
Current Status of the A+ ProjectWhere it all beganThe A+ engine was placed into the public domain late in 2000, and caused considerable interest in the APL community. In February this year, I contacted Morgan Stanley to sound them out on attempting a Windows version of the interpreter. On Monday 12th Feb 2001 I received the following reply ... Morgan Stanley is very supportive of your plan to sponsor such a project. The only 'restriction' we have (as part of the GPL) is that your source code should be made available for some period. Building a wrapper around a+, and giving it away is a great idea. The BAA committee was sounded out and approved a budget of £1,500 to cover the programming time to investigate the feasibility of porting the interpreter. This proposal was reported to the AGM in May and again raised a good deal of interest among the membership. The painful partReading other people's code is not easy, and reading Arthur's C code is almost impossible. When Causeway finally made a week of clear time to attack this one, we decided to leave the core A+ code well alone and concentrate simply on stripping off anything that failed to compile until it produced an EXE that could run under Windows. This was easier said than done - it actually took the best part of 2 days to get it compiling under BSD Unix, then it was mostly a case of: WHILE finished = false DO if compile_link = true finished = true else comment out failing code using #ifdef's endif endwhile The end result being a console-mode interpreter with a small supporting DLL (also freely distributable) to cover the fact that the console thinks it is running in a Unix shell! What we have nowAs far as we can tell, we have a functional A+ engine, including basic system facilities, for example you can run script files. Some system functions (such as _fmt) are missing and will be tracked down soon. The sys. context is not included in this build as it is strongly dependent on the Unix emulation layer, which we intend to shake off as soon as possible. The next build will include those functions (like sys.ts) which are easy to recreate under Windows. A+ already supports 'ASCII' mode input so you can fire up the interpreter and type: $mode ascii iota 12 0 1 2 3 4 5 6 7 8 9 10 11 What you cannot do in the console is enter (or see) APL symbols. Also you cannot use the 'cursor-up' to choose, modify or re-execute prior input lines. If you want to do anything interesting, you must write it as a script! As part of the download set, you will find a very basic editor to allow you to write scripts with proper APL symbols, and type the APL characters using the familiar unified keyboard. Of course you can also use Notepad and write your scripts in ASCII mode if you prefer. Some simple scripts are included, for example you can make prime numbers with the sieve of Eratosthenes by running: $load eratos Eratos 120 Test 500000 pp := Eratos 500000 Which compares the creation of primes up to 500000 by a recursive (using Test) or old-style looping method. The script looks like this ã Experiments with primes to give us a rough speed check ã This is a direct rendering from 'D' as per Dyalog dynamic fns L eratos R : { ã Primes by the Sieve of Erastosthenes (see Scholes, Vector 13.2 p88) ã This one uses recursion and seems very fast! nextû1ÙR; maskû«next|R; if (^/1Õmask) ûL,R; ã Return result (L,next) & mask/R ã Call self for the next step } ã Now let's try the same algorithm 'old style' with a while loop Eratos n : { ã Primes up to n (the boring way) primesû2ÕÉn+1; maxûn*ß2; divû2; divsûdiv; while (div<max) { maskû«div|primes; primesûmask/primes; divû1Ùprimes; divsûdivs,div }; (¢1Õdivs),primes } It is interesting to compare A+ with Dyalog APL dynamic functions - both have lexical scoping and automatic localisation. In fact the only major difference seems to be that in A+ you have to name your arguments! There is also a strong affinity with the I-APL 'direct definition' approach to functions - it is remarkably easy to translate the functions from Norman Thomson's book APL Programs for the Mathematics Classroom into A+. Where nextHaving proved that A+ can be made to run under Windows, the next stage is to decide what should be done with it. The initial idea was to make something which could be used in schools and colleges as an experimental environment for science and mathematics, in fact very much the same idea as the I-APL project which provided a free interpreter on the BBC Microcomputer for schools. For this to make any impact on schools in the UK, it has to support the National Curriculum and come accompanied by appropriate teaching material. Norman's book was written with I-APL in mind and he has agreed to consider a 'translation' to A+ which would make it an excellent starting point. However, I feel we need one more step before we can properly research this possibility. The interpreter itself should be buried as a DLL (hence losing the last vestiges of its Unix heritage and that dreadful console) and so a suitable 'experimenting environment' will be needed to call it. In the first instance this can just be a 'session' with proper keyboard support and an APL font. Remember that this is emphatically not a Windows application development tool - what is needed is somewhere you can write, save, and run simple functions to manipulate and display numbers. Creation of suitable output files (probably in CSV format) or simply clipboard support, will be sufficient to permit transfer of results to Excel for graphing and further analysis. Over to youPlease download the interpreter, play with some scripts and give us feedback. This is an extremely powerful APL engine, and Morgan Stanley have done the world APL community a huge service in making it publicly available. The challenge now is to make it useful in a way which does not threaten the commercial APL vendors, and which will be attractive to both hobby APLers and the educational world. To a great extent, the blossoming of APL in the 1980's was due to IBM's far-sighted approach in giving away VS APL licences to universities - with A+ we at last have the opportunity to do the same thing with a surprisingly modern-looking APL engine. © British APL Association 2001 Please send any comments to Adrian Smith via adrian@causeway.co.uk - thank you. |