Go to the first, previous, next, last section, table of contents.


More Numbers

C provides access to the basic arithmetic abilities of the host computer, which is all one wants from a low-level language, but real life involves many other kinds of numbers and things used like numbers, and one would like a high-level system such as Muq to provide good support for them.

For starters, Muq does not yet have complex numbers, although I have sketched in the code. (Anyone know where to find PD code for trig and exponential functions on complex numbers?)

Quaternions are the unique generalization of complex numbers and quite useful for such things as representing 3D rotations: They deserve to be better known and appreciated, and might be so if more systems like Muq supported them.

Much real computation involves dimensioned numbers: Meters per second, dollars, or whatever. If the dimensions are explicitly tracked, Muq can automatically handle addition of yen to dollars or meters to yards, and can flag as nonsensical addition of yen to yards. This isn't hard, but it needs to be done to be useful.

It is only a small step from handling dimensioned numbers to handling simple symbolic algebra also. Polynomials, for example, are combined using the same operators (addition, multiplcation &tc) as scalar numbers, and there's no reason Muq users shouldn't be given at least basic algebraic operations.

Handling arrays as numeric types is a quite similar issue, and languages like APL (and even ForTran) have demonstrated that supporting this takes much of the drudgery out of working with arrays by reducing or eliminating the need to be forever writing explicit looping constructs. Good virtual machine support for such operations would simplify implementation on Muq of languages such a J and would benefit all Muq languages.

The Muq arithmetic primitives should (but as yet do not) be extensible to work with arbitrary user-defined bytes via the Muq generic function mechanisms. This isn't hard, just needs to be done.

All this is stuff which I somehow doubt anyone but me is going to be willing and able to implement.


Go to the first, previous, next, last section, table of contents.