Many people who write game programs and other applications implement the language in the application to allow users to write small programs.
As far as I can tell, the most popular built-in language in the very rude, most popular in the first order (although “more popular” doesn't necessarily mean “better”) seems to be:
You can check Gamedev StackExchange, in particular questions such as "How to add scripting language to the game?" .
You might want to check out some of the questions here on StackOverflow with embedded language tags; such as "Choosing an Embedded Language , " "What is a Good Embedded Language That I Can Use for Scripting Inside My Software?" Alternatives to Lua as an embedded language? "Which game scripting language is better to use: Lua or Python?" , and etc.
Many implementations of these languages use a kind of bytecode internally. Often two different implementations of the same high-level programming language, such as JavaScript, use two completely different bytecode languages inside ( a ). Often, several high-level programming languages make up the same basic bytecode language — for example, the Jython implementation for Python, the Rhino-style JavaScript implementation, the Jacl Tcl implementation, JScheme, and several other Schema implementations and several Pascal implementations; all compiled into a single JVM bytecode.
the details
Why use a scripting language rather than interpret any language on a hardware computer?
Why "alternative hard and soft layers" ? To get simplicity and speed up development.
faster development
People usually work faster with scripting languages than with compiled languages.
Getting the initial prototype work is usually much faster - the interpreter processes a bunch of things off-screen that the machine language forces you to explicitly write out: setting the initial values of the variables to zero, the prolog subroutine and the -epilog code, malloc and realloc subroutine, as well as free and associated memory management, increasing the size of containers when they are full, etc.
As soon as you have the original prototype, adding new functions is faster: scripting languages have fast edit-run-debug cycles, since they avoid the “compilation” phase of the edit-compile-run-debug cycles of compiled languages.
Simplicity
We want the embedded language language to be “simple” in two ways:
If a user wants to write a little code that performs some conceptually trivial task, we don’t want to frighten this person with a difficult language that requires 20 pounds of books and months of training to write “Hello, $ USER” without buffer overflow.
Since we are introducing the language, we want something to be easy to implement. Perhaps a few simple basic instructions, we can knock out a simple interpreter on the weekend and, perhaps, some already existing compiler, which we can use with minimal setup.
When people create processors, hardware limitations always limit the set of instructions. Many conceptually “simple” operations — things that people constantly use — ultimately require a lot of machine language instructions to implement.
Nested languages do not have these hardware limitations, which allows us to implement more complex "instructions" that do things that (for humans) seem conceptually simple. This often makes the system simpler in both directions mentioned above:
People who write directly in the language (or people who write compilers for the language) end up writing much less code, spending less time on a single click of the code, debugging it, etc.
For each such operation of a higher level, we shift the complexity with the compiler to implement the instruction inside the interpreter. Instead of (you write the code), the compiler breaks some higher-level operations into a short loop in the intermediate language (and repeatedly steps over this loop in your interpreter at run time), the compiler emits one command in the intermediate language (and you write the same sequence of operations in your interpretive implementation of this intermediate “instruction”). With all the intensive processor tools implemented in your compiled language ("inside" complex instructions), extremely simple interpreters are often more than fast enough. (Ie, you avoid a lot of time building a JIT or trying to speed things up in other ways).
For these reasons and others, many programmers use the "scripting" language as their "embedded language."
(Now I see that Javier has already recommended "using the built-in scripting language", so this has turned into a long debate about why this is a good alternative to interpreting a hardware computer language and indicating alternatives when one particular scripting language does not seem appropriate).