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
576 replies to this topic
polyethene
  • Administrators
  • 5511 posts
  • Last active: Yesterday, 11:38 PM
  • 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
  • 6838 posts
  • Last active: Yesterday, 11:02 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
  • Administrators
  • 5511 posts
  • Last active: Yesterday, 11:38 PM
  • 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.

HotKeyIt
  • Moderators
  • 6838 posts
  • Last active: Yesterday, 11:02 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
  • 1943 posts
  • Last active: Apr 08 2012 06:07 AM
  • 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.

IsNull
  • Moderators
  • 990 posts
  • Last active: Mar 03 2014 08:28 PM
  • 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
  • Administrators
  • 5511 posts
  • Last active: Yesterday, 11:38 PM
  • 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.

IsNull
  • Moderators
  • 990 posts
  • Last active: Mar 03 2014 08:28 PM
  • 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
  • 11 posts
  • Last active: Mar 13 2014 09:23 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
  • Administrators
  • 5511 posts
  • Last active: Yesterday, 11:38 PM
  • 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.

tic
  • Members
  • 1917 posts
  • Last active: Today, 02:31 AM
  • Joined: 22 Apr 2007
This script doesnt work for me:

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


polyethene
  • Administrators
  • 5511 posts
  • Last active: Yesterday, 11:38 PM
  • 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.

tic
  • Members
  • 1917 posts
  • Last active: Today, 02:31 AM
  • Joined: 22 Apr 2007
Good work sir. You gonna remove the black window, or keeping that for the time being for debugging?

polyethene
  • Administrators
  • 5511 posts
  • Last active: Yesterday, 11:38 PM
  • 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.

jethrow
  • Moderators
  • 2805 posts
  • Last active:
  • 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!