This question already has answers here:
Scripting Language vs Programming Language [closed]
(14 answers)
Closed 6 years ago.
I was doing some research on scripts and learning about bash scripts. I recently found out that you can also write scripts in other languages like python. I'm curious what the advantages and disadvantages are of writing scripts in the native OS language (I guess that's what you'd call it) and another scripting language like python.
A script or scripting language is a computer language with a series of commands within a file that is capable of being executed without being compiled. Good examples of server side scripting languages include Perl, PHP, and Python. The best example of a client side scripting language is JavaScript.
From http://www.computerhope.com/jargon/s/script.htm
You can read:
Scripting Language vs Programming Language
http://searchenterpriselinux.techtarget.com/definition/script
Related
This question already has answers here:
Vb.net Run Script inside Textbox
(2 answers)
Closed 2 years ago.
How can I have a button execute VB code I entered in a text box?
E.g. when I wrote this in text box:
form1.Show()
and the button is clicked, form1 will be shown.
What you're looking for is like eval() for javascript or PHP.
.Net (including the VB, C#, and F# languages) is a general purpose platform, where javascript and PHP are intended for more specialized situations (javascript is usually in a browser with limited APIs, and PHP was originally a web CGI platform only).
It's okay for a specialized language, which can be sandboxed and API-limited, to include an eval() feature. But for a generalized language, which needs access to all of APIs in a system, this is extremely dangerous. There are MASSIVE security implications. As a result, this kind of thing is not impossible (there's CodeDOM, Roslyn, compile+Reflection.Load, etc), but none of them are quick or simple to do. There's not a simple eval() function out of the box. And that's a good thing.
I have a bunch of codes from students for a coding question. I am using Jplag to find the similarities between their codes.
java -jar jplag-yourVersion.jar -l java17 -r /tmp/jplag_results_exerise1/ -s /path/to/exercise1
This kind of syntax works for single language. But i am having codes in multiple languages like c, c++, java, python, ruby.
Can some one suggest me a method to process all the codes which are in different languages.
According to these references, it is not possible to detect cross-language plagiarism with JPLAG.
Detecting source code reuse across programming languages:
"JPlag is able to detect source code reuse in different programming languages although at monolingual level, that is, one programming language at a time."
(CLSCR) CROSS LANGUAGE SOURCE CODE REUSE DETECTION USING INTERMEDIATE LANGUAGE:
"Some of the tools are Sherlock, MOSS, JPLAG etc. All of these tools detect mono language plagiarism"
I am wondering what is difference between scripting and non scripting language. For example like LUA and C++. Because in game development I often read that they are hiring programmer who must know scripting language. Thank you!
Some of this is somewhat historical in nature.
Non-scripted languages like C and C++ are compiled into "raw machine code" (RMC).
That RMC is then run directly on the machine. Note that RMC is typically
very specific to the underlying CPU/hardware AND to the supporting Operating
System. So if you want to run a C program on both linux and windows, it has to be
compiled for each (two copies to maintain and distribute).
A scripted language is typically NOT compiled. Instead, the source
code is passed to an interpreter that understands the language. The
interpreter itself is typically written in a language that is
itself compiled to RMC. The interpreter's task is to read the
scripted language, and translate that into operations done by RMC.
The line has blurred in recent years (decades?) with the advent of
systems like Java. With languages like Java, source code is
compiled to an intermediate/portable language, and the Java Virtual
Machine handles the translation of that portable language into
operations for the target CPU/OS.
This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
When is a language considered a scripting language?
what is the difference between programming and scripting languages? I have worked on C/C++ for a while and now I started looking at Python, I was told it is a good scripting language this post.
But as I'm learning, I'm finding that everything that can be done with C till now can be done with Python! so what is the actual true difference between scripting and programming languages?
I actually believe the question is a bit misleading. Of course a scripting language is also a programming language. But there are differences:
Between Compiled and Interpreted Languages.
Traditionally a language like c is compiled into machine code that can be understood directly by a cpu. A "script language" on the other hand usually is not being compiled into machine code before execution but interpreted using an interpreter.
The advantage of an interpreted language usually is that it has a faster development cycle because no compilation is necessary and it is easier to move from one platform to another. E.g. python scripts can be executed on windows, linux, mac without changes.
The advantage of a compiled language on the other hand is that it executes usually much faster.
I used "usually" and "traditionally" very often because there are now technologies that make it much harder to draw the line. E.g. it is possible to compile python code directly into native code and there are also interpreters for c code. Also "Just In Time" compiler and virtual machines make it harder to draw here black and white.
More: http://en.wikipedia.org/wiki/Interpreted_language
Duck-Typed and Strong-Typed Languages
Usually script languages are duck-typed which means that a variable can be assigned any type and there is no or only optional checking of types. In compiled languages on the other side like C and C++ every variable is typed and it can and will only hold values of that type.
The advantage of a duck-typed language is usually that it requires less physical typing and less code (e.g. type names can be left of function declarations etc...) and it is easier to write reusable functions.
The advantage of a strong-typed language usually is that it "helps" the programmer finding bugs before running the application. E.g. the compiler would complain about type errors without the need to run the concrete line where the error is happening. Especially in big projects with many contributors this can become an amazing advantage.
More: http://en.wikipedia.org/wiki/Duck_typing
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Bootstrapping a language
What's the importance of having an interpreter for a given language written in the target language (for example, PyPy)?
It's not so much about writing the interpreter in itself - more about writing the interpreter in a high-level language, not in C. Ideally, doing so allows to change details of the implementation, and making the interpreter more modular.
For the specific case of PyPy, writing the interpreter and the core objects in (R)Python allows to retarget PyPy for targets (C, JVM, .NET, JavaScript, etc), and also allows to replace aspects such as the garbage collector.
I'm sure there are many different reasons for doing it. In some cases, it's because you truly believe the language is the best tool... so writing the language interpreter or compiler in the language itself can be seen as a form of dogfooding. If you are really interested in this subject, the following article is a really amazing read about the development of squeak. The current version of squeak is a smalltalk runtime written in smalltalk.
http://users.ipa.net/~dwighth/squeak/oopsla_squeak.html
An added benefit is that if you implement good debugers and IDEs for your target language, they also work for your source language.
This way, you can prove that the target language is serious business, because being able to make it compile something is a sign that it is a good language.
OK, C++ and Java produce compilers as well... so maybe that argument is only half as good as it may seem.