Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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



LuaRT encapsulates the Windows API around a think object oriented layer for Lua. All objects, properties and functions are organized with Lua modules


> 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

Also see 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.


I know not everyone loves the syntax, but that would be relatively easy with Powershell, or than plain .NET.


It'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.


    PS C:\> Find-SuccinctNature PowerShell -ComparedTo Bash

    Find-SuccinctNature: Object not found


As someone that has DevOps as part of job activities, it is quite alright.

Plus if performance matters, rewriting the critical part in a .NET language is always an option.


Why 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-dow...


Maybe 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 ?


Lazarus? Tcl/Tk (no, really, it's great)? PyWin32?


LuaJIT has access to the system libraries:

https://luajit.org/ext_ffi_tutorial.html#sleep




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: