Showing posts with label Languages. Show all posts
Showing posts with label Languages. Show all posts

Saturday, May 2, 2009

Scripting Languages



One enigmatic question that I find people often have a hard time giving a straight answer to is "What is the difference between a 'normal' programming language, such as C++, and a scripting language." This question leads to a lot of backpedalling and out spews a lot of general non-specific answers.

The term 'Scripting Language' refers to one of two different things. The specific definition refers to a programming language that controls software. An example of this would be QuakeC, which allows writing scripts for the popular fps game, Quake. Another example would be ASP, which works on the server side to dynamically generate web pages.

The generic term 'Scripting Language' refers to any language, whether used for specific applications or for general purposes, which is interpreted instead of compiled. An example of this general definition would be Python or Ruby.

"Aaah, now I get it." But what exactly is the difference between a language being compiled and a language being interpreted. An interpreted language is one that instead of compiled, is 'interpreted' and run at the same time. Essentially an interpreter is a dynamic compiler. it interprets each line of code in your program into machine code and then runs it at the moment. This contrasts to a language that must be compiled into machine code all at once and then run.

While an interpreted language runs slower, the syntax is often more powerful, interpreted languages allow for things such as implicit typing, which means you don't have to declare the types of your variables, and that you can change them on the fly. Programs or 'Scripts' often take a lot less time to write then if they were written in an a compiled language.

As a last note, I prefer the stricter definition of "Scripting Language", and generally so do programmers who use languages such as Python. If you have any expert knowledge of interpreted languages, please share below.

Wednesday, April 15, 2009

New to Python (and blogging)

I shall begin at the beginning... I am a Junior in an undergraduate program in Mathematics and Computer Science, I have just gotten a programming internship for the summer. What does this mean? That in the endless sea of knowledge in the programming world I am about two feet deep.

But that's OK. In this blog I will be sharing my new gained knowledge of programming, whatever sundry topics they may be, and ask for opinions and help as well. So, on to my first content.

For this internship I was informed that I will be using Python. I have never used Python seriously before. The closest I have come was dabbling in Ruby, which is pretty sweet, I must say. If anyone out there is looking for good Python resources this is the site. After nosing around on it, I personally recommend Quick and Painless Python Tutorial by Norm Matloff, if you are familiar with other languages, such as C++. Once you have dabbled in Python a little (btw, I am using Context now as my text editor, could I use Eclipse?) Dive into Python might be for you, it tackles some more language specific stuff, that is slightly more advanced. incidently, other than installing the package on python.org's site, I recommend Active Python if you are using Windows, it's free and it allows you to execute your programs on the command line. (Of course all of the above links are to free stuff, I am a college student!)

I will let you know how my Python adventures go, one thing that has intrigued my is Regular Expressions, I haven't looked at them, but from my experience with Ruby, they seem like a must-have. delving more into this later. Also swirling around in my head are questions about GUI's and other tools used with Python, Python in .NET, Iron Python, etc. the list goes on and on, and it seems only hours of scanning the web will satiate my quandaries.

Any useful comments? thoughts? code snippets that might be helpful...