I am working on tiny programming language (for our specific tasks). It's a script language.
It looks like a library for C++ that can execute a code of this language. This library parses a source code and create required entities in the memory, i.e. a source code isn't compiled in byte code, it keeps in the memory as C++ objects and all next calls use these objects in the memory.
My question is can I call that library interpreter? Or has it some specific name?
Just I read an interpreter is a program that executes a source code by logical blocks or pre-compile it into byte code but my library does a nothing from this. It parses a whole source code and after works with objects in the memory.

  • 1
    $\begingroup$ This sounds like a good question. "all next calls use these objects in the memory". Can you clarify in the question whether it is your library or some other code is making "all next calls"? If some code other than your library makes all next calls, your library can be reasonably called deserializer. $\endgroup$ – John L. Oct 7 '18 at 5:04
  • 3
    $\begingroup$ The key question is: does your library run code written in your language? (and is this its primary task?) If so, then it's an interpreter. It does not matter how it is organized internally. Often, simple interpreters keep in memory the Abstract Syntax Tree generated after parsing, which can be represented with objects referring to each other, and then run the code by visiting the AST (e.g. through object method calls which will propagate on the whole AST, as needed). $\endgroup$ – chi Oct 7 '18 at 9:30
  • $\begingroup$ @Apass.Jack, yap, the library execute a code by itself. C++ program just calls script.func("func_name"/* , args */). $\endgroup$ – Шах Oct 7 '18 at 16:46
  • $\begingroup$ @chi, thank you for explanation! Seems I can call then. $\endgroup$ – Шах Oct 7 '18 at 16:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.