Re: Looking for documentation of Maxima internals.
Subject: Re: Looking for documentation of Maxima internals.
From: Robert Dodier
Date: Thu, 7 Apr 2005 15:00:55 -0700 (PDT)
David,
A few random notes which may be helpful. Naturally this
is all open to correction and extension. Sorry that it is
a bit haphazard; perhaps I can try to organize it better
and merge it with existing stuff that other people have written.
All the best,
Robert Dodier
General
- Maxima is a collection of functions to transform
one expression into another
- an expression is a list of the form ((op) x1 x2 x3 ...)
- an expression is indistinguishable from an
unevaluated function call
e.g. {a, b, c} is (($set) a b c) internally,
indistinguishable from set(a, b, c)
- almost every Maxima object is an expression
- vague but important distinction between
simplification (1+1 => 2, sin(0) => 0) and evaluation
- an unbound atom evaluates to itself
- one namespace holds all system and user names
- there are two kinds of Maxima functions:
programming functions (these have function definitions)
and mathematical functions (also called simplifying
functions; behavior results from simplification rules)
- there are three kinds of Maxima programming functions:
argument-evaluating, defined in Lisp (defmfun),
argument-quoting, defined in Lisp (defmspec),
argument-evaluating, defined in Maxima (define or :=)
- for many functions, side effects (files, global
variables) are important
- almost all logic is embedded in the code
(few operations are driven by rules or tables)
- Maxima is extensible to varying degrees
- new programming function: easy
- new operator like + * ! [] etc:
defining the operator programming function is easy;
simplification rules are possible, not easy
- new mathematical function: possible, not easy
- new object (e.g. set): essentially same as
a new mathematical function
- changing behavior of existing element:
usually requires Lisp hacking (only for brave and/or foolish)
Maxima programming language
- procedural language reminiscent of Algol
- some elements reminiscent of Lisp (block, apply, map)
- dynamically scoped
- not implemented: closures, structures with named
attributes, and namespaces
Maxima and Lisp
- Lisp name $foo equivalent to Maxima name foo,
Lisp name foo equivlent to Maxima name ?foo
- typically user-visible function named $foo farms out
subcases to internal functions foo-case1, foo-case2, etc
- default mode is to interpret Maxima input,
but Maxima input can be translated into Lisp,
or translated and compiled
- Maxima core is written entirely in Lisp (not Maxima)
- add-on functions written in Maxima or Lisp
File organization
- core implementation in maxima/src
- add-on functions in maxima/share/*
(one directory per package)
- regression tests in maxima/tests
- documentation in maxima/doc
__________________________________
Do you Yahoo!?
Yahoo! Mail - You care about security. So do we.
http://promotions.yahoo.com/new_mail