Sign in to follow this  
Followers 0
IchBistTod

Creating an autoit compiler in autoit

11 posts in this topic

#1 ·  Posted (edited)

Well i was reading up on a post in the example scripts forum that used ASM and someone said ti would be cool to have a way to compile autoit code (turn it into ASM and link it).

This would be very nice, as it would make AutoIt programs a LOT faster.

I started working on a model that uses autoit to replace text(convert)autoit to ASM, create a file, and link it(via the A86 linker).

(I figured autoit would be the best language to convert itself with, because it contains so many functions making string manipulation easier)

It only works with consolewrite()(with line breaks being \n) so far, example usage is in the compiler.au3 file.

I plan to expand this library vastly, and I appreciate help from anyone that knows ASM.

Files are attached. To test extract all files, run "compiler.au3" and then execute the "file.exe" in a cmd window.

Advantages:

Faster(pure 32 bit ASM)

Smaller(42 bytes!)

Note:

I know this code is not written the best it could be, however I just started learning ASM yesterday, and i wrote this around 3AM.

Any improvements/additions highly appreciated.

comments please.

compiler.zip

Edited by IchBistTod

[center][/center][center]=][u][/u][/center][center][/center]

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Some thoughts:

- Why bother compiling to ASM when you can compile to C++ and thén compile the C++ code? ( and re-use the AutoIt source code )

- Why write the compiler in AutoIt when you can probably re-use a lot of parts from the AutoIt C++ interpreter?

That aside, the project can probably be done as you see it being done. I don't think there will be much response from the developers, because this and many similar issues have been discussed before and all feature requests have been rejected.

Edited by Manadar

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

1)as odd as this sounds, I find C++ more difficult than ASM, seeing as I am a non-oo programmer

2)linking ASM created much smaller file sizes, with much more control over the hardware than C++ allowing for additional functions that control the hardware to be added to autoit

3)ASM is faster

4)writing the compiler in autoit is a good idea because it alows for Rapid Application Development, without any real loss because all its doing is converting strings.

5)Using an ASM linker is simpler/faster then using a C++ linker

6)ASM is just plain much better than C++ power wise.

If some of that didn't make sense or was repetitive I'm sorry, its 3:56AM

And if the developers do not respond, oh well, if the autoit community wants a real compiler bad enough, they will use this as inspiration to work together to build one, as the developers will not, and I have full faith this can be done, but because of the complexity, I KNOW it will take many people to complete..

Random note:(I guess this is basically taking the autoit syntax and compiling it which means that any function could be added in really, that it doesnt have to exist in autoit, so thats useful as well)

ps: did you try it out??

Edited by IchBistTod

[center][/center][center]=][u][/u][/center][center][/center]

Share this post


Link to post
Share on other sites

Manadar, ASM is fast and you know that.

...

What this means? Really.

The way IchBistTod put things this most definitely goes nowhere. That must be said. This is not the way.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

I am looking into a second option, converting to C(not C++) then compiling. However I think this option should be a plan B only if the desired functionality can not be acquired with ASM, and if it comes to that point, i know there are ways to use ASM inline with C so all existing procedures could be transfered this way.

And I really do not appreciate you saying its doomed to fail, or this is definitely not the way. Not to be a smart ass but I have not seen anyone else even start such a project, so I would like to know why the way I "put things... goes nowhere". I know I am new to these forums, but I am not new to programming.


[center][/center][center]=][u][/u][/center][center][/center]

Share this post


Link to post
Share on other sites

so I would like to know why the way I "put things... goes nowhere".

Yo can't compile to 16-bit DOS COM and say it will go somewhere. That's few decades behind us.

(Don't mention proofs of concepts to me)

But, I'll be the first to say "Well done!" if it starts going somewhere, no worries.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

This is... temporary.

Naturally I am looking for a 32 bit compiler.

I wouldn't even say its a proof of concept, just s starting point that I plan to expand on.

And Using C is plan B, and using C++ may even be plan C

I will just have to see how things work out.

Edited by IchBistTod

[center][/center][center]=][u][/u][/center][center][/center]

Share this post


Link to post
Share on other sites

This is... temporary.

Naturally I am looking for a 36 bit compiler.

I wouldn't even say its a proof of concept, just s starting point that I plan to expand on.

And Using C is plan B, and using C++ may even be plan C

I will just have to see how things work out.

Do you know what's the atomic number of germanium?

... just being curious.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

Its 32.... why do you ask?

I see... type, sorry. *fixes*

Edited by IchBistTod

[center][/center][center]=][u][/u][/center][center][/center]

Share this post


Link to post
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
Sign in to follow this  
Followers 0