views:

100

answers:

5

Hello!

There are many scripting language communities claiming that the language can be used for everything but in fact, nearly everybody uses it for one specific thing, e.g.: web development. If I take a look at Ruby, for example, they tell you its general-purpose but actually everybody is using it with rails for web development only..

  • Can you list me some uses of popular general-purpose scripting languages for the local PC? (except embedding) Are there any?
  • Is the fast development usually worth having to bring the whole interpreter with your program? Then there would be some language-dependent performance and stability problems too in most cases..

best regards, lamas

+2  A: 

claiming that they can be used for everything but I often can't find any examples for that

You are basing your question on an incorrect assumption. Although, as pointed out, a Turing complete language will be able to compute what you require ... languages are 'viewed' by most as the sum of their most useful features and productive semantics.

The reality is:

  1. Most scripting languages can do the same things, or support the most common things via libraries.
  2. Some languages make a subset of operations more convenient, take Perl and regular expressions as an example
  3. CPU time is cheap, as is RAM. Simple to understand code is the priority for most people.

The rise of the scripting languages is natural. Trying to assert any one language, approach or level of execution is good for a range of situations is usually fruitless.

  1. What do you want?
  2. What is the best language for that?
  3. Is is fast enough or small enough? Usually the answer is yes

Imagine trying to use Python where you should be using Erlang, or C instead of Lisp because you thought all languages are equal. They aren't, even though, you can achieve the same things in a problem domain, in most languages/platforms with varying levels of ballache dependant on the task.

Aiden Bell
I may have formulated that in a wrong way. I ment that they claim that they can be used for everything, but then in reality nobody uses it as a general-purpose language
lamas
@lamas, define general purpose. Any given language can compute the most common things you need ... but specialize ... hence the specialised use.
Aiden Bell
If it's turing-complete, it *can* compute anything that's computable.
Anon.
@Anon. Yes, but I was avoiding bringing that up ;) ... The question seemed more API-driven/immediate semantics than an exploration into theory ;)
Aiden Bell
+2  A: 

I often use PHP for things that I used to use bat files for. Much easier to write. Ironically, the deployment scripts to create installable materials for my web apps from the subversion sources are written in PHP.

Python is popular in the gaming community. EVE Online is written in python.

Joeri Sebrechts
Yeah, I use PHP mainly for "everyday tasks" on my local PC too.They wrote the graphics engine in Python too? :O
lamas
+3  A: 

I tend to use Python for most things that aren't compute bound, i.e. they aren't restricted by how many computations you do per second. Some of the things I've used Python for are:

  1. General scripts to manipulate images etc. with the Python Imaging Library.
  2. GUI frontends for command line applications using the pexpect module.
  3. Mathematical modeling of microbial systems.
  4. Bioinformatics.
  5. Some web programming.

etc...

When the program/algorithm is compute bound, I use C together with Python and Ctypes. Does this fit your definition of general purpose? It's certainly useful for a wide variety of applications, but not suitable if the program needs to crunch numbers fast.

Stability: Python 2.5/2.6 is rock solid. Never had a crash that wasn't caused by self-stupidity.

Fast development: It's definitely worth it for me. For the most part, in the field where I work, programmer time is orders of magnitude more valuable than processor time. I'm quite happy to let a program run for hours if I can write it in a few days instead of a few weeks.

Chinmay Kanchi
+1, Python is awesome.
Aiden Bell
+1  A: 

I often use ruby for what other people would create bash/sh files for. I find Ruby syntax intuitive for batch tasks along with a lot of other sorts of tasks(it's my goto language)

Perl is extremely popular for general scripting in unixes, such as there are package managers and websites and maintenance scripts written in perl.

Python is extremely popular for both web and application use.

VBA Is popular for being abused to write programs inside of Access, and also was once commonly used in ASP for websites (right?)

Earlz
A: 

Nobody mentioned AppleScript!

Hahah, no seriously, Perl runs everywhere, is installed by default on (almost) any Unix-family OS (and is easy to get on Windows), and is extremely useful for gluing things together. And if you browse a bit at CPAN you'll see that it's extremely general-purpose. "Swiss army chainsaw" was intended as a slur but I think of it fondly. Performance is good too, though it hardly ever actually matters. Larry Wall's goal was "make easy things easy and hard things possible".

OK OK, so I'm a fanboy still, sigh.

Nathan