(Programming) What language do language interpreters use?
- jcastroLv 63 years agoFavorite Answer
One can write an interpreter for any programming language, using almost any programming language - some languages are too cumbersome to program with. It's even possible to write a compiler/interpreter of a language in itself! One example is PyPy:
Use the language you are most comfortable with. If the interpreter of the language you plan turns out to be too slow, you can write a compiler instead (generating either machine code or other language's code) or reimplement the interpreter in a faster language (like C or C++).
By the way, please read:
- Anonymous3 years ago
I would recommend understanding how the hardware works with data. Go from low to high level to high to low level languages back and forth until you grasp how. If that's what you desire, but there's already languages for what we need on screen.
- Andy TLv 73 years ago
Most likely C/C++, otherwise it is too slow, those languages fit the bill, speed and low level. But obviously there are others being used. Just don't consider Assembly is one since it is too low for modern computing environment.
- Never AvailableLv 43 years ago
Interpreted languages tend to be slower in computation time than compiled languages. Just make sure you're aware of that. An example of an interpreted language is PHP.
Interpreted languages are usually written in C or C++ for performance and max control on how computers execute methods.
All a compiler does is parse files and create machine-readable code. An interpreter simply is a compiled program that, instead of converting code to machine-readable language, executes its own methods depending on what you wrote. But it has more overhead because it has to parse and read every file whenever it's being executed... That's part of the reason PHP includes are so expensive. A compiled language only has to be parsed and read once, reducing overhead.
There's also Just-In-Time compilation... But I think that's out of the scope of your question.
- How do you think about the answers? You can sign in to vote the answer.
- ?Lv 73 years ago
The fact that you want to write the interpreter in XML suggests you are not ready to do this, by far. XML isn't a programming language, it's a markup language.
- Robert JLv 73 years ago
You can write an interpreter (or compiler) in just about any language you like.
They are often written in C (or C++) as that's the single fastest and most efficient language, but you could write eg. a Pascal interpreter in BASIC or a BASIC interpreter in Python.
I've written a quick-and-dirty compiler for a PLC in PHP before now..