-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Portability and future-proofness #24
Comments
Hi.
Could you, please, provide some rough numbers for comparison? My opinion (not that I tell you what to do) is that I'd gladly accept better compatibility (wrt to future) at the cost of, say, 100mb on the disk for a program that I'd use heavily (and I know I would if AHK_X11 would be as comfy to use and as functional as AHK was for me on Windows). Recommended articles: |
Hello @Drugoy, thanks for your input :-)
I think below 10 MB would be very much desirable but I am starting to think this might not be possible, unless I recompile all 89 lib dependencies myself while meticulously eliminating dead third party code. I kind of want to try this, at least with the larger dependencies: libcrypto takes 2.9 MiB, libxml 1.8 MiB and so on. The largest one is libicudata with 25.7 MiB, not yet sure what can be done about it. libgtk alone eats up 7.2 MiB as a dynamic library (statically linking it isn't even documented/supported). This looks like a major, never-ending undertaking, but an interesting challenge to cut it down as much as possible, e.g. by putting all dependencies as sub projects in this repository, setting up tests and a build pipeline and then aggressively removing code. I wonder if this is an approach that has ever been taken by another Gtk application author before, or maybe my understanding of it all is flawed anyway. But some sub-dependencies such as libxml may be completely removable after all. It seems ahk_x11 is a rather special case due to the desired script compilation / portability feature. By all means, there's more important things to do such as wayland support or adding the remaining missing features to the language.
You are right, I actually meant (read: confused it with) AppImage. I read more about it such as the links you provided and it seems like the best solution for now. I got it t work with linuxdeploy 28 MiB seems like an okay compromise for now, even though it's only this small because the internal components are compressed. I'm still not sure how installer (without appimaged daemon) and script compilation will fit in there, but surely somehow they will, so I'm expecting to file a single |
Migration to AppImage now done. Everything went reasonably well, even though there can apparently be problems with some custom GTK themes? linuxdeploy/linuxdeploy-plugin-gtk#39 My plan would now be to stay with Gtk 3.x forever, it's mostly preferrable to Gtk 4 imo Reducing the binary size is still on my far-off to do list, but since the main problem here is mostly resolved, I'll close this |
I would like ahk_x11 (and consequently, all compiled scripts made from it) to be eternally compatible with all sorts of Linux distributions, for as long as possible, while also staying as small as possible in terms of size. I'd like to think of Win32 API being a role model here: An AutoHotkey script compiled in 2002 on Win95 will still run perfectly fine on a Windows 11 machine. For this very project, I consider this as a notable goal too because it will often not be shipped from your distribution, but as a locally shared executable file, and thus everything needs to be future-proof as much as possible.
Now in the Linux world, things are much more complicated, thanks to the fragmentation of modules. As far as I can see, there are two options:
Control
* commands (release coming soon). This can be decoupled though, not sure about static linking once againRight now I would prefer to build one big binary where everything (including x11 and gtk) is linked statically so that the only dynamic dependencies are the kernel and libc, apparently the only dependencies led by sane people. I don't have much notable experience with all of this, however (as you may have been able to figure out), so this really needs some more thought input and/or preferable some advice too. The fact that AHK_X11 is built with Crystal and not C/C++ should not matter, the usual constraints are all the same, and external libraries can be bound to Crystal code.
The text was updated successfully, but these errors were encountered: