News for hackers. Stuff that matters.
Re:LuaRT: Lua programming environment for console, desktop a... by Ciantic on Saturday May 25, 2024 @06:29AM (#40474050)
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

Re:LuaRT: Lua programming environment for console, desktop a... by _samt_ on Saturday May 25, 2024 @08:26AM (#40474572)
LuaRT encapsulates the Windows API around a think object oriented layer for Lua. All objects, properties and functions are organized with Lua modules
Re:LuaRT: Lua programming environment for console, desktop a... by aragonite on Saturday May 25, 2024 @10:41AM (#40475333)
> 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.

Re:LuaRT: Lua programming environment for console, desktop a... by pjmlp on Saturday May 25, 2024 @10:51AM (#40475390)
I know not everyone loves the syntax, but that would be relatively easy with Powershell, or than plain .NET.
Re:LuaRT: Lua programming environment for console, desktop a... by 7thaccount on Saturday May 25, 2024 @03:42PM (#40477322)
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.

Re:LuaRT: Lua programming environment for console, desktop a... by bitwize on Saturday May 25, 2024 @03:58PM (#40477433)

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

    Find-SuccinctNature: Object not found
Re:LuaRT: Lua programming environment for console, desktop a... by pjmlp on Sunday May 26, 2024 @02:17AM (#40480113)
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.

Re:LuaRT: Lua programming environment for console, desktop a... by bitwize on Saturday May 25, 2024 @03:48PM (#40477357)
Lazarus? Tcl/Tk (no, really, it's great)? PyWin32?
Re:LuaRT: Lua programming environment for console, desktop a... by irq-1 on Saturday May 25, 2024 @07:16PM (#40478548)
LuaJIT has access to the system libraries:

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

Re:LuaRT: Lua programming environment for console, desktop a... by vintagedave on Monday May 27, 2024 @11:23AM (#40491596)
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...

Re:LuaRT: Lua programming environment for console, desktop a... by _samt_ on Monday May 27, 2024 @02:52PM (#40493484)
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 ?