Keysharp - the resurrection of IronAHK

Talk about things C#, some related to AutoHotkey
mfeemster
Posts: 14
Joined: 24 Apr 2020, 18:30

Keysharp - the resurrection of IronAHK

13 Jun 2020, 00:15

I am a senior developer myself with mostly Windows experience, a little bit of Linux, and no Mac OS experience.

From about 2010 to 2015, several people here worked on a project called Iron AutoHotKey which was a complete re-write of AHK in C# with the aim of being cross platform.

Sadly, the project was discontinued and the author is nowhere to be found.

The good news is that his source code is available in an archived repo on github.

I've downloaded it, upgraded the project files to Visual Studio 2019, reorganized and cleaned up a bunch of the code, started a new project based on it, and have it successfully building running on Windows and am able to debug it.

He did a ton of work which I am grateful for, I wouldn't have known where to begin had I started from scratch on my own.

With that baseline code, I can see where he implemented some basic code for doing things on Linux, but have not run that part yet, so I don't know if it will work. I am focusing on Windows for now.

I can also see a lot of empty parts that were left blank.

I am going to spend time inspecting and documenting just how much of the full AHK spec he implemented.

Once I get it all working on Windows, I will try Linux, then maybe Mac if I can get some assistance from Mac developers. IronAHK has already set up a good design for this. I will need to enlist help from volunteers for the latter two OSes.

I think now would be an ideal time to do it because Microsoft is really pushing hard to have C# be a dominant language for all major OSes.

Also, C# is an ideal language for implementing another scrpting language like AHK. C# supports runtime code generation which is very exciting. The AHK script code will get compiled into a new executable at runtime. That executable can also be saved and ran on its own for scripts which seldom change. It can also show the C# code that gets generated from the AHK code, for those who are interested in seeing it.

IronAHK used mono for its development work because mono has always been a cross platform version of .NET.

In recent times, Microsoft has made huge strides in being cross platform. Their .NET core, and .NET 5 release coming later this year, attempt to be cross platform. Sadly, in order to achieve that, they took a "lowest common denominator" approach and left out huge parts of the functionality of the regular .NET framework. IronAHK makes heavy use of those parts, such as the Keys enum, the Application object and various GUI components. The bad news is that since .NET core does not support these features, it can't be used for this project on non-Windows OSes. The good news is that mono implements these features. That provides the rather compelling scenario of writing GUI code in C# on linux.

For Windows, if one wants to use .NET (core) 5 but also have access to the standard libraries mentioned above, Microsoft supports making a hybrid sort of project. I'll be taking this approach for the windows release.

So to summarize:

Windows: .NET (core) 5 + Winforms

Linux/Mac: mono

During this development effort, I don't want to let the perfect be the enemy of the good. Just because some obscure feature might not work on one OS, doesn't mean we shouldn't work on the project at all. We will do our best.

I estimate the initial phase of the project will be a minimum of two years' worth of work. I'm three months into it so far.

The project will be hosted here:

https://bitbucket.org/mfeemster/keysharp/src/master/

Most of the discussion regarding bugs/features will be on the repo instead of this forum, because it offers better bug/feature traceability.

There is currently nothing at that repo other than a readme because I just wanted to reserve the catchy name ahead of time. I will wait until I have something working reasonably well before uploading my code.

Thanks,
Matt
burque505
Posts: 1285
Joined: 22 Jan 2017, 19:37

Re: Keysharp - the resurrection of IronAHK

02 Jul 2020, 14:52

:bravo: Really looking forward to it.
Regards,
burque505

Return to “C#”

Who is online

Users browsing this forum: No registered users and 5 guests