Such a simple question, but I have not found a reasonable answer to this. I curr
ID: 659045 • Letter: S
Question
Such a simple question, but I have not found a reasonable answer to this.
I currently program in Python, an interpreted language. I always hear of people using multiple languages in the same program? Then I hear them using scripting languages; Can someone on here please in plain english explain to me the difference between what I know as programming languages and scripts, and how on Earth do people use multiple languages together. That just does not make any sense.
How can someone use Javascript, PHP, and ASP together. Or program a game in C/C++ and use python as scripts? It just doesn't make sense to me, they are different languages for a reason, i assume, so how do they play a role with one another?
Explanation / Answer
In many cases, when you see multiple languages used together, you will find that one is a compiled language and the other is a scripting language.
The compiled language is typically C/C++, but can be many other languages (Haskell, Erlang, Java, etc). The compiled language provides the base application. The base provides an interface to the underlying operating system as well as the foundation for the work to be done by the application. The application will often provide lower level functionality that makes it easier to develop using the scripting interface.
The scripting language is most often used to provide customization for the application. The customization can be part of the application provided by the vendor for their own convenience or the scripting interface can provide customization for the end user.
Many times, the script interface will provide almost a Domain Specific Language by providing useful functions and high level interface specific for the application, making it more easily customized.
A couple of well known examples. Emacs is written in C and customized using Emacs Lisp. TextMate is a compiled application customized using Ruby. Atom is a new text editor that is written in JavaScript to run on Node. Atom is more indirect. The application is (nearly?) all JavaScript while Node.js uses V8 which is written in C++. World of Warcraft has a scripting interface that uses Lua.
As a personal example, I worked on a brand-able installer where the base code was Objective-C/C++ in order to access UI elements on MacOS with customization using AppleScript. The AppleScript interface was used only by us in order to brand the application for each customer.
As others have said, use the right language for the right application.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.