I don't know if this goes against the subforum's rules but this is a question about an existing app; I'd like to know if there's any interest in it.
I wrote it for myself while hacking away at a "fuzzy" imagesearch implementation, because I missed features from the old app that no longer seems maintained. Despite that, it's pretty robust and usable. I got carried away having furn with AHK v2, it's really a nice language to use now.
Anyway, if there's interest, I'll clean up the code a bit and make the repo public.
https://github.com/martona/ahkmcodegen [Link to repo added by moderator from OP’s later post.]
New mcode generator with some cool features
Re: New mcode generator with some cool features
I’d be interested, and you really need to have the source code public for the thread to stay on this sub-forum.
Re: New mcode generator with some cool features
Alright! I'll clean up the code and see if I can edit the github link into the OP. Should be done by tomorrow.
Re: New mcode generator with some cool features
Github repo:
https://github.com/martona/ahkmcodegen
I don't seem to be able to edit the OP and put the link there.
https://github.com/martona/ahkmcodegen
I don't seem to be able to edit the OP and put the link there.
-
- Posts: 43
- Joined: 11 May 2020, 20:45
Re: New mcode generator with some cool features
Nice, I see you mention creating DLLs, that's something I've been interested in, but haven't found a guide guide on creating one that can be used with AHK, do you know about one?marton wrote: ↑15 Dec 2023, 04:55Github repo:
https://github.com/martona/ahkmcodegen
I don't seem to be able to edit the OP and put the link there.
Re: New mcode generator with some cool features
I haven't made one for AHK but it should be as simple as grabbing Visual Studio Express (what a misnomer, it's a snail of an app), making sure it installs the C/C++ devtools, creating a new DLL project, adding a function to it with and then calling it from AHK with DllCall.Marium0505 wrote: ↑15 Dec 2023, 06:39Nice, I see you mention creating DLLs, that's something I've been interested in, but haven't found a guide guide on creating one that can be used with AHK, do you know about one?
.net DLLs are a different animal, you can't call them with DllCall. You can access them through COM though, and I'm pretty sure I saw COM interoperability stuff on this forum. The reason I'm bringing that up is because it's potentially a much less frustrating experience than dealing with C/C++ code in DLLs, especially if you're new.
Re: New mcode generator with some cool features
Have you looked any at the work we're doing on the MCL Machine Code Library for AHK? A brief feature set:
* Supports C and C++ (and includes some very trimmed down hand-written replacements for some of the standard headers)
* Supports 32 and 64 bit
* Includes an AutoHotkey-based Linker
* Allows exporting multiple functions to AutoHotkey
* Allows exporting multiple global variables to AutoHotkey
* Generates a wrapper with all the DllCalls/NumGet/NumPut calls pre-bound with the offsets and types
* Allows importing functions from external DLLs into the C/C++ code, such as from the Windows API or any other DLL you have laying around
* Generates standalone AutoHotkey script with the compiled machine code and wrappers, so you can include compiled code without including the MCL library.
There's a demo of MCL available on the Wiki, where you can compile and run C/C++ code entirely in the browser without having to install your own compiler:
The goal of the project is to allow you to build whatever C/C++ integrations into AHK that you want, but without ever having to provide a separate DLL from your script file. As an example, the cJson library was written via MCL. It uses AHK's objects' COM interfaces to read and write AutoHotkey objects from the machine code blobs, with a high level of performance. COM and mcode can live together in harmony![Smile :)](./images/smilies/icon_e_smile.gif)
* Supports C and C++ (and includes some very trimmed down hand-written replacements for some of the standard headers)
* Supports 32 and 64 bit
* Includes an AutoHotkey-based Linker
* Allows exporting multiple functions to AutoHotkey
* Allows exporting multiple global variables to AutoHotkey
* Generates a wrapper with all the DllCalls/NumGet/NumPut calls pre-bound with the offsets and types
* Allows importing functions from external DLLs into the C/C++ code, such as from the Windows API or any other DLL you have laying around
* Generates standalone AutoHotkey script with the compiled machine code and wrappers, so you can include compiled code without including the MCL library.
There's a demo of MCL available on the Wiki, where you can compile and run C/C++ code entirely in the browser without having to install your own compiler:
The goal of the project is to allow you to build whatever C/C++ integrations into AHK that you want, but without ever having to provide a separate DLL from your script file. As an example, the cJson library was written via MCL. It uses AHK's objects' COM interfaces to read and write AutoHotkey objects from the machine code blobs, with a high level of performance. COM and mcode can live together in harmony
![Smile :)](./images/smilies/icon_e_smile.gif)
![Image](https://geekdude.io/static/kofi_bg_tag_dark.png)
![Image](https://geekdude.io/static/ahkwiki2.png)
![Image](https://geekdude.io/static/v2course2.png)
![Image](https://geekdude.io/static/icons/CQT.png)
![Image](https://geekdude.io/static/discord-mark-blue.png)
Re: New mcode generator with some cool features
I haven't seen it, but it's awesome. I'll be spending some time with.
Just out of curiosity, is there a reason you guys process relocations? I know it sounds like a hack, but wouldn't removing the .section statements from the intermediary .s file get you the same results? Unless ofc you're working with multiple object files, but are you?
Just out of curiosity, is there a reason you guys process relocations? I know it sounds like a hack, but wouldn't removing the .section statements from the intermediary .s file get you the same results? Unless ofc you're working with multiple object files, but are you?
Re: New mcode generator with some cool features
According to Cloaker, who wrote the code for linking and relocations, "clever solutions are too easy and not enough fun" and "I think I did want multiple object files originally before I realized that those objects are better off as dynamic objects".
Also, just a heads up: the README, examples, and tests in the v2 library's repository are not up to date. The wiki page has functional examples for the v2 library.
Also, just a heads up: the README, examples, and tests in the v2 library's repository are not up to date. The wiki page has functional examples for the v2 library.
![Image](https://geekdude.io/static/kofi_bg_tag_dark.png)
![Image](https://geekdude.io/static/ahkwiki2.png)
![Image](https://geekdude.io/static/v2course2.png)
![Image](https://geekdude.io/static/icons/CQT.png)
![Image](https://geekdude.io/static/discord-mark-blue.png)
Return to “Scripts and Functions (v2)”
Who is online
Users browsing this forum: XMCQCX and 53 guests