Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

IronAHK (alpha): cross platform .NET rewrite of AutoHotkey


  • Please log in to reply
581 replies to this topic
polyethene
  • Members
  • 5519 posts
  • Last active: May 17 2015 06:39 AM
  • Joined: 26 Oct 2012
IronAHK is a complete rewrite of AutoHotkey in C# for .NET and Mono. It works like a real compiler by producing optimised bytecode. Since like Java, the .NET runtime is available on all operating systems, mobile devices and game consoles, compiled scripts will run the same everywhere without modification.


Download (nightly): Installer (x64), OS X Bundle, Binaries, Portable, Source

Any previous pre-release versions must be uninstalled first. The nightly versions contain the latest bleeding edge binaries built against the development source and should only be used for testing. Also see: releases, status, changelog.


Benefits to existing AutoHotkey users:
[*:3la85pev]All Unicode
[*:3la85pev]Runs natively as 32 bit or 64 bit depending on your hardware
[*:3la85pev]Write once, run everywhere - your same compiled scripts will run on every platform with a .NET compatible runtime
[*:3la85pev]No source code is attached to compiled assemblies, the resulting binary resembles nothing like your original syntax and cannot be decompiled
[*:3la85pev]Permissive BSD license, freely use any part in your commercial or closed source software
[*:3la85pev]Modular design means you can use the command library or host the script engine in your own applications
[*:3la85pev]Arrays and objects with JSON syntax
[*:3la85pev]An active and open development cycle
[*:3la85pev]... and more!Bugs and suggestions are welcome on our issue tracker.

Follow developments on twitter @ironahk or GitHub.


Posted Image Posted Image
Same script running on Windows 7 and Xubuntu Karmic.


Finally, thanks to the following people for their help in this project:
[*:3la85pev]Tobias, the co-developer responsible for Unix ports and the CIL compiler
[*:3la85pev]IsNull for key contributions to the command library
[*:3la85pev]DerRaphael for testing and bug reports
[*:3la85pev]infogulch for many useful suggestions
[*:3la85pev]Chris from autokey for X11 advice
[*:3la85pev]Slav2Gruzdev for submitting patches with improvements to the command library
[*:3la85pev]Chris for AutoHotkey

HotKeyIt
  • Moderators
  • 7439 posts
  • Last active: Jun 22 2016 09:14 PM
  • Joined: 18 Jun 2008
Hi Titan, thanks for your great work, this looks very promising 8)

Are there any docs? Which commands do work and what is difference to original AHK? How to compile a script?

What compiler can I use to compile source code?

Would you like to receive feedback on bugs/problems in this thread?

polyethene
  • Members
  • 5519 posts
  • Last active: May 17 2015 06:39 AM
  • Joined: 26 Oct 2012
To run a script just drag and drop any file onto IronAHK.exe. At the moment you can only compile a script by command line, run IronAHK.exe /out compiled.exe script.ahk. In future versions there will be an installer with file associations and GUI compiler to make this easier.

Documentation of the commands is a priority for the 0.9 release and there isn't a list of what works and what doesn't, but you can find some information on <!-- m -->http://www.ironahk.n...ommands/msgbox/<!-- m --> (replace msgbox with any command name).

Bug reports, suggestions and comments are more than welcome on this thread.

autohotkey.com/net Site Manager

 

Contact me by email (polyethene at autohotkey.net) or message tidbit


HotKeyIt
  • Moderators
  • 7439 posts
  • Last active: Jun 22 2016 09:14 PM
  • Joined: 18 Jun 2008
SetBatchLines seems to have no effect.
Crashes when invalid command specified.
"`n" does not produce new line.

Thats it for now.

Tuncay
  • Members
  • 1945 posts
  • Last active: Feb 08 2015 03:49 PM
  • Joined: 07 Nov 2006
Sounds very good. The power of open source. 8) Something we all wanted to have. GREAT. After DLL, Unicode, Lexikos additions we have finally cross platform version. Thanks and keep the work.

Would the code be executed faster or slower in general logic? Bytecode is halfwise interpreted. But Ahk do once compile full script in memory before execution.

No signature.


IsNull
  • Moderators
  • 990 posts
  • Last active: May 15 2014 11:56 AM
  • Joined: 10 May 2007
As there is currently no support for GUIs, its hard for me to find scripts for testing purposes.

I've written some examples; This one doesn't work;

loop, 10
{
res .=  func(44,a_index) . "-"

}
msgbox % res
return

func(a,b){
	return, a ** b
}




but, this works:

var := 33 ** 12
msgbox % var 

thanks for your hard work ;)

polyethene
  • Members
  • 5519 posts
  • Last active: May 17 2015 06:39 AM
  • Joined: 26 Oct 2012

SetBatchLines seems to have no effect.

I marked SetBatchLines as an obsolete command because I saw no compelling reason to have artificial delays between every line. Using sleeps and changing process priority gives more precise control of CPU usage. It also poses a design challenge, in AutoHotkey each line is executed one by one but in IronAHK every token is converted to bytecode with no reference to their originating line number; consequently, A_LineFile and A_LineNumber are also unsupported. The long term plan is to replace these with more useful debugging features and real threading with asynchronous background workers.

Crashes when invalid command specified.
"`n" does not produce new line.

Thanks, both bugs will be fixed in the next release.

Would the code be executed faster or slower in general logic?

At the moment the compiler does no optimisations whatsoever, so your code may perform equally or even slower than AutoHotkey. In my preliminary tests with full optimisation IronAHK can perform arithmetic operations 35-40x faster than AutoHotkey.

As there is currently no support for GUIs, its hard for me to find scripts for testing purposes.

Sorry, I should have put more emphasis on documenting broken or unsupported commands. I will make this a priority for the next release so everyone knows what scripts they can and cannot use, just until version 1.0 is ready.

I've written some examples; This one doesn't work;

Both examples work for me, Tobias tested them too and said it gives the expected results.

autohotkey.com/net Site Manager

 

Contact me by email (polyethene at autohotkey.net) or message tidbit


IsNull
  • Moderators
  • 990 posts
  • Last active: May 15 2014 11:56 AM
  • Joined: 10 May 2007

Both examples work for me, Tobias tested them too and said it gives the expected results.

I tried again, and it succedes... Actually, I have no idea why it works now and yesterday not. It failed every time, and it was exactly the same source... also other scripts were working as well, but this one not.

strange.

newuser
  • Members
  • 12 posts
  • Last active: Sep 04 2014 07:30 AM
  • Joined: 30 Dec 2009
Titan,

Can I know which version of dotnet framework is supported in IronAHK since Im currently using framework 2.0sp1 but the compiler came out with a blank box window if I drag the scite testsuite.ahk script into it. :?:

polyethene
  • Members
  • 5519 posts
  • Last active: May 17 2015 06:39 AM
  • Joined: 26 Oct 2012
.NET 2.0 or greater is the requirement, so what you have is fine. The problem you are describing is a bug which has been fixed for the next version.

autohotkey.com/net Site Manager

 

Contact me by email (polyethene at autohotkey.net) or message tidbit


tic
  • Members
  • 1934 posts
  • Last active: May 30 2018 08:13 PM
  • Joined: 22 Apr 2007
This script doesnt work for me:

Loop, % -1+3
	MsgBox, %A_Index%


polyethene
  • Members
  • 5519 posts
  • Last active: May 17 2015 06:39 AM
  • Joined: 26 Oct 2012

This script doesnt work for me:

Thanks, fixed in 9cd748d2. The parser was confused between binary subtract and unary minus operators.

autohotkey.com/net Site Manager

 

Contact me by email (polyethene at autohotkey.net) or message tidbit


tic
  • Members
  • 1934 posts
  • Last active: May 30 2018 08:13 PM
  • Joined: 22 Apr 2007
Good work sir. You gonna remove the black window, or keeping that for the time being for debugging?

polyethene
  • Members
  • 5519 posts
  • Last active: May 17 2015 06:39 AM
  • Joined: 26 Oct 2012
I am so used to working in command line I had actually forgot about that, but thanks for reminding me, it will be removed in v0.7.

autohotkey.com/net Site Manager

 

Contact me by email (polyethene at autohotkey.net) or message tidbit


jethrow
  • Moderators
  • 2854 posts
  • Last active: May 17 2017 01:57 AM
  • Joined: 24 May 2009
I noticed the following about MsgBox:
MsgBox, 0, Title, Message ; diplays msgbox with no title, and the message is the first param ( 0 )

MsgBox, 0, Title, Message, 1 ; displays correctly, but doesn't timeout

MsgBox, 0, , Message, 1 ; displays msgbox with no title - should default to script name

Thanks again for the work!