"LuaCAD" is like #OpenSCAD but using #Lua instead of the OpenSCAD language. #3D #toread
on 02026-08-18Marco Lizza’s #Lua coroutine scheduler. #threading
on 02026-01-06apparently #Roblox uses #Lua coroutines (or I guess Luau coroutines) for #async cooperative #threading: “A task scheduler is what allows coroutines and yielding to work correctly. For example, when you wait(5) in Roblox, the wait function tells the Roblox task scheduler “resume my coroutine in 5 seconds”, and then calls coroutine.yield() to pause the thread until the Roblox task scheduler resumes it.
While the thread is paused, other threads in the game are resumed by the scheduler and run as normal, which is why it is important to yield all the time so that other code in the game gets to execute. In fact, other code (even non-Lua code*) can only run while every Lua thread is yielding, which is why while true do end can crash Roblox! (...) When you call a function like spawn, it places a new coroutine in the task scheduler’s queue rather than resuming it immediately, meaning your function will only start when the scheduler next executes. Internally, this is probably done by putting the newly created coroutine into the queue at time 0, and since the current time is always greater than or equal to 0, it always gets executed the next cycle.” But you’re not allowed to download it unless you have a Roblox account.
A C coroutine scheduler for #Lua. #threading
on 02026-01-06for #performance testing in #Lua you may have to invoke #garbage-collection twice (with collectgarbage()) to ensure that finalizers actually run. Quoting PIL: “The first time the collector detects that an object with a finalizer is not reachable, the collector resurrects the object and queues it to be finalized. Once its finalizer runs, Lua marks the object as finalized. The next time the collector detects that the object is not reachable, it deletes the object. If you want to ensure that all garbage in your program has been actually released, you must call collectgarbage twice; the second call will delete the objects that were finalized during the first call.”
places where the #LuaJIT #FFI’s inability to pass structs by value from C to callbacks into #Lua code has caused problems
on 02025-10-27#documentation for #Scribunto’s debug console (REPL). I didn't know you could <syntaxhighlight lang="lua"> on #MediaWiki.
#Lua in #MediaWiki is #Scribunto; there’s a REPL (“debug console”) in every module editing page like this one. It doesn’t run in the context of the module you’re editing, but you can access the edited module’s return value (normally a table of functions).
on 02025-10-16#Lua’s bugs list is astounding and exemplary: “Each entry includes a minimal example that exhibits the bug and a patch or solution, when available. Larger fixes appear in Lua’s GitHub repository, which is mirrored irregularly.
Every Lua release fixes all listed bugs in previous releases, except where noted. Some bugs found in newer releases may have existed in older releases.” Each entry also specifies when the bug was introduced and when it was fixed.
on 02025-10-16#security problem in #Lua (including 5.0 and 5.1) as of 02014 was maybe the last security problem in Lua 5.1
on 02025-10-16"Compy" is “A console-based Lua-programmable computer for children based on löve2d framework. (...) Command-line based UI, Full control over each pixel of the display, Ability to easily reset to initial state, Impossible to damage with non-violent interaction” #small-is-beautiful #Lua
on 02025-10-05#NeoVim always has #Lua embedded, and includes a standard library to supplement Lua’s weak points.
on 02024-12-27"RaptorJIT" is a #LuaJIT fork used in the Snabb Switch. This fork of it provides #ljs syntax. #Lua
on 02024-12-27"ljs" is #Lua with “C/C++/Java/Javascript” syntax: for(k,v in pairs(A)) { if(k == "one") continue; print(k, type(k), v); }
Scraping callstack information out of #LuaJIT for #eBPF #profilers. #Lua #compilers #toread
on 02024-11-22Apparently #LuaJIT, though mostly compatible with PUC #Lua 5.1, supports most of the additional features in Lua 5.2 now, though not all of them. The ones it supports that are most likely to cause incompatibility are turned off by default.
on 02023-07-14#Lua manual, section, “Table manipulation”
on 02022-09-29A Adonaac’s page on TinyKeepDev’s dungeon #mapgen #algorithms, with animations and #Lua code
on 02022-05-21"Luau", the #Roblox #Lua dialect, with gradual typing.
on 02021-11-03#Roblox freed their #Luau dialect of #Lua.
on 02021-11-03You can use #LuaJIT to AOT-compile your #Lua code into a library: luajit -b $f $(basename $f .lua).o
The #Lua #virtual-machine compiled to #JS (or maybe asm.js?) with Emscripten runs at 64% of native speed in Firefox. Maybe useful for #explorable-explanations. Suffers from memory leaks at the FFI between Emscripten and JS.
on 02016-11-23In #WoW you can eval #Lua code, which opens you up to #security holes if someone else can influence you to run malicious code.
on 02016-08-01#NodeMCU is an open-source firmware for programming #ESP8266 WiFi 32-bit #microcontroller #hardware in #Lua. Doesn’t run Node.js (of course!) but has a node.js-style network API. 64 kilobytes of instruction RAM, 96 kilobytes of data RAM, 64 kilobytes of boot ROM, and 4 megabytes (!!!!) of Flash. A breakout board costs US$10 from Adafruit, or US$7 in a 24mm×16mm×3mm (1.15 mℓ!) surface-mount PCB.
on 02015-11-26“A scientific computing framework for #LuaJIT” #Lua ndarrays, like Numpy, with #GPGPU stuff. And even FPGAs! "Torch 7"
on 02015-08-18“Multi-layer recurrent #neural-networks (LSTM, GRU, RNN) for character-level language models in Torch” in #Lua, which generate pretty spectacular random text. This is (some of) the code for #unreasonable-RNNs.
on 02015-08-18“The Unreasonable Effectiveness of Recurrent #Neural-Networks” for #image-recognition, #NLP language modeling (producing what looks an awful lot like Markov-chain text with slightly better context-free properties), sequential processing for directing attention over an image, etc. Lots of animations and visualizations of RNNs doing their thing. The models are written in #Lua with something called #Torch-7 and run with #GPGPU. Lots of great comments! "unreasonable RNNs"
on 02015-08-15#silentbicycle’s Tangram project is a #blob store that stores data with his #content-addressable #storage Jumprope library, which uses #hashsplitting to chunk the data, much like #bup. Written in #Lua on top of #SQLite 3.
on 02015-08-13#LZ4 #compression implementation catalog, including incompatible #OCaml and #Lua implementations
on 02015-08-05