Skip to content

nurpax/luau-zig-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Luau/Zig/VSCode example (WIP!)

Example project that:

  • Uses Ziglua bindings
  • Runs a Luau script either directly from source or by loading and executing bytecode
  • Shows how to declare types for a Luau/Zig API
  • Use luau-lsp in VSCode for type-checking Luau code

Demo

VSCode screencap

Running the project

Running the luau script directly from source:

zig build run -- script/main.luau

Compile the luau script into bytecode, execute bytecode:

luau-compile --binary script/main.luau > script/main.luau.bin
zig build run -- script/main.luau.bin

VSCode

  • Install the Luau Language Server VSCode extension
  • Load the example project by code <repo_root_dir>. This should pick up the right Luau lsp configuration from the ``.vscode/settings.json` file.

TODO

  • luau-analyze with type types.d.luau (seems like luau-analyze cannot load type decls? see luau-lang/luau#1139)

About

Luau/zig/vscode example

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages