Re: Keysharp - the resurrection of IronAHK
Posted: 11 Jun 2021, 11:28
Watching from the sidelines and applauding your efforts, @mfeemster!
Let's help each other out
https://www.autohotkey.com/boards/
https://www.autohotkey.com/boards/viewtopic.php?f=97&t=77248
I would like to offer a little push back on this or to at least get greater clarification, because a power of prototypes is in allowing the use of objects without Classes. In scripting languages where this has been implemented, it has been seen as a plus. JavaScript and Lua are 2 notable examples, along with AutoHotkey, as it allows for more choice (to either use objects with Classes or not) and greater simplification of programs.
Prototype-based object use is quite pervasive in AutoHotkey, it might not seem so on the surface because object use is so simplified (a credit to its design). Many AHKers can just be thinking of associative arrays, and not making the distinction that there is a bit more going on. I'm bringing this up, as it's not clear how the C# Class-based object model would mesh with the Prototype-based AutoHotkey model. I'm sure there are all kinds of workarounds, but maybe it's something to look at. Since there is no published Alpha of Keysharp yet, just kind of curious how it would be handled.mfeemster wrote: ↑11 Jul 2021, 20:26I don't understand the concept of "objects without classes". Can you explain it?
Since it's a C# program, I'll just use the C# object model.
It's a question of why people use AHK. Do they use it to do obscure, esoteric object tinkering? Or do they use it to automate various desktop tasks?
Code: Select all
thing := {}
thing.foo := "bar"
thing.test := Func("thing_test")
thing.test()
thing_test(this)
{
MsgBox % this.foo
}
Code: Select all
other := {}
other := thing
other.test()
Code: Select all
Data := MouseGetPos()
MsgBox, % Data.X " " Data.Y " " Data.Win " " Data.Ctrl
MouseGetPos(Options := 3)
{
MouseGetPos, X, Y, Win, Ctrl, % Options
Return {X: X, Y: Y, Win: Win, Ctrl: Ctrl}
}
@mfeemster - coincidently I've stumbled over FindText yesterday. Probably of interest as an alternative for ImageSearch(), or its functionality can be incorporated into it (sooner or later?)??I took a month and a half off from this project, so it took me a while, but I've finished the Screen function. ImageSearch() was the hardest one
The goal should be to make it as close to AHK as possible, not to add bloat and coding effort by building in people's various favorite tools.
Not sure, it'll depend on the specific part you're benchmarking. In my guesstimation, it'll probably run a little bit slower.
So it would be possible to see C# equivalent of AHK script and modify/optimize it? I'm asking coz although AHK speed is more than enough >99% of the time for me, there are few performance-sensitive functions that I'm trying to deal with.(KeySharp) can also show the C# code that gets generated from the AHK code
Thanks for the background info. Yes, Keysharp takes in AHK script code, generates C# code, compiles and runs it. You'll be able to see the code, but optimization won't do you much good. The bulk of the execution time will be spent within the Keysharp library. The code that gets generated just mostly calls library functions. Regardless, you'll be able to see it if you want.serg wrote: ↑07 Sep 2021, 06:19@mfeemster
Thanks! I would be glad to test speed of Key# (although I'm not much of a coder).
Regarding performance, the guy who was developing IronAHK mentioned once that in his tests IronAHK was able to do math operations 30-40 times faster than AHK, as I understand he was talking about compiled scripts, since IronAHK was compiling to machine code, unlike AHK. And since your project is similar and based on IronAHK, I'm curious as to why Key# would differ in that regard from IronAHK.
So it would be possible to see C# equivalent of AHK script and modify/optimize it? I'm asking coz although AHK speed is more than enough >99% of the time for me, there are few performance-sensitive functions that I'm trying to deal with.(KeySharp) can also show the C# code that gets generated from the AHK code
In any case, thank you for your valuable work mfeemster, AHK for Linux is what many of us have been waiting for a long time