daeghnao wrote:Reading some recent discussions got me thinking. We currently have to write interrupt handlers in compiled languages, because our interpreted language frameworks aren't built for the environment inside interrupt-handling. What if one were to design an interpreted language that could be used to implement interpreted interrupt handlers? What would it look like? How would you arrange to have feedback on its behaviour in the IDE? And, most importantly, could it be implemented in our favourite little Atari ST?
Writing a interpreted interrupt handler would be such a big problem. A routine should be declared as an interrupt routine. During the interrupt the interpreter would be called and start to process the code. At the end the interpreter cleans the mess up and executes the RTE.
Just as in a languages the programmer has to take care about not modifying data that could be modified during an interrupt.
The big question is why? Why would one want to have an interpreted interrupt routine?
There is no big need for interrupt routines. The number of compilers supporting interrupt routines on the ST is close to zero. I don't know any, do you? For years programmers have been creating the most wonderful programs without interrupt routine support.
Interrupt routines are only very small routines doing very specific tasks. Usually those tasks are very time critical. Those few who really need an interrupt routine will write a few lines assembly code to suit their needs.
Now this forum is blessed with an idiot* who doesn't understand much of programming and hasn't the faintest clue about how an Atari ST works on hardware level. His state of mind is that there is somewhere hidden a Silver Bullet that will magically solve all his problems. He has been searching for this bullet for about the last decade (I have lost count). Unfortunately for us and him the Silver Bullet does not exist.
Writing a interpreter that can handle interrupt is an interesting project just because it is fun. It will not have any practical value other than hack value. It will not solve the problems for those who cannot write an interrupt routine in assembly.
*if you are insulted by this remark then I am right. If not the remark was obviously not meant for you.