MIFFS Is Fun For Sums

by rich

Issues and Plans

MIFFS is very much a work in progress. There are a few issues that I am aware of, and many that I am not.

Type Checking

Although MIFFS is typed, it only checks types on evaluation. Making a type-checker seems harder than I thought it might be. This means that function types may not even be valid. There is no way to cast or restrict types (you cannot define a function that will only accept integers, like a factorial function should).

This has not turned out to be all bad: perhaps there are more advantages to untyped languages than I first thought: in MIFFS you can set up poly-typed functions in ways that are not possible in ML. You could set up a function that does one thing if presented with an int list, and another if given a bool.

It does make programs very fragile - you cannot really tell before evaluation if you have a valid function, although to be fair, strict typing only catches basic errors (but quite effectively).

Pattern Matching

This is a similar problem to the type checking issue: it is quite easy to set up redundant or unsatisfiable cases in a definition, and MIFFS does not check for this. For example the second case in the function below could never be reached (if the order was swapped then, in this case, everything would be ok).

fun f a b = a+b | f tf = not tf

Meaningful Error Messages

I have found it very hard to ensure that all generated error messages will be meaningful. This was a fairly serious problem at first because error messages were fairly frequent (see fragile comment above). One of the main causes of this is that in recursive descent parsing (as used by MIFFS) a problem in one branch of the evaluation tree is used as a signal to try the next branch, for example in pattern matching, where a problem in binding the formal parameters is interpreted as a promt to move on to the next case, so the only error message will be "all cases exhausted" - not very helpful, especially if it is not on the top level.

Data Structures

MIFFS has no data structures (other than tuples, lists and modules). In the future, I might add user-defined data structures.

Value Browser

It might be nice to have an object browser which lets you see the defined values in the startup environment, especially now there are a fair number of them. Perhaps a special comment format could be used to add descriptions to the values to be displayed in the browser...