• Announcement: Lua.org now officially recommends this forum as a meeting place for the Lua community

Announcing WinLua Toolchain Installer - Release 2012a (1 Viewer)

dinsdale247

Moderator
Staff member
Community Patron
Creator of WinLua
Joined
Nov 17, 2020
Messages
93
Reaction score
32
Location
Victoria BC
Website
winlua.net
1608101865500.png

Good news everyone! WinLua Toolchain 2012a is ready.

WinLua Toolchain is now ready for general distribution. Winlua is a Windows development environment dedicated to Lua and C (and begrudgingly C++). WinLua Toolchain provides a (nearly) complete development environment in a windows MSI installer:
  • Lua - Lua 5.3 currently
  • LuaRocks - A Lua module package manager
  • WinLua Compiler (WLC) - A cutting edge C/C++ compiler
  • Sol3 C++ bindings for Lua
  • LibreSSL Encryption Library
  • and the XMake build system
With WinLua, there is no configuring LuaRocks or trying to figure out which C compiler to use. If you need to use Lua, drop to a powershell window and type `lua`, or open the Windows menu and type `lua`. Need a Lua module? LuaRocks is already set up with the proper paths to pull down a rock and compile it if necessary[1].

Everything in the WinLua Toolchain package comes in around 600 MB installed. The smallest comparable Visual Studio tool set is 6000+Mb.

Why WinLua?

The drive behind creating WinLua was the abysmal state of Lua on Windows. Prior to this forum, there was no place to find information about all the different ways to install Lua and the components that one needs to work in a Lua environment. That drove me to create a proper Windows installer for Lua. I soon found that installing LuaRocks was tricky and I was dependent on Visual Studio which is 10 - 20 Gigabytes. I started looking into mingw and couldn't make heads of tails of what tools I did or did not need (mingw, cygwin, mysys2, mingw32 vs mingw64). All that frustration and effort drove me to find a modern C/C++ compiler and create a complete environment that works on Windows without any other overhead or baggage[2]. My pain, your gain.

Who Is The Target Audience? You!

WinLua Toolchain has been created for beginners and advanced developers alike. The hope is beginners won't know what WinLua Toolchain provides because they will not experience the pain of piecing together an environment. Experienced developers will appreciate the simplicity of the MSI installer and the sublime power of the build system - xmake.

Ya, We Need To Talk About XMake...

The most exciting tool in my opinion is XMake. XMake is a Lua based build system and library repository. It has a compelling, easy syntax that is reminiscent of CMake without all the evil that comes with the CMake meta build philosophy. XMake is a fully functional build tool that works almost seamlessly with the WinLua Compiler (WLC) But best of all: it's SMOKING FAST. XMake is the ideal build solution for Lua developers on Windows because it harnesses all the best parts of our favorite language: Lua!

I will be writing about XMake in the future because it makes building C on Windows very pleasant. Watch this space...

Where To Start?

Head on over to WinLua - Lua Plus Tools for Windows. There are three installers:
  • Lua Only installer- Lua 5.3, Lua Filesystem and Sol 3. This is a 3 MB download if you just really need Lua.
  • WinLua Toolchain - The full kit. 530 Mb download.
  • LibreSSL - Current LibreSSL encryption library build. LibreSSL is not easily accessible on Windows so I decided to create a release.
Download WinLua Toolchain and just run the MSI installer and your ready to go. If you'd like to see a demo of WinLua at work, check out my Lua/C++ bindings articles: Part 1 and Part 2.

What Is Still Missing?

While there is a working debugger, it's command line only (As in gdb command line). The "machine interface" bindings didn't work properly so you can't debug in Visual Studio Code or KDevelop yet. I am working on that and am hoping to have lldb-mi built with Python bindings in the springtime. However, the compiler is perfectly functional and works for compiling LuaRocks and other C/C++ projects.

A Big Thank You

Thank you for taking the time to look at this project. My hope is that the Lua community can rally around this toolchain and encourage new developers to give Lua/C/C++ a chance on Windows.

I'm keen to get some feedback. Give it a shot and let me know how it goes? Please feel free to post here, or send a message to [email protected]. My git repository is a complete disaster so you won't find much going on there.

Enjoy!
dinsdale

Footnotes:
[1] Some rocks require pre-requisites that are not available through LuaRocks. I am working with the XMake creator to create a new repository for recipes to build these pre-requisites.
[2] People that argue for GNU Mingw-64 don't understand how hard it is to figure out what mingw really is and how it relates to Windows and Linux emulators like msys2. It took me months if not years to get a clear understanding of what was really needed to use Lua/C on Windows. While GNU/Mingw is a viable compiler (I use it at work sometimes) I found llvm-mingw more compelling.
 

Arghtastic

Newcomer
Joined
Apr 26, 2021
Messages
3
Reaction score
0
Just found WinLua Toolchain yesterday--thank you! Would love to see a getting started guide for those of who aren't new but aren't full-time developers.
 

dinsdale247

Moderator
Staff member
Community Patron
Creator of WinLua
Joined
Nov 17, 2020
Messages
93
Reaction score
32
Location
Victoria BC
Website
winlua.net
Hello! Thanks for checking out WinLua. Documentation is on my to-do list. I have created a couple of articles on the forum using the Sol3 C++ extensions with WinLua:


Give those a read and then let me know if that's too high or too low? I'll create an intermediate guide to WinLua Toolchain.

(I had originally wanted to put the documentation on my own server with ads but that plan has majorly stalled out. My server rebuild is about 6 months behind schedule...)
 

dinsdale247

Moderator
Staff member
Community Patron
Creator of WinLua
Joined
Nov 17, 2020
Messages
93
Reaction score
32
Location
Victoria BC
Website
winlua.net
WinLua Toolchain News - CodeLLDB for VS Code works with WinLua

Hi everyone, I have super good news! I can confirm that there is a working LLVM debugger for VS Code. Vadim Chugunov has created CodeLLDB, a plugin for the Windows native LLDB debugger. CodeLLDB works seamlessly with WinLua Toolchain for debugging C/C++ on Windows.

1619757573965.png

To install it to VSCode, search and install "CodeLLDB" in the plugins section. If you already have a launch.json file then just update it according to the Readme [For creating new launch.json files see this link: Debugging in Visual Studio Code]

Here is an example launch.json for working with winlua and xmake:

JSON:
{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "(CodeLLDB) Launch",
            "type": "lldb",
            "request": "launch",
            "program": "build/mingw/x86_64/debug/main.exe",
            "args": [],
            "cwd": "${fileDirname}",
            "terminal": "external",
            "preLaunchTask": "C/C++: clang-<version>.exe build active file",
        }
      
    ]
}

and here is my settings.json file:

JSON:
{
    "C_Cpp.updateChannel": "Insiders",
    "lldb.dbgconfig": {
  
    },
    "xmake.debugConfigType": "codelldb",
    "editor.detectIndentation": false,
    "editor.insertSpaces": false,
}

This debugger is packed with features: vadimcn/vscode-lldb

1619759277409.png

Please download and rate the CodeLLDB plugin? Happy Debugging!
 
Last edited:
Top