2005-07-01 03:39 pm

annoying software

When I was very little and learning Pascal, I had only the foggiest notion of machine code and no idea about linkers and loaders whatsoever. I could, however, write a program in Pascal and then the compiler would magically turn it into an executable (EXE!) file. The only way I could conceive to write a compiler myself was this: To write a program that was really an interpreter, and then, to "compile" some source, I would concatenate the executable of my interpreter and the source to be "compiled." The interpreter would know, when run, to examine itself, seek to the point where its own executable code ended, and find the program it was suppose to interpret. Presto! A program to generate self-running exectables from source code! But it was not, of course, in any sense a compiler.

As far as I can tell, this is pretty much how the Matlab compiler works.