AHKv2 - Platform independent?

Discuss the future of the AutoHotkey language
IsNull
Posts: 15
Joined: 01 Oct 2013, 02:45

AHKv2 - Platform independent?

10 Oct 2013, 04:38

This thread is about the question if AHK(v2) should support multiple platforms. Since this is a more technical question and also produces more work, it is merely addressed to current and potential AHK developers.

AHKv2 Language
-The command structure of AHK(v2) has some windows specific commands. (DLLCall (which could be replaced by "LibCall"...), COM, etc.)
-Some commands may be basically platform-independent but not currently flexible/abstract enough. (Window Handling / GUI / Hotkeys)
-Abstraction and generalisation may make the language harder. How to deal with this?

AHKv2 Interpreter
In order to support multiple platforms, the interpreter should be divided into a core part and platform specific separate implementations.
The whole GUI implementation could be replaced by a platform independent implementation (for example QT).
-> Lexikos and fincs may give hints to possible deal breakers here.

For my part, I am currently learning C/C++ in the context of some research/learning projects thus I should be able to contribute even to C++ which I was not able until now. Personally, would volunteer to Qt implementations and OS X specific implementations.

Whats the basic idea?
The core idea would be, that we first define a clear syntax regarding the platform issue. After that, the interpreter must be refactored to allow platform specific extension and the core part must be isolated. Then we can create builds for different platforms. In the beginning, all platforms which are not Windows will only support the very basic AHK syntax, the rest will be ignored. The idea is that we can use this AHK ports very early and more advanced features will be implemented for different operating systems over time.

It is important to see that we have to fix the syntax decision fast, all the other things have time.

What do you think about this? Is it technically feasible? Looking at people which know AHKs source well: How much work do you expect from the basic refactoring, so that we can create platform specific builds?
Zelio
Posts: 278
Joined: 30 Sep 2013, 00:45
Location: France

Re: AHKv2 - Platform independent?

10 Oct 2013, 06:26

I would love but at this moment I am disagree, we have to focus to windows only, half scripts use msdn dllcall and that will split and confuse too much community. We need a strong start and there are already too much job to to do repackage v2. Also Ubuntu start to remplace x11 by mir, linux distribs are not as before... AHK is too much windows dependant, sorry but we have to discard the 5 % non windows users at this day. Just have a look at JNI/JNA for Java or all problem that Poly had with Mono, AHK use advanced features it is not simple like a " I have to compile the interpreter for an other platform". With my unprogrammer experience I already played with these things and I lost my teeth :)

However I am agree with your your logic and your goal, just that it is not realist at this moment. There are so much job to start, do you want to rewrite au3_spy.exe with AHK for the repackage for example
User avatar
tank
Posts: 3122
Joined: 28 Sep 2013, 22:15
Location: CarrolltonTX
Contact:

Re: AHKv2 - Platform independent?

10 Oct 2013, 11:44

there are numerous platform indipendent scripting langages
None of them can do certain things as well as a platform specific scripting language

My oppinion only
We are troubled on every side‚ yet not distressed; we are perplexed‚
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed;
Telegram is the best way to reach me
https://t.me/ttnnkkrr
If you have forum suggestions please submit a
Check Out WebWriter
IsNull
Posts: 15
Joined: 01 Oct 2013, 02:45

Re: AHKv2 - Platform independent?

10 Oct 2013, 13:13

Zelio, I agree that a platform independent language may split the community at some point. However, at least at the syntax level, this decision has to be made now. (Or it won't happen in AHKv2)

You are pointing out the very core problem: Solving automation of window/window manager on an abstract level. Every platform has different window subsystems, Linux is clearly the biggest problem due the pure number of different solutions. Frankly, I am aware of this issue and I am more than aware that it could only be implemented when very lot of coders contribute to it.

My proposal is to simply ignore those problematic parts (strip away window automation and Hotkeys) and provide a basic script core for those systems.
Support for AHKs own guis could however be supported in a general solution (Qt).

Btw: Its funny that you mention JNI, I also thought about a different solution: Using a well known and similar scripting language like AHK and add AHKs functionality to it. I have had a look at Groovy and the possibility to write platform specific JNI wrappers to support the different systems... However, that means the base syntax will be Groovy, which it self is more or less a superset of Java.
User avatar
joedf
Posts: 8940
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: AHKv2 - Platform independent?

10 Oct 2013, 13:52

im in.
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
User avatar
tank
Posts: 3122
Joined: 28 Sep 2013, 22:15
Location: CarrolltonTX
Contact:

Re: AHKv2 - Platform independent?

10 Oct 2013, 14:53

stripping out window controls would greatly reduce the appeal in an enterprise use. in fact it is one of the things that separates it from many other languages
We are troubled on every side‚ yet not distressed; we are perplexed‚
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed;
Telegram is the best way to reach me
https://t.me/ttnnkkrr
If you have forum suggestions please submit a
Check Out WebWriter
IsNull
Posts: 15
Joined: 01 Oct 2013, 02:45

Re: AHKv2 - Platform independent?

10 Oct 2013, 16:30

tank wrote:stripping out window controls would greatly reduce the appeal in an enterprise use. in fact it is one of the things that separates it from many other languages
We won't loose anything, it will work for Windows as it has before. But basic scripts dealing with files / folders (which is very popular in admin jobs) can be written for any platform.
Additionally, we could even write GUI Applications which run on any OS 8-)
User avatar
Gio
Posts: 1247
Joined: 30 Sep 2013, 10:54
Location: Brazil

Re: AHKv2 - Platform independent?

10 Oct 2013, 16:41

What do you think about this? Is it technically feasible? Looking at people which know AHKs source well: How much work do you expect from the basic refactoring, so that we can create platform specific builds?
I don't know it very well, but i've seen it many times and you have tons of Windows API calls in the source. So expect a real lot of work, specially because the source wasn't really written thinking about the idea of eventually porting it to other OSs.
User avatar
joedf
Posts: 8940
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: AHKv2 - Platform independent?

10 Oct 2013, 17:01

True that.
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
guest3456
Posts: 3454
Joined: 09 Oct 2013, 10:31

Re: AHKv2 - Platform independent?

10 Oct 2013, 18:52

i feel like if you want this, just continue with IronAHK

User avatar
joedf
Posts: 8940
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: AHKv2 - Platform independent?

10 Oct 2013, 20:52

guest3456 wrote:i feel like if you want this, just continue with IronAHK
true that :P
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
lexikos
Posts: 9551
Joined: 30 Sep 2013, 04:07
Contact:

Re: AHKv2 - Platform independent?

11 Oct 2013, 02:56

I have no intention of factoring other platforms into the design of v2.

I'd guess that the majority of scripts would not be intended for use on multiple platforms, so there would be little need for the command library to have the same syntax across different platforms. Also, if the current syntax can't be adapted to other platforms, it's probably because the underlying functionality isn't present (in the same form), so scripts using that functionality couldn't be cross-platform.
User avatar
joedf
Posts: 8940
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: AHKv2 - Platform independent?

11 Oct 2013, 06:41

Relax lexikos! Tis funny to find a man that always seems so serious ;)
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
lexikos
Posts: 9551
Joined: 30 Sep 2013, 04:07
Contact:

Re: AHKv2 - Platform independent?

11 Oct 2013, 19:57

I'm seriously relaxed.

Also, it was Friday 5:56 pm when I posted, after a long day of hardly working. How could I not be relaxed? :P
User avatar
joedf
Posts: 8940
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: AHKv2 - Platform independent?

11 Oct 2013, 20:02

@lexikos good :)
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
IsNull
Posts: 15
Joined: 01 Oct 2013, 02:45

Re: AHKv2 - Platform independent?

16 Oct 2013, 04:03

guest3456 wrote:i feel like if you want this, just continue with IronAHK
The problem with IronAHK is that Lexikos seems not to be interested to move his development focus to it or C# in general (which is sad). Two code bases for AHK will be very contra-productive, I guess everyone agrees on that.

Since AHK lives in the spirit of Open Source, a lot of potential volunteers (programmers) may live in the Linux world, so a step into this direction may give technical skilled people (generally that is what Linux users are) access to AHK and more importantly to the community. Lastly, we also lost many people because they switched their OS. Those people might be the minority, but they were the technical skilled ones which had driven the community. I'd say they were much more valuable to this community than the usual gamer on windows.

Frankly, this thread's purpose was only to get a better picture how the AHKlers feel about this. In my own prosperity, I viewed AHK always as a general scripting language and not as a tool. This was probably wrong and based too much of my own wishes than the reality. :roll:
User avatar
joedf
Posts: 8940
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: AHKv2 - Platform independent?

16 Oct 2013, 09:21

@IsNull I agree, when I switch in between Linux, Windows and Mac, I always say to myself:
"oh, why! Oh why! I want ahk to be everywhere...." :( but i do understand that a lot of work will be involved, although it is still possible to make a multiplatform version that is similar in the most respects, but I do not believe that everybody/anybody is willing to do it... (maybe i am hehe ;) )
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
nigelle
Posts: 10
Joined: 23 Oct 2013, 09:58
Location: France

Re: AHKv2 - Platform independent?

23 Oct 2013, 11:53

I have an years old experience that is mid way of "Platform independent" : I use AHK under Windows with a "Platform independent" browser Firefox under Windows. I have described this in the now archived post :
"There is a solution to write scripts for FireFox
Started by nigelle, 08 Jan 2010
http://www.autohotkey.com/board/topic/4 ... l=+nigelle"

As you know, Firefox being "Platform independent" do not uses some Windows interfaces, AHK instructions can access the Title area ( to close or wait for screen but not the text content of it), the keyboard, the mouse and the clipboard. The trick is to replace the dll calls used with IE by JavaScript calls by half a dozen user defined (with Keyconfig extension) short-cuts that AHK "types" on the keyboard. Data in and out of the short-cut use the clipboard.
I think that this experience can be generalized to many other browsers : they use their own interfaces but allow JavaScript and short-cuts.
| Unfortunately I do not know if their title areas can be accessed by AHK as the one of FF (that is needed by many screen instructions).

I am working on a new solution with only 1 short-cut that execute the code given in the clipboard and act on Firefox giving results also in the clipboard. Instead of having a limited set of functions, you can write as many codes as you wish. You need to know the names of the variables/objects or functions defined in Firefox or, what is cross browser and better documented, in the html/DOM part of JavaScript. See :
http://www.w3schools.com/js/js_functions.asp
http://www.whatwg.org/specs/web-apps/cu ... multipage/
Last edited by nigelle on 24 Oct 2013, 05:28, edited 1 time in total.
User avatar
joedf
Posts: 8940
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: AHKv2 - Platform independent?

23 Oct 2013, 17:47

Cool! :)
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]

Return to “AutoHotkey Development”

Who is online

Users browsing this forum: No registered users and 14 guests