3 ms·
I'm always looking for alternatives to AutoHotkey and small C WINAPI programs I've written. Rust doesn't quite cut it, even with Microsoft's windows-rs library
by Ciantic 2y ago
I'm always looking for alternatives to AutoHotkey and small C WINAPI programs I've written. Rust doesn't quite cut it, even with Microsoft's windows-rs library using the WinAPI functions is worse than it was with plain C. This is because you have to hunt the right libraries and features to import, it's surprisingly time-consuming.
Excited to look how LuaRT exposes WinAPI, my ideal would be one global namespace where you can easily auto-import all the normal functions. Microsoft has made it somewhat easy for library authors to generate the externs with their relatively new Win32metadata package: https://github.com/microsoft/win32metadata https://github.com/microsoft/win32metadata
- _samt_ 2y agoLuaRT encapsulates the Windows API around a think object oriented layer for Lua. All objects, properties and functions are organized with Lua modules
- aragonite 2y ago> I'm always looking for alternatives to AutoHotkey and small C WINAPI programs I've written. Rust doesn't quite cut it ... You can access the win32 api in Node via Koffi. Here's a MessageBox example: https://koffi.dev/start#for-windows https://koffi.dev/start#for-windows Also see node-activex (https://github.com/durs/node-activex https://github.com/durs/node-activex) AHK2's syntax is also very close to Javascript these days. It's quite pleasant to use and the C++ source is very well-documented.
- deleted 2y ago[deleted]
- pjmlp 2y agoI know not everyone loves the syntax, but that would be relatively easy with Powershell, or than plain .NET.
- 7thaccount 2y agoIt's not just the syntax. Powershell is just ridiculously slow for doing things like iterating through text files. Don't get me wrong... powershell is really nice for some kinds of IT work, but I've had lots of trouble with it. I love the succinct nature, but it takes a lot of effort to get a line of code to do what you need it to do...even after you've spent a LOT of time with the language.
- bitwize 2y agoLazarus? Tcl/Tk (no, really, it's great)? PyWin32?
- irq-1 2y agoLuaJIT has access to the system libraries: https://luajit.org/ext_ffi_tutorial.html#sleep https://luajit.org/ext_ffi_tutorial.html#sleep
- vintagedave 2y agoWhy not Delphi? It's been the goto for quick Windows apps for a couple of decades. Lots of functionality inbuilt. There's a free Community Edition: https://www.embarcadero.com/products/delphi/starter/free-download/ https://www.embarcadero.com/products/delphi/starter/free-dow...
- _samt_ 2y agoMaybe because Lua is an easy and interpreted programming language for beginners ? Maybe such a big solution is not needed for tiny sized projects ? Maybe we don't need fatty big executables for the ease of deployment ?