Programming and Scripting :: compared languages



There are always trade-offs between language choices, so, as the cliche says, it's always about what is the right tool for the particular job.

Sometimes it's better to take a little size and performance hit in order to have the conveniences afforded by higher level languages, or just a language that you know well.   I mean, if you want everything tiny and ultrafast, just write it it Assembly language!  Can't get any smaller, faster, or more difficult than that, short of writing in binary.

Some languages that appear to be 'interpreted' are actually compiled during run time - Perl for example, is compiled into byte code when you run it, and run on  a virtual machine.   Which is why you're not supposed to call a Perl program a 'script' (it isn't).  It's also possible to turn Perl directly into C binaries.  And is the strict sense of the word, all languages are 'interpreted' at some level.

Mikshaw: that gtk-server thing sounds interesting.

Not to mention tcc can interpret C..
curaga: sure... but not to point out the obvious, that chart that you pointed out lists freebasic, which is not interpreted.

Good points, WDef.  I suppose it's similar to Java.  I do not know much about Perl, but I have always heard of its source being called "scripts" -- seems like for historical reasons or whatnot.

Quote
produces smaller executables/binaries/scripts
This I have much trouble believing.  One of the benefits of using an interpreted language is that much of the code that would normally be compiled with your program is already compiled into the interpreter, so scripts can be _much_ smaller than compiled apps that do the same thing.

Quote
I didn't know of GTK-server, it seems great. Why was lua chosen over bash & it?
Lua is a much simpler language. I haven't actually tried GTK-server yet, but from looking through the docs and examples, it seems terribly complicated in comparison to creating murgaLua scripts. I'm sure there is probably a significant difference in runtime performance as well, but that's just an assumption.

I'm also not sure about the "tiny" part. I was going by the size of the source package, which is approximately the same as the compiled murgaLua binary. For all I know, it may suck up a huge amount of code from Gtk

GTK-server website: http://www.gtk-server.org/

Quote
but I have always heard of its source being called "scripts"

People do use the term - some Perl heavies get  annoyed about it though - I guess they feel it demotes Perl.

Larry Wall himself says he doesn't care, but that "a script is what you give the actors. A program is what you give the audience." That's not meant to make sense, he's famous for his wise cracks.

From Perlfaq1:

Quote
Perl programs are (usually) neither strictly compiled nor strictly interpreted. They can be compiled to a byte-code form (something of a Perl virtual machine) or to completely different languages, like C or assembly language. You can't tell just by looking at it whether the source is destined for a pure interpreter, a parse-tree interpreter, a byte-code interpreter, or a native-code compiler, so it's hard to give a definitive answer here.

Now that "script" and "scripting" are terms that have been seized by unscrupulous or unknowing marketeers for their own nefarious purposes, they have begun to take on strange and often pejorative meanings, like "non serious" or "not real programming". Consequently, some Perl programmers prefer to avoid them altogether.



Actually the way Perl runs depends on the particular circumstance - it can run it different ways.  I don't fully understand this yet, it's there in the Perl docs.

Next Page...
original here.