Jump to content

What kind of program runs the scripts?


Recommended Posts

Dear reader,

I'm wondering what the most correct name is for the computer program that reads the AutoIt script and then runs it, without compiling them. It's not a interpreter, cause I can call functions before they are implemented, but I don't think it's like the C++ compiler? Is it like a linker at first (searching all the function addresses), and then a interpreter?

Your sincerely,

SG

Link to comment
Share on other sites

I am pretty sure AutoIt3.exe is the "interpreter" for the scripts, but the source code is never truly uncompiled. When you "compile" a script, all that happens is you clone AutoIt3.exe with all your scripts tagged on the end. I'm sure I answered your question though.

Link to comment
Share on other sites

@StijnG

Not sure what you mean here, AutoIt looks interpreted to me.

If you don't compile:

AutoIt3.exe reads the au3 file.

If you compile:

AutoItSC.bin (a stub of the exe) gets glued together with a au3 file (basically) and reads that when executed.

So for most intents compiled-or-not is the same thing.

Maybe you could explain your question further?

Link to comment
Share on other sites

Why don't you think it's not an interpreter?

Corollary: how do you think an interpreter works w.r.t. finding functions not already encountered?

Edited by jchd

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Link to comment
Share on other sites

Good catch! That's what comes out when you're constantly being distracted by boring emergency.

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Link to comment
Share on other sites

Well, to me a basic interpreter is like the Javascript-interpreter of a browser.

You have the source code in plain text en you can run it instantly. So the browser doesn't read all the JS before it starts executing. To me this is a basic interpreter because if I script something like this:

..

var c = amt();

..

function amt()

{

return 0;

}

..

This gives an error when I run the script, because I called a function that isn't declared or implemented yet.

If I would write this in C++, the compiler would complain, because he checks the whole code before making the intermediary language.

The same story with AutoIt:

..

Local c = amt()

..

Func amt()

return 0

EndFunc

..

If AutoIt is a basic interpreter it would see a function call to "amt()" but he can't know at which address this function is stored.. It still needs to read the function source code. Yet this doesn't happen, AutoIt has read the whole script before executing it! So we can't really say running AutoIt scripts is handled by an interpreter right?

Link to comment
Share on other sites

It's even better than you think! Try to run this:

ConsoleWrite(_TempFile() & @LF)
#include <File.au3>

to check that AutoIt will (even from Scite) find the _TempFile function in the include file. So AutoIt is smart enough to do file-traversal for us.

What you write really means that Javascript is a "short-sighted lazy interpreter", C++ is a "short-sigthed lazy compiler" and AutoIt is a "smart hard-working interpreter equiped with file-traversal telescope".

I would have said "binoculars" if the following wouldn't trigger an error:

Local $attr = $FO_UTF8
#include <File.au3>

Now the question is: can you see why it is so?

EDIT: i really don't advocate placing include files elsewhere than at top of file. Don't do it, it was only for demonstration!

Edited by jchd

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Link to comment
Share on other sites

Stijng,

I didn't ask the last question in a rethorical posture. This is really a good question that will help you understand what happens under the hood.

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...