axiom-developer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Axiom-developer] [AxiomDevelopment]


From: billpage
Subject: [Axiom-developer] [AxiomDevelopment]
Date: Wed, 23 Feb 2005 11:35:49 -0600

Changes http://page.axiom-developer.org/zope/mathaction/AxiomDevelopment/diff
--

++added:

Programming Language Issues

  (from an email by Tim Daly on Sunday, August 31, 2003 3:56 PM)

Yes, Axiom is written in boot and common lisp. I wrote most, if not all,
of the common lisp. I found the boot syntax (which is basically lisp
except that parens are replaced by indentation) was impossible for me
to use. However other people on the project hate parens. It was a
religious difference that never got solved.

Boot has some nice features. It was basically Python before Python existed.
The key flaw in Boot (and Python) is that programs are not data. That is,
(print (eval (read "sourcefile"))) is broken. And there is no documentation
as it is a perfectly obvious language (sarcasm optional).

But, being a religious debate, the issue can never be resolved.  If
I'm not mistaken (but memory fails) Bill Burge added a "feature" to
boot to allow "nopile" (indented code was called "piled" code).  that
relied on syntax rather than spaces. It caused quite a stir about like
having the Pope decide to require all catholic females to wear a burka.
(Or Lisp programmers to code in Boot, which is far worse :-) )

There is a third language used in the system called Meta. (Which is why
meta.tar exists in zips). This code is not part of the bootstrap but
needs to be at some point. Changing the meta parser (see metameta.lisp,
fnewmeta.lisp, and metalex.lisp) would surely cause havoc. In the 
distributed system I replaced the Meta code with common lisp.

There is a fourth language called CHARYBDIS used in the printing subsystem.
This was a project at MIT around the time that IBM was working on MODLisp.
I'm not sure how they got co-mingled but I believe Dave Barton and Joel
Moses (MIT) worked with Dick Jenks, Jim Griesmer, and Fred Blair (IBM).

There is a fifth unnamed language, a psuedo-tex-html language (see
src/share/doc/hypertex/pages/util.ht) that is used by the hypertex
system (which is a browser before browser existed). You can see this
language stick up into the world in the comments section of the algebra
files. Notice the \axiom{}. That's the TeX-used-as-HTML language.
Scott Morrison invented this language to drive Hypertex, also his work.

In fact, if you do ")set output script on " you'll find support for
IBM's internal TeX-like language called Script. Technical papers
were written in Script before Knuth's TeX caught on. This isn't a
new language within the system but it is another language that is still
supported by the system. )set output fortran also works.
 
There is a sixth language, called spad, which is used to implement the
.spad algebra files. There were several spad languages. Each time we
redesigned the language we renamed the old language "old spad". We were
talking about old-old-old-spad at one point in the project. These 
languages are now dead but you can still find code to support them
Look for "old" and "new" in the sources. Bill Burge, our parser guy,
used "old" and "new" as the spad and boot languages evolved. It caused
no confusion in any given week but caused massive confusion in the code.

You can still see the confusion. Build Axiom then rebuild Axiom. 

(digression: I have a second-build function-calling optimizer that
Bill Schelter and I worked on.  We needed to make function calling
faster. There isn't enough information on the first compile. So if you
look in src/interp/util.lisp in the function make-depsys you'll see
the load of "/cmpnew/collectfn". This is code Schelter and I worked
on. When you compile a lisp file for the first time (say foo.lisp) it
spits out a file (foo.fn). If foo.fn exists and you recompile the
foo.lisp file it will optimize the function calling code (fast-pathing
the code) since it has "perfect information" about how many arguments
and what type the arguments are. This is a significant improvement.
So Axiom is much faster after the second build. I have to automate this
in the build but haven't yet. It works if you hand-build Axiom twice).

On the second build of Axiom the function-optimizer has the .fn files.
It will complain that duplicate code exists. The reason for this duplicate
code is that some of it is "old^N" code (where N is ambiguous) and the
duplicate code is "layered" on top of the old code. I have to go thru
the system and decide which code is correct and elide the "old" code.
I have marked all of the duplicates in the sources (look for "---->")
but stopped that effort in order to get the code uploaded. 

In any case this is an example of the "confusion" as we frequently
needed to run "old" BOOT and spad code until I rewrote it into the
"new" BOOT and spad code. Shortly before Axiom was given to NAG I
spent several weeks rewriting all of the algebra files into the 
"new" A# (AxiomXL, Aldor) compatible language so that the spad compiler
and the Aldor compiler used the same language.

There is a seventh language, originally A#, then AxiomXL, now Aldor
which is a minor variant of spad. It allows the use of { } pairs 
instead of indentation making it a philosophical cross between the
lisp and boot religions. (Bill Burge's "nopile" option exists in Aldor).
(It also uses ";" which is an abmonination but that might be a religious
opinion :-) )

There is an 8th language called SHOE (search for SHOE) which was a
replacement for BOOT. Bill Burge liked puns. SHOE was a "more refined"
BOOT. BOOT was a bootstrap language written in BOOT. Once Burge got
a language "in the air" he was quite fond of losing the scaffolding
that got it there. As a consequence BOOT and spad could not be built
from scratch and required a running BOOT and spad compiler. This is
fixed in the released version. This fix took the bulk of the last
8 months which is why it took so long to deliver an open-source
version of a product (NAG already had a running Axiom and didn't need
to build from scratch but I'm not allowed to distribute a runnable 
Axiom so I had to fix this fundamental problem). The fix is horrible
and I'll rewrite it all from scratch eventually. However if you had
to wait for me to "clean up" all the issues you'd have to wait a
few years. Release early, release often is going to be my mantra.

There are even languages within languages. If you look at the common
lisp you'll find such things as (from g-opt.boot.pamphlet):
EVALANDFILEACTQ which is VMLisp/370 (nee LispVM, nee Lisp/360)
a product of Fred Blair, Cyril Alberga, and Mark Wegman (which, by
the way I need to add to the kudos list since Fred, Cyril, and Mark
were heavily consulted during the translation from VMLisp). Most of
the MACLisp and VMLisp rewrites are in vmlisp.spad.pamphlet.

Looking even deeper into the common lisp you'll find MODLisp, which
was an effort by Dick Jenks, Dave Barton, and a few others. Bits of
it still survive. It predated and fathered Scratchpad/Scratchpad II.

And there are even MACLisp primitives still around like subrp (see
src/interp/vmlisp.lisp.pamphlet).

I rewrote large portions of old code trying hard to eliminate these
old languages but found that the newer languages didn't have a name
for all of the old concepts (e.g. EVALANDFILEACTQ) or the new name
didn't match the meaning of the old name (e.g. subrp vs compiled-function-p)
exactly so I had to write cover macros/functions. Over time I eliminated
the semantic differences and some of the cover functions/macros are now
simply renames (e.g. subrp is now just a rename and should be removed).
We sold Axiom before I could completely clean up the system. Now I get
a second chance (of course I wish the filmy bastard (i.e. me) had DOCUMENTED
some of this code :-( )

When dealing with languages it is very hard to do a rewrite. Usually the
original programmer was an expert in his language (e.g. MACLisp) and the
rewrite-programmer is not. When the rewrite happens subtle things break.
My special talent on the project was deep expertise in anything lispish
as I worked in MACLisp, VMLisp, Common Lisp, SpiceLisp ZetaLisp, PSL,
Scheme, Standard Lisp, NIL,  and my own implementation (living quietly
under code that runs IBM's and Unimation's industrial robots) and every 
other variant that I could find. I even have a lisp implemented in fortran.
Thus you will hear me say (and not realize the religious nature of the 
comment) that "Axiom is just Lisp". 

Clearly there is much more to do.

Anyway, this history lesson is brought to you by the letters Alpha and
Omega, and the numbers pi and e.

---------------

Tim, the wizard (from Monty Python)


--
forwarded from http://page.axiom-developer.org/zope/mathaction/address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]