Original Post
Originally, I had intentions to build a compiler for a custom language of mine. I wanted the compiler to turn my source into Intel-32 bit assembly language. Then, combined with my compiler would be NASM, the free and excellent assembler that is often used. The assembly source would then be assembled by NASM and turned into an executable.
After much thinking I realized I felt like that would be incomplete, since I was using NASM, and not my own assembler. So, I thought about the possibility of creating an assembler and linker module along with my compiler. Mind you this language was simple and not very robust, so it wasn''t a huge, complex language or anything; so I thought it would be possible. However, I figured an assembler would be very hard since I''d need lots of documentation on the binary codes for different assembly commands and combinations. Thus, it would easily get confusing and difficult.
Now lately I''ve thought about just making an interpreter, similar to the old BASIC or Python of today. I have questions though.
* What is the basic theory of an interpreter?
a) Essentially, how do they work?
b) Is any of the code translated into assembly?
c) Does the interpreter rely on the library commands of the language that is building the interpreter? In other words, if I have a "print" command in my language, is that really just using "cout" in C++ behind the scenes? I hope you understand what I mean.
I''m not sure how they work, so a brief explaination would help a lot. I''m not sure if it''s really just an interface layer between my language and the build language, or a virtual machine kind of thing, I really have no idea. I just want the concepts behind the old BASIC or Python.
Thanks a lot for any help!
