Primitives error handling
Last updated at 3:51 pm UTC on 5 March 2007
Brian Rice (Google Account: BrianTRice)
The VM does some degree of sanity checks when primitives are invoked. But it returns only success of failure. However there are many places where a primitive can fail for several different reasons. In those cases, the Smalltalk code has to re-discover what the problem is. Not all of these problems are "errors"; often the Smalltalk code can resolve the problem and continue execution.
Altering the logic so that a diagnostic message is recorded detailing why the primitive failed would greatly simplify the way that the Smalltalk methods that send primitives are coded.
This would require changes in Slang, changes in the Smalltalk code to pull the data, and changes in platform specific APIs.
Benefits to the Student
Smalltalk has one of the simplest and cleanest interfaces between the language and the virtual hardware. The student will gain a deep undersatnding of this interface, and will be in a good position to extend the VM by adding new primitives.
Benefits to the Community