[virtmach] Your VM
Francois-Rene Rideau <email@example.com>
Tue, 29 May 2001 12:27:19 +0200
On Tue, May 29, 2001 at 10:37:38AM +0100, Thaddaeus Frogley wrote:
>> large switch case statement,
> An unmaintainable nightmare.
Only if you program it manually.
If you metaprogram a wee bit, you can get it
to be generated automatically from modular declarations.
Actually, from the same modular declarations,
you can generate several versions with different threading techniques,
and automatically select which is best for which architecture/compiler combo.
One way you can do that is with m4 macros (thisforth does it -- butt ugly);
another way is with a LISP or Perl or Python or whatever script.
I know, for instance, that the ARDI guys doing their 680x0 on X86 emulator
used a lot of perl wizardry to automatically generate instruction templates
for their JIT assembly translator.
[ François-René ÐVB Rideau | Reflection&Cybernethics | http://fare.tunes.org ]
[ TUNES project for a Free Reflective Computing System | http://tunes.org ]
A language that doesn't affect the way you think about programming,
is not worth knowing. -- Alan Perlis