4.3 Intended improvements
As stated in Design notes section, GNU libmatheval
is
designed with intention to be simple and understandable and to
eventually have its usage to govern improvements. Thus, further work
will be primarily directed by user requests and of course, as usual
with free software projects, with amount of spare time of primary
developer (see Bugs for contact information). However, there
exist several obvious improvements that I’m willing to work on
immediately if any interest of library arise and these are (in random
order) listed below:
- Extend scanner to recognize more mathematical functions, to recognize
alternative names for existing functions (e.g. to recognize both
‘tg’ and ‘tan’ as names for tangent function) and to
recognize more constants.
- Implement variable hash table length for symbol table. As for now,
hash table length is fixed to 211 that is reasonable for most cases,
but it would certainly be more robust to have hash table to be
constructed of length proportional say to length of string
representing function.
- Add more simplifications to function tree representation. Only basic
simplifications, mostly related to numbers subtrees consolidation and
binary operations neutral elements are employed now. More ambitious
optimization, using commutative, associative and distributive rules
for binary operations would be desirable.
- Improve output when evaluator object is printed. Presently,
parenthesis are always used around operations, while using them when
necessary to establish proper evaluation priority order only would
give prettier output
- Add more tests. Basic functionality of library is exercised through
existing test suite, but present number of tests is certainly far from
enough.
- Extend and improve error handling. There are couple
assert
s
left in code that may be replaced with some other mechanism, also
probably error handling of more error conditions should be added to
library.
- Add command line interface to library, i.e. write a program that will
make possible to evaluate expression for given variable values where
both specified in command line, as program arguments (for expressions
without variables this program could be useful as a calculator).
There exists also an improvement that is obvious and necessary but
because I’m not native speaker I’m unfortunately not able to
accomplish it anything more than I already tried:
- Clean up English used in documentation.