Jump to content

How does the Aut2Exe Build Process work?


Recommended Posts

Hi all, I was working on a very simple interpreter today, and I had a thought.

Most interpreters consist of at least two parts; tokenization/lexing/parsing and runtime execution/interpreting.

My original approach was to parse/lex/tokenize every line just before it was executed by the interpreter.

INTERPRETER SPEED TEST: (Static Test Cases)

Testing over 5000 Iterations.
Took 3.84400010109 seconds.
Each Iteration took 0.000772000026703 seconds on average.

But then I wonder, If static code could be parsed/lexed/tokenized prior to execution (at compile time) it could help by speeding up runtime and significiantly increasing the speed of loops.

This was the new output:

INTERPRETER SPEED TEST: (Static Test Cases)


Lexing/Compiling Code at Recursion level: 1
Output: buildoutput.auc

Compile Successful!
Testing over 5000 Iterations.
Took 0.671999931335 seconds.
Each Iteration took 0.000137599992752 seconds on average.

A 500%+ speed increase for just 100 or so lines of extra code.

It basically produced a script file that was a binary representation of the parsed/lexed output, which, when it came to run the script, could be loaded into memory and interpreted without the need for the script to be parsed/lexed/tokenized on the fly.

Additionally, it supremely compilicates the process of uncompiling the script, as the parse tree must be walked in reverse and the script rebuilt. (You would have to build a parser/lexer/tokenizer, thats half the work behind an interpreter!)

Anyway, I was wondering if AutoIT 2 Exe did something like this, and if not, if it would be easy to implement.

-Hyperzap.

ongoing projects:-firestorm: Largescale P2P Social NetworkCompleted Autoit Programs/Scripts: Variable Pickler | Networked Streaming Audio (in pure autoIT) | firenet p2p web messenger | Proxy Checker | Dynamic Execute() Code Generator | P2P UDF | Graph Theory Proof of Concept - Breadth First search

Link to comment
Share on other sites

  • Administrators

Yes, we tokenize everything in Aut2Exe and then just read in those tokens when the .exe runs. Even with norma .au3 files running under AutoIt3.exe we tokenize at the start of the script rather than during execution.

Link to comment
Share on other sites

Yes, we tokenize everything in Aut2Exe and then just read in those tokens when the .exe runs. Even with norma .au3 files running under AutoIt3.exe we tokenize at the start of the script rather than during execution.

How is it then that scripts can be decompiled so easily? Wouldn't they have to rebuild the source code from the tokens and reverse polish notation?

ongoing projects:-firestorm: Largescale P2P Social NetworkCompleted Autoit Programs/Scripts: Variable Pickler | Networked Streaming Audio (in pure autoIT) | firenet p2p web messenger | Proxy Checker | Dynamic Execute() Code Generator | P2P UDF | Graph Theory Proof of Concept - Breadth First search

Link to comment
Share on other sites

  • Administrators

How is it then that scripts can be decompiled so easily? Wouldn't they have to rebuild the source code from the tokens and reverse polish notation?

That's exactly what they did. Talk about too much time on your hands :unsure:
Link to comment
Share on other sites

That's exactly what they did. Talk about too much time on your hands :unsure:

S***.

Im having enough trouble making it go forwards, let alone backwards.

Im guessing the only solution is to compile code and not to interpret it.

ongoing projects:-firestorm: Largescale P2P Social NetworkCompleted Autoit Programs/Scripts: Variable Pickler | Networked Streaming Audio (in pure autoIT) | firenet p2p web messenger | Proxy Checker | Dynamic Execute() Code Generator | P2P UDF | Graph Theory Proof of Concept - Breadth First search

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...