Page 1 of 1

Scripting Languages

Posted: Sat Apr 22, 2006 12:18 am
by Shark
I know that VS uses Python. However, I thought I'd read that it doesn't compile to binary, and therefore is rather slow.
How about a language such as Lua? From what I understand, it compiles to C code, and therefore should be quicker.

In the past I've written a pretty-printer for Lua code. I could try and create a tool to translates between Python and Lua.

Posted: Sat Apr 22, 2006 12:34 am
by Paslowo
I don't know how Lua could work as a scripting language for VS but it would be pretty neat.

In a matter of fact, Lua is my favorite scripting language eventhough I don't know how to use it yet.

Posted: Sat Apr 22, 2006 12:52 am
by loki1950
there is a compiler for Python and lots of the VS Python is pecompiled for speed.

Enjoy the Choice :)

Posted: Sun Apr 23, 2006 7:02 am
by Wisq
Well, let's be clear here.

When you compile C, say, you're making machine code. (Same if you compile something down to C and then compile that.) Machine code is way fast. And it's heavily optimised, too, which is why compiling lots of C can take a lot of CPU, and that's why you do it once and then run the result over and over.

When you compile Python, Perl, Java, etc., you're producing bytecode. You still need a virtual machine (compiled machine code) to handle all the instructions (compiled bytecode), so it won't be as fast as pure machine code, but at least you don't need to process the raw source code over and over.

Note that some of these require a compiling step beforehand (e.g. Java), some don't but leave behind the compiled code for next time (e.g. Python), and some just recompile the code to memory every time you launch it (e.g. Perl). The effect is always the same -- you've got a virtual machine running compiled bytecode. (Someday, they may all actually run under the same VM.)

So note that although Python is compiled, it's not going to be as fast as a C-based language. Something like Lua, compiled down to C, could be a fair bit faster (assuming it's producing efficient C code).

That being said, I don't personally have a problem with an interpreted run-time-compiled scripting language like Python, so long as it doesn't become bloated or overworked. When code gets complex and/or is being run so often that it's a significant performance drain, then it's time to either slim things up or port code into the C++ core.

(Also, although I'm not a fan of Python myself, at least it's one of the big names that everyone knows; I'm not sure I can say the same for something like Lua. Of course, some of the best languages out there are also the most esoteric. ;))

Re: Scripting Languages

Posted: Thu Mar 03, 2011 12:39 am
by darvin
I prefer python for it's readability

Re: Scripting Languages

Posted: Wed Sep 21, 2011 1:59 am
by pheonixstorm
and you bring up a 5 year old DEAD thread for what reason? (then again I could ask myself the same question...)