>WHY SHOULD I USE LUA? Lua is the greatest embeddable scripting language of all time! It's very fast and compatible because it's written in ANSI C, and it's small enough that it can be embedded anywhere. The language spec is very small, with just 1 of every type (1 number type, 1 data structure type, etc.) It has very advanced metaprogramming features. It can be used as a simple config language but is flexible enough to be an advanced programming language in its own right. Lua is ideal if you want to implement scripting bindings on top of a C application, or use C libraries though FFi.
ITT: Share your favorite Lua-related technology
>backend web development (production ready) https://leafo.net/lapis/
>socket scripting (for writing a game server or a custom chat server or something) https://lunarmodules.github.io/copas/
>game development https://love2d.org/
Anonymous · 2026-07-09 02:10 [#5523][report] >>109231473 Congrats on first post (You)
Anonymous · 2026-07-09 02:11 [#5524][report] >>25285 Anyone know a Nintendo 64 emulator with Lua scripting support? Emulation General Wiki isn't helping here.
Anonymous · 2026-07-09 02:12 [#5526][report] BTFOd by AngelScript mpbp
Anonymous · 2026-07-09 02:15 [#5529][report] >>25285 >ITT: Share your favorite Lua-related technology This book by the textadept creator is pretty useful: https://orbitalquark.github.io/lua-quick-reference/
Anonymous · 2026-07-09 02:18 [#5530][report] >>25287 That's a cool idea, let me know if you find one
Anonymous · 2026-07-09 02:24 [#5532][report] >>25289 I haven't heard of that, it looks useful Although the official Lua book (PIL) is extremely good if you didn't know, there is pretty much no need for anything else: https://www.lua.org/pil/ And the reference manual which is a stripped down version of PIL: https://www.lua.org/manual/5.1/
Anonymous · 2026-07-09 02:34 [#5536][report] >>25290 Looks like BizHawk and mupen64-rr-lua are my best options.
Anonymous · 2026-07-09 03:20 [#5545][report] >>25285 i hate lua i hate the syntax, it just doesnt feel comfy programming it
Anonymous · 2026-07-09 03:23 [#5548][report] >>25293 I disagree, Lua syntax is very comfy. Keyword-heavy syntax without a lot of semicolons or braces in general looks really nice.
Anonymous · 2026-07-09 03:34 [#5566][report] >>25294 almost the complete opposite :c unfortunately python is my favorite syntax its also my comfiest language even though it can be quite shit I dont know any other languages where you just do myshit = "this" or whatever without var, let, :=, local Python code is really nice to look at since your variable names and function calls are the "focus" instead of keywords or weird syntax Stuff like **kwargs looks ugly though, but type hints with myfoo:str is quite nice, though I'm not sure if I perfer it to char* myfoo Lua also looks to "nested" but I cant remember if this is a code style thing or a language thing
Anonymous · 2026-07-09 03:56 [#5568][report] Lua is very based.
Anonymous · 2026-07-09 04:11 [#5580][report] >>25295 >I dont know any other languages where you just do >myshit = "this" >or whatever without var, let, :=, local Lua can, but you will probably say it's fake (global table index instead of stack variable assignment). To be fair this is probably one of the most garbage pieces of Lua design that they refuse to fix. Lua 5.5 added a `global` keyword, but it's just a strictness filter that throws if you don't predeclare your globals, it doesn't make local default which is what 99% of people meant when they said Lua should have a global keyword. Oh well. >>25297 Based, good additions
中出し · 2026-07-09 04:22 [#5582][report] For me it's Lispy Lua. >Fennel is a programming language that brings together the simplicity, speed, and reach of Lua with the flexibility of a lisp syntax and macro system. https://fennel-lang.org >Lua Common Lisp. An implementation of Common Lisp targeting Lua. https://codeberg.org/gsou/LCL >gLua is a Lua frontend on Guile platform. Guile is the GNU Ubiquitous Intelligent Language for Extensions, and the official extension language of the GNU project. https://gitlab.com/NalaGinrut/guile-lua-rebirth
Anonymous · 2026-07-09 04:25 [#5583][report] >>25299 >you will never be a real lisp
Anonymous · 2026-07-09 04:30 [#5586][report] >>25300 What is a "real lisp"? John McCarthy's LISP?
Anonymous · 2026-07-09 04:33 [#5587][report] >>25285 I am making a heavily moddable Minecraft remake in C, with the entire gameplay aspect being controlled by LuaJIT. Best of both worlds. It's more moddable than Garry's Mod internally.
<3 Lua
Anonymous · 2026-07-09 04:35 [#5588][report] >>25302 >inb4 lol 47 fps i have a dual core & integrated graphics and i have maxxed out all settings and it's opengl 2.0
Anonymous · 2026-07-09 04:36 [#5589][report] >>25302 Cool project, but I hope you already know about Luanti (formerly minetest) and chose to make this anyways
Anonymous · 2026-07-09 09:11 [#5655][report] >>25302 I'm still fan of it
Anonymous · 2026-07-09 09:20 [#5656][report] >>25285 is it really fast? aren't all scripting languages slow as fuck? what metric do they use to say it's fast?
Anonymous · 2026-07-09 09:24 [#5657][report] >>25307 >aren't all scripting languages slow as fuck? This is mostly a misconception that began with older managed/VM language runtimes, and nowadays the big example of a slow scripting language is python. For an example of an extremely fast scripting virtual machine that rivals native code speed, just look at modern JavaScript engines (but with JS the language is shit). Lua is fast *and* the language is good. >what metric do they use It's not really something "they" claim, Lua has been around since 1993, find any benchmark in the world that includes Lua and you will see how fast it is.
Anonymous · 2026-07-09 09:32 [#5660][report] >>25308 and what can I do with it besides nvim plugins?
Anonymous · 2026-07-09 09:37 [#5662][report] >>25309 It's not really a standalone do-everything language because you're supposed to embed it into other programs and add features yourself (it's minimal by itself, you write a C program and include Lua as a library inside it, and then expose bindings to it) So you can use it to create a scripting layer for your software. Other than that, you'd have to use other projects that embed Lua, neovim is just one exmaple, other examples include openresty (nginx fork) or love2d (game development)
Anonymous · 2026-07-09 10:50 [#5668][report] >>25309 use it as a scripting language but realize you just want to make your own after you get obscure run-time errors that don't actually tell you anything about the problem.
Anonymous · 2026-07-09 11:18 [#5671][report] >>25311 Lua has really simple error messages and stack traces, there's like 5 possible errors it can emit and I wouldn't call any of them obscure
Anonymous · 2026-07-09 14:41 [#5775][report] You can now use lual on lovr! *
* If you compile lovr yourself
Anonymous · 2026-07-09 14:56 [#5782][report] >>25285 Its only use is letting people write scripts for your program that you know will be sandboxed. This goes out the window the moment you keep FFI, which is the only way to make it not run like shit in real tasks, at least when the JIT feels like it. There is no point in using this language besides that peace of mind. I'm not joking.
Anonymous · 2026-07-09 14:59 [#5784][report] >arrays start from fucking 1
Anonymous · 2026-07-09 16:40 [#5842][report] Can I use Lua as just like a regular script language? I use Ruby for a bunch of little tasks on my computer. Many little ruby programs automating things for me. Like certain backups. Sending popups. Grabbing data from a sensor and writing it to a web page so anything can read it. Can you do that is Lua?
Anonymous · 2026-07-09 16:50 [#5845][report] I use LuaJIT for everything except web browser scripting. standalone programs, extension of other programs, glue for library calling. it's fast, versatile and comfy.
Anonymous · 2026-07-09 23:08 [#5962][report] >>25314 Actually, Lua is a garbage sandboxing language, so that use case is very far down on the list.
Anonymous · 2026-07-09 23:09 [#5964][report] >>25315 Lua tables aren't arrays. >but they have an array-like compo- Shut up >internally, numeric keys are stored as- Can it, FAG. Lua tables are not arrays. Don't make me break out the full explanation.
Anonymous · 2026-07-09 23:10 [#5965][report] >>25316 Yeah you could, but it isn't what it was made for.
Anonymous · 2026-07-10 05:52 [#6185][report] fun fact: it takes fewer than 200 bytes of code+data to load lua library and execute a lua file.
Anonymous · 2026-07-10 08:13 [#6231][report] >>25302 very good bro! tell me, siir, witch cloud model does i need to use to make this like me?
Anonymous · 2026-07-10 08:25 [#6236][report] I'm more of a micropython guy
Anonymous · 2026-07-10 12:55 [#6332][report] >>25285 the language is ass im sorry the only saving grace is that its easily embeddable and fast, but thats why people put up with its weirdness. metatables are a good idea tho
Anonymous · 2026-07-10 13:47 [#6373][report] >>25315 In C arrays are 1 indexed >but it starts from 0 It starts from offset 0 which means the first element.
Anonymous · 2026-07-11 02:52 [#6892][report] what if <script type="text/lua"></script> instead text/javascript
Anonymous · 2026-07-11 02:56 [#6895][report] >>25333 The world would be a better place if it was like this from the beginning. Though... it's more likely than you think. I've been working on a project that does this for the better part of a year. You load scripts exactly like that. It's a webassembly Lua-JS FFI but it needs work before it's stable. For existing options, there's wasmoon, but it's not very serious (type marshaling is flaky and it doesn't do cross-runtime GC) and Fengari which isn't webassembly and isn't a real Lua VM. Fengari isn't bad though.
Anonymous · 2026-07-11 02:57 [#6896][report] >>25285 What about TCL? Is it also small enough?
Anonymous · 2026-07-11 03:00 [#6898][report] >>25335 TCL is a few megabytes Lua is WAY smaller, it's not even close.
Anonymous · 2026-07-11 03:03 [#6900][report] >>25336 What about TinyLisp?
Anonymous · 2026-07-11 03:04 [#6901][report] >>25334 256kb WASM or even less that can run lua and manipulate DOM would be awesome
Anonymous · 2026-07-11 03:14 [#6909][report] >>25332 Yea, I know.
Anonymous · 2026-07-11 03:23 [#6925][report] >>25338 I haven't worked on it for a while, but the latest I had it compiling down to 375kb. With certain emcc flags I managed to bring it down to closer to 250kb but it hurt the Lua VM performance a lot, so under 400kb is a more reasonable target. A lot of that is the JS side (type marshaling alone is 1k lines of JavaShit) and additional logic in Lua, like an extension of the garbage collector for circular references between JS and Lua heap. God I really need to work on this again. I would personally eat my own dogfood and use it over the alternatives already even though it's not done yet since Lua in the browser is just so underserved (there's not many options) I'm considering removing a bunch of stuff from it just so I can reduce debugging complexity and get it to a state I'm comfortable putting on github.
Anonymous · 2026-07-11 03:32 [#6933][report] >>25340 lua and js are close enough that requiring a luajit-sized (300 kb) blob just for running one vm in another is just tragic and a loss of performance, compared to transpiling.
Anonymous · 2026-07-11 03:34 [#6937][report] >>25341 They are close on the surface but their VMs are nothing alike.
Anonymous · 2026-07-11 03:45 [#6948][report] >>25341 Coroutines and most metamethods can't be represented in JS btw. So you wouldn't be able to support the whole language spec this way.
Anonymous · 2026-07-11 04:08 [#6971][report] >>25343 lua coroutines map into js generators, metamethods map into js proxy and/or replacing operators with explicit function calls.
Anonymous · 2026-07-11 04:16 [#6981][report] >>25344 Using generators as ghetto coroutines is going to be harder than it looks when you have stuff like a coroutine resuming a coroutine resuming a coroutine, etc. but yeah it could work.
Anonymous · 2026-07-11 04:18 [#6985][report] aren't there like five different and backwards-incompatible Lua's? each version is slightly different and each JIT is slightly different.
Anonymous · 2026-07-11 04:24 [#6987][report] >>25346 Not really. The closest thing I can think of to what you're implying is that Lua 5.2 changed how function environments work (a 5.1 feature) but that's about it. Lua 5.5 is backwards compatible with Lua 5.2 and most Lua 5.2 code that doesn't touch fenvs will also work with 5.1. >each JIT There is only 1 LuaJIT, written by Mike Pall, which is the 5.1 spec with some 5.2 features backported.
Anonymous · 2026-07-11 04:26 [#6988][report] >>25347 thanks. as for JITs I meant various commercially-supported forks like Luau (Roblox), GLua (Facepunch), OpenResty LuaJIT etc
Anonymous · 2026-07-11 04:29 [#6990][report] >>25348 GLua is just PUC Lua 5, and OpenResty uses Mike Pall's LuaJIT Luau yeah I guess.
Anonymous · 2026-07-11 04:30 [#6994][report] >>25333 Funny you say that, once upon a time back in like '02 I hacked together an experiment like that.
Anonymous · 2026-07-11 06:00 [#7044][report] >>25349 >GLua is just PUC Lua 5 GLua has C-style logic operators and comments
Anonymous · 2026-07-11 07:55 [#7106][report] >>25315 Ive only seen nocoders cry about this
Anonymous · 2026-07-11 09:43 [#7169][report] >>25285 Mike Pall returns to discuss new syntax additions to be added in LuaJIT 3.0 https://github.com/LuaJIT/LuaJIT/issues/1475 Some of them are already backported to LuaJIT 2.1 https://github.com/LuaJIT/LuaJIT/issues/1476 My favorite are >ternary >short functions >safe navigation operator
Anonymous · 2026-07-11 09:54 [#7180][report] >>25354 >returns Pretty active on github actually, idk why I thought he was gone
Anonymous · 2026-07-11 11:04 [#7210][report] >>25354 >ternary bro you literally call already do that with "and" and "or". do you really think saving to type 3 characters is a significant improvement?
Anonymous · 2026-07-11 12:19 [#7253][report] >>25354 I love the idea of short functions, but that syntax is kind of garbage. The safe navigation operator is definitely my favorite from the list, if I had to pick 1 feature to add to keep Lua de-bloated that would be the one. >>25356 Not a ternary operator, that's just short-circuited logical operators. Try it yourself and see `a and false or b` returns `b` regardless of whether `a` is true or not. If it was a real ternary operator then it would return false if a was true and b if a was false.
Anonymous · 2026-07-11 14:35 [#7359][report] >>25285 I just recently looked into Lua because I got interested into prototype based OOP languages like self and io and to me their object model implementation makes more sense than a class-instance based one
Lua is already similar in terms of delegation to prototype OOP and it's really easy to implement it under Lua. I asked chatgpt to write a simple library and seems to work pretty fine, at least for toying around
-- object.lua
local Object = {} local Meta = {}
local function lookup(self, key) local value = rawget(self, key)
if value ~= nil then return value end
local proto = rawget(self, "__proto")
if proto then return lookup(proto, key) end end
Meta.__index = function(self, key) local value = lookup(rawget(self, "__proto"), key)
if value ~= nil then return value end
local forward = lookup(self, "forward")
if forward then return forward(self, key) end end
function Object:clone(slots) local obj = slots or {} rawset(obj, "__proto", self) return setmetatable(obj, Meta) end
function Object:proto() return rawget(self, "__proto") end
function Object:slotNames() local names = {}
for name in pairs(self) do if name ~= "__proto" then names[#names + 1] = name end end
return names end
function Object:forward(name) error("message not understood: " .. tostring(name), 2) end
setmetatable(Object, Meta)
return Object
So I can do
local Animal = Object:clone { speak = function() print(self.sound .. "!") end }
local Dog = Animal:clone { sound = "woof" }
Dog:speak()
Anonymous · 2026-07-11 15:01 [#7394][report] >>25358 I personally don't like it (tables are enough) but people have been doing this for a really long time, it's a completely valid use of metatables http://lua-users.org/wiki/SimpleLuaClasses
Anonymous · 2026-07-11 15:07 [#7402][report] If you use libev as an event loop in your host program you can trivially access it from lua with lua-ev for timers, io watchers etc. Probably works with uv, too. I'm also a fan of luaposix to access the complete (?) posix C api from lua.
Is there an alternative to luafilesystem? I'm not using it simply because it pollutes the global namespace.
Anonymous · 2026-07-11 15:10 [#7407][report] >>25358 Btw for the specific example you showed, you can just do it out of the box using __index, without all the class boilerplate
Anonymous · 2026-07-11 15:14 [#7412][report] >>25360 >Is there an alternative to luafilesystem? I'm not using it simply because it pollutes the global namespace. Does it set a bunch of globals or something?
Anonymous · 2026-07-11 15:21 [#7417][report] >>25362 >Does it set a bunch of globals or something? It registers the module globally as lfs when require'd. Years ago this also used to break lua_ls, no idea if that is the case anymore. It won't be fixed because there's probably lots of software that depend on that behavior.
Anonymous · 2026-07-11 15:24 [#7424][report] >>25358 >function Object:proto() > return rawget(self, "__proto") >end Does this actually work? There is no self reference anywhere. I'm too used to just creating closure based classes, even tho it's heavier on memory (if you dont use references to functions instead of creating a new function every time you instance a class)
Anonymous · 2026-07-11 15:28 [#7429][report] >>25364 NTA but it's gay syntactic sugar, if you define a function with the colon syntax after the function keyword like >function foo:bar() end It automatically implies a first parameter called self.
Anonymous · 2026-07-11 15:29 [#7432][report] >>25364 It works because Object:proto() is sugar for Object.proto(self) (note the : vs .)
Anonymous · 2026-07-11 15:35 [#7438][report] >>25366 >>25367 Oh, i see. Usually I do this function f(s) end
local a = {} a.f = f a:f()
instead of
local a = {}
function a:f() end
a:f()
I thought it only added the table as the first parameter during "using" and not during "writing".
Anonymous · 2026-07-11 15:40 [#7444][report] >>25359 That's actually the "opposite" of the prototype OOP object model (classless objects) inplemened in languages like self, Io and original JavaScript
Tables are just flexible enough to be able to reimplement the "inheritance by delegation" model
Anonymous · 2026-07-11 15:44 [#7447][report] >>25369 That's just how Lua tables work already without any extra work doe. Same with JavaScript objects
Anonymous · 2026-07-11 15:53 [#7456][report] this is how i do classes btw desu not sure if matters thoughbeit local function class() local a = {} a.type = "class"
return a end
local function Animal() local a = class() a.type = "animal"
a.eat = function(food) end
return a end
local function Canine() local a = Animal() a.type = "canine"
a.bark = function() print(a.type, "barks") end
return a end
local meow = function(s) print(s.type, "meows") end
local function Feline() local a = Animal() a.type = "feline"
a.meow = meow -- you must use here : but it will use less memory
return a end
Anonymous · 2026-07-11 15:59 [#7462][report] >>25285 For a few weeks I ran the AwesomeWM window manager. It uses Lua instead of a configuration syntax. It was really annoying to work with. I remember needing to set a variable and it was ignored. Finally I set the variable to the value I wanted twenty times within the Lua script in order to get it to work. So, yeah, I think Lua is a bad idea. If you want a tiny language inside of your program, why not BASIC or Forth?
Anonymous · 2026-07-11 16:05 [#7466][report] >>25370 >That's just how Lua tables work already without any extra work doe. Tables are more general than that, that's why you write a library to "restrict" to a specific protocol
To implement the Object, the Lobby and multiple inheritance you want to write down the object model to avoid repeating every time the same code for any object
> Same with JavaScript objects That's not a coincidence, js is heavily inspired by Self. Its VM was the first dynamically typed object-oriented VM to achieve performances almost on par of optimized C++ for many workloads, and many techniques that later became standard in modern language runtimes: > Adaptive compilation > Inline caches (building on earlier work in Smalltalk) > Polymorphic Inline Caches (PICs) > Type feedback > Dynamic recompilation
Then Js later introduces classes as syntactic sugar but still with prototypes under the hood
The problem is that - Self is "dead-ish" (not really dead but being live image-based env l don't see it making a comeback) - Io is still developed but too niche and tarteg wasm by default - js ecosystem is too web-centric
Lua is a nice modern compromise because it's almost like those languages although more general
Anonymous · 2026-07-11 16:26 [#7482][report] >>25361 yes, the object library basically does that
Anonymous · 2026-07-11 21:37 [#7839][report] >>25285 >array index starts from 1 HAHHAHAHAHHAHAHAH
Anonymous · 2026-07-11 22:25 [#7900][report] >>25376 > Using a number from indians Nice try Rajesh
Anonymous · 2026-07-11 22:26 [#7901][report] >>25285 Ask yourself why lua torch lost to pytorch
Anonymous · 2026-07-12 00:40 [#8084][report] >>25378 There is no correlation between Lua and machine learning
Anonymous · 2026-07-12 01:28 [#8128][report] >>25354 not looking forward for new incompatible syntax. in particular, ternary operator reusing : is a terrible idea. consider: value = myobj ? myobj:func() : otherfunc() oops, now value is either myobj or func():otherfunc()
Anonymous · 2026-07-12 02:25 [#8160][report] >>25354 >const HECK YES time to mog jeetscript
Anonymous · 2026-07-12 02:37 [#8174][report] >>25381 PUC Lua already has const doe
Anonymous · 2026-07-12 04:51 [#8272][report] >>25380 >Due to a syntactical ambiguity, expression b cannot directly contain a method call obj:method(). For this case, use parentheses: cond ? (obj:method()) : default >That said, nope, ?: stays. I'll confess: I'm a heavy user. Addicted, even.
Anonymous · 2026-07-12 04:53 [#8274][report] >>25382 In the most retarded way possible local why <const> = "just why";
Anonymous · 2026-07-12 08:06 [#8355][report] i'm genuinely thankful for this thread. now i know i should never touch lua in my life for any reason whatsoever, as it seems to be another memelang for faggots.
Anonymous · 2026-07-12 08:26 [#8361][report] >>25386 Okay, I'm thankful that you posted this and bumped the thread
Anonymous · 2026-07-12 12:43 [#8412][report] love2d is really cool. too bad it uses Lua.
Anonymous · 2026-07-12 13:42 [#8429][report] >>25388 Love2d is literally just a collection of Lua bindings for C libraries like box2d and SDL/OpenGL So really cool my ass. If you're a lua hater then "love2d without Lua" would just be using those libraries directly.
Anonymous · 2026-07-12 14:13 [#8437][report] >>25389 >would just be using those libraries directly or with some other scripting language which doesn't suck
Anonymous · 2026-07-12 14:24 [#8443][report] >>25390 Which one?
Anonymous · 2026-07-12 14:31 [#8447][report] >>25375 It's really fun porting stuff from C or JavaScript. Speaking of JavaScript, that's the language that should be used for embeddable engines instead of Lua. It is just so much better for that purpose. Instead, it's being used server-side and to make desktop OSes. (???) Unfortunately Duktape is slower so Lua gets used instead simply because it is faster.
Anonymous · 2026-07-12 21:03 [#8684][report] >>25393 >>25376 the superior alternative is being able to specify the bounds of the array on allocation you can start from 0 or 1 or -50 or whatever you want to t. fortran
(I will admit MAYBE the compiler adds microscopic overhead by starting from a different offset than 1 and idk whether or not this is the case)
also inclusive-inclusive is superior fuck off with your last index not being included
Anonymous · 2026-07-12 21:28 [#8695][report] actually you should be using lus (or microlua) https://github.com/lus-lang/lus https://github.com/lus-lang/microlua
Anonymous · 2026-07-13 00:51 [#8758][report] bump C and Lua. nothing more >>25398 lua is lua
Anonymous · 2026-07-13 13:00 [#8896][report] >>25285 pythoids will NEVER understand how cozy it is to program in a language without importing a a Schindlers list of libraries to "compete" with elegant simplicity and functionality of core lua.
Anonymous · 2026-07-13 13:13 [#8900][report] >>25285 >>game development >https://love2d.org/ can LLMs into this shit? I do like how it's sort of simple to set up but it might be too obscure
Anonymous · 2026-07-13 13:15 [#8901][report] >>25404 LLMs should have it in their training data, love2d is even less obscure than something like raylib. But you can just give the docs to your AI slop agent anyway
Anonymous · 2026-07-13 13:28 [#8904][report] >>25405 well yeah it's just that docs bloat context that said python might need a lot of boilerplate to get what this love thing offers intrinsically so it's not so easy to decide
Anonymous · 2026-07-13 20:16 [#8965][report] I used to love Lua. I read the manual in bed at least once a month. I built a scriptable game engine in C using SDL2 and Lua for making the actual games once. I also used it on Garry's Mod a lot. But it's been a while since I've touched it.
Anonymous · 2026-07-13 20:20 [#8967][report] >>25389 Löve is great for building stuff fast and messing with it and having fun
Anonymous · 2026-07-13 20:21 [#8968][report] >>25404 It should be in the dataset because it has been around for a very long time.
Anonymous · 2026-07-14 08:27 [#9135][report] thread adoption has been delayed
Anonymous · 2026-07-14 15:06 [#9180][report] >>25412 SnailGODS won
Anonymous · 2026-07-14 19:58 [#9202][report] >>25413 many such cases
Anonymous · 2026-07-14 19:59 [#9203][report] My thread had a good life, and now it wants to die peacefully... please stop bumping it...
SmoothPorcupine · 2026-07-14 20:27 [#9205][report] >>25416 Excellent trips, sir. Would you like to have literally any one granted, inclusive of omnipotence over moderators?
Anonymous · 2026-07-14 20:52 [#9210][report] lua is based, 'tan' related stuff is cringe, simple as
Anonymous · 2026-07-15 03:02 [#9249][report] >>25419 >lua-tan >no tan
Anonymous · 2026-07-15 03:04 [#9250][report] >>25414 >snailcatGODS won
Anonymous · 2026-07-15 06:07 [#9274][report] >>25285 >1-indexed >but index 0 can have data set manually >but if you do, it doesn't contribute to the table length your language is a fucking joke
Anonymous · 2026-07-15 06:25 [#9276][report] >>25422 Table length isn't real, just set a property n
Anonymous · 2026-07-15 07:00 [#9278][report] >>25315 >anon has 1 thumb and 7 fingers >one nut and no benis :DD:D
Anonymous · 2026-07-15 11:29 [#9342][report] >>25423 >Table length isn't real This
Anonymous · 2026-07-15 14:39 [#9375][report] >>25423 >>25425 your language is a fucking joke
Anonymous · 2026-07-16 15:44 [#9579][report] >>25285 why is py tan so stupid?
Anonymous · 2026-07-16 16:28 [#9582][report] >>25433 >why is py tan so stupid? have you... programming in python yet?
Anonymous · 2026-07-16 21:18 [#9624][report] >>25434 Guido is such faggot
Anonymous · 2026-07-16 21:33 [#9625][report] >>25357 >>25354 >safe navigation operator Holy fuck shoot me. Now instead of crashing on bad data your code can just make everything nil and limp along.
Anonymous · 2026-07-16 21:37 [#9627][report] >>25285 >WHY SHOULD I USE LUA? That's irrelevant
WHY SHOULD YOU NOT USE LUA It was never hardened against anything, it's a meme scripting language not used for anything serious. It's a security accident if you as much as just run a single Lua LoC.
Anonymous · 2026-07-16 21:44 [#9628][report] >>25285 I just loaded entire hyprland wiki + stubs/hl.meta.lua into the gemini pro context along with my freestyle prompt on how I want certain thing to be and it got me a fairy decent prototype that I could hack on.
Anonymous · 2026-07-16 22:50 [#9635][report] does C chan have huge jugs?
Anonymous · 2026-07-17 09:30 [#9687][report] >>25436 Wrong, it's just a syntactic sugar for a common pattern (nested table access) if foo?.bar?.nig is better to write than if foo and foo.bar and foo.bar.nig
Anonymous · 2026-07-17 09:31 [#9688][report] >>25437 >It was never hardened against anything, it's a meme scripting language not used for anything serious Stupid nigger https://en.wikipedia.org/wiki/OpenResty
Anonymous · 2026-07-17 12:49 [#9722][report] >>25443 The critical one is the one opened 1 day ago, and not even Debian oldstable has patched that yet on the real nginx package.
SmoothPorcupine · 2026-07-17 13:16 [#9728][report] >>25285 >"Uh-oh, it looks like python-tan is having trouble understanding the world again!" >"will you implement some rudimentary parsing to help her recognize 'that' and understand other languages?" >"Don't worry; despite her appearance here, she is actually quite intelligent! she won't need much"
I dunno what is happening IRL right now, but if nothing is done I'm about to plow Python-tan
Anonymous · 2026-07-17 13:18 [#9729][report] >>25443 How many of these are caused by Lua? >>25444 First one is not even OpenResty's but upstream Nginx's
Anonymous · 2026-07-17 18:03 [#9798][report] >>25443 Can't spell CVE without C
Anonymous · 2026-07-17 18:24 [#9801][report] >>25307 Lua is JIT compiled and quite optimized. It is pretty fast
Anonymous · 2026-07-17 19:38 [#9814][report] >>25285 just vibecoded a 4000 line lua module and it works quite well
Anonymous · 2026-07-17 20:19 [#9820][report] >>25308 In what ways is lua the language better than Javascript?
Anonymous · 2026-07-17 20:25 [#9822][report] >>25353 Yeah, most coders don't even bother to try lua and so don't complain about it at all.
Anonymous · 2026-07-17 21:36 [#9836][report] >>25450 It does everything JS tries to do but better and simpler. Tables and metatables are the same thing as objects/prototypes (not superficially) but with better semantics. Coroutines are actual cooperative multitasking implemented properly and more flexible than JS async. JS is like a soup of different solutions to the same problem melted together, Lua has only 1 feature for every task which makes it more elegant. It's also older than JavaScript. JS was influenced somewhat by Lua, but didn't get it right. If you use both, and you ignore how different the syntax is, Lua feels a bit like programming in JavaScript if all the cruft was removed .
Anonymous · 2026-07-17 21:42 [#9842][report] >>25285 >1-based indexing Or should I say >1-cringe indexing
Anonymous · 2026-07-17 21:50 [#9843][report] >>25453 t. 0 coder
Anonymous · 2026-07-17 23:49 [#9853][report] >>25285 this is such a great picture, who drew it?
Anonymous · 2026-07-18 02:38 [#9863][report] >>25453 luajit has both 1-based and 0-based indexing ;)
Anonymous · 2026-07-18 03:05 [#9867][report] >>25287 What would you scripting support in an emulator allow you to do?
Anonymous · 2026-07-18 03:09 [#9868][report] >>25457 testing, macros, speedrunning, debugging, modding, maybe more I didn't imagine right now.
Anonymous · 2026-07-18 03:46 [#9874][report] I spent an afternoon trying to figure out fennel, make it work with love2d, and connect it to a repl with emacs.
Then I realized I have no ideas for building anything with it.
Anonymous · 2026-07-18 05:54 [#9878][report] >>25458 debugging makes sense, I wasn't thinking about the rest
now that you say it, it could be used to print text on ImGui widgets for debugging, testing, profiling, etc... about the state of the emulator, but for that you'd need access to all the internal data structures and memory areas of the emulator. I'm not sure how you'd implement that without a writing marshalling functions for each data sturcture, since a language like Lua couldn't directly read memory using pointer and if it could it would be oblivious of the struct types...
Anonymous · 2026-07-18 05:55 [#9879][report] >>25459 Same I just like tinkering
Anonymous · 2026-07-18 06:09 [#9881][report] >>25461 i had to close this when the skellington appeared 2spoopy4me
Anonymous · 2026-07-18 06:13 [#9882][report] >>25460 luajit has ffi built-in that lets you operate on raw memory pointers, for vanilla lua you'd need a separate ffi library.
Anonymous · 2026-07-18 06:47 [#9884][report] >>25463 >ffi of course ... it shouldn't be too much boilerplate compared to what I was thinking I was thinking it would be nice to have a systems language with an associated scripting language that could directly understand the types of the systems language, but it would be hard to make interact code with manual memory managment and the scripting code using a GC, in a memory safe way
Anonymous · 2026-07-18 07:32 [#9888][report] >>25460 >I'm not sure how you'd implement that without a writing marshalling functions for each data sturcture, since a language like Lua couldn't directly read memory using pointer It can actually, just take a look at CheatEngine which can be scripted from Lua and can read arbitrary data from pointers for debugging purposes.
Anonymous · 2026-07-18 07:35 [#9889][report] >>25464 >I was thinking it would be nice to have a systems language with an associated scripting language that could directly understand the types of the systems language Depending on what you mean by this, you might just be talking about userdata. Lua lets you create an arbitrary C object and have it be managed by Lua VM/GC, and you just write the metatables as C functions. https://www.lua.org/pil/28.1.html If you mean "without any boilerplate at all" then no, the boilerplate is really small though.
Anonymous · 2026-07-18 08:12 [#9890][report] >>25289 the textadept creator has a degree in rocket science, not even kidding
Anonymous · 2026-07-18 19:25 [#9993][report] >>25285 Sorry anon, Lua is a neat but unfortunately this is a #895129 thread so Python is preferred over any #FFFFFF language.
Anonymous · 2026-07-18 21:22 [#10036][report] >>25470 Lua is Brazillian doe
Anonymous · 2026-07-19 00:47 [#10186][report] >>25455 sauce now OP
Anonymous · 2026-07-19 01:59 [#10227][report] >>25465 >CheatEngine which can be scripted from Lua and can read arbitrary data from pointers for debugging purposes read but not write? >>25466 >Depending on what you mean by this What I mean is that when a C/C++ program use an embedded scripting language, the scripting language doesn't know the types of used by the program so if you want to read or write structs of the C program with the scripting language, you are forced to defined the struct definition a 2nd time in the scripting language for the FFI. Even if the scripting language is statically typed, has structs and arbitrary memory access with pointers castings, it still needs that duplicated struct definition. Each time the main application is changing, the Lua code or whatever will have to be kept in sync.
If the systems language had already the scripting language included in its syntax (or rather they would have mostly the same syntax but the scripting language's code would be lighter because it would use a GC and supposing the systems language is type inferred, the scripting language would need far less type annotations), then the same frontend could be used for both language, the systems language could directly call scripting language functions and vice versa, the scripting language could directly read and write the systems language data because they would share the same type system. No duplicate type definitions needed, no need to keep the 2 in sync, only one source of truth.
>Lua lets you create an arbitrary C object and have it be managed by Lua VM/GC, and you just write the metatables as C functions. What I'd like to have is receive a pointer to struct from C, which is already allocated by the C code, and being able to read/write its fields it directly (having prealably declared the struct definition with the FFI library) without converting the struct to a table first and then later converting the table back to the struct. Too much overhead. >If you mean "without any boilerplate at all" yes
Anonymous · 2026-07-19 03:52 [#10266][report] >>25285 I think Lua-tan is lightweight enough to apply the small angle approximation, so let's just call it Lua. Or is it bloated, that's why you call it Lua-tan? In than case I won't use it
Anonymous · 2026-07-19 09:31 [#10390][report] >>25473 >read but not write? It can do both.
Anonymous · 2026-07-19 09:32 [#10391][report] >>25473 You might be interested in https://terralang.org/ Not a great language but a good proof of concept
Anonymous · 2026-07-19 09:36 [#10392][report] >>25473 >without converting the struct to a table first and then later converting the table back to the struct. Too much overhead. Userdata isn't fully within the criteria if what you're asking for, because the Lua VM manages the memory of a userdatum, but there is no conversion to a table when interacting from Lua. You write something like obj.foo = bar, and the Lua VM calls the __newindex metamethod, a C function. And the C function does Lua VM stack manipulation or reads data off the stack directly.
Anonymous · 2026-07-19 09:37 [#10393][report] >>25477 (me) obj in this case is an object with type "userdata" (not table) which is literally just a C pointer.
Anonymous · 2026-07-19 14:07 [#10424][report] >>25449 typescript and lua are good lang for slopcoding, idk why it sucked for vanilla js
Anonymous · 2026-07-19 16:20 [#10428][report] >>25285 I am using Love2D to make a game because I am too stupid to install pygame.
It is what it is.
Anonymous · 2026-07-19 17:05 [#10436][report] >>25285 >It's very fast and compatible because it's written in ANSI C Actually- performance-wise Lua is utter shite. You need to rely on the unofficial LuaJIT runtime for compiled performance, a runtime which is now abandoned by its main developer and sole driving force behind keep its parity with the official runtime. LuaJIT is 5~10x more performant than the official runtime, and V8 - yes the JAVASCRIPT ENGINE V8, in Node.js, Chromium, etc. - runs circles around LuaJIT and has been doing so since 2022. Real-world benchmarking suites implemented in both Lua and JS show V8 at about 2.3x the performance of LuaJIT. In short, official Lua is up to TWENTY times slower than the best official supported embeddable JS runtime.
Furthermore, Lua's language revisions are hard-tied to runtime version and different minor language revisions have behavior that is neither backwards nor forwards compatible. The one cardinal sin worse than the runtime not being portable? The actual stuff you write in it, not being portable.
Lua is a failure. It was originally written as a simple thought experiment for process-automation in chemical plants, and somehow it broke loose into the real world. It should've been put down like the mangy mutt it was, but then the videogame industry got its claw on it, in a time where Flash was on its way out.
Anonymous · 2026-07-19 17:08 [#10437][report] >>25298 JavaScript also can, in non-strict mode. There if you assign to an undeclared local, it creates it on the global object. In strict mode, it will throw instead. As any good language should.
Anonymous · 2026-07-19 17:15 [#10439][report] >>25452 >Tables and metatables are the same thing as objects/prototypes (not superficially) but with better semantics. Metatables are a very loose mechanism that you can use to express prototypal inheritance, for sure. But the looseness of metatables means you have zero guarantees of cross-compatibility with third-party code understanding how your prototypes work, and vice-versa. Method vs non-method function calls are also caller controlled, meaning whether or not you get passed the proper 'this' is up to caller responsibility, which means the caller also continuously needs awareness of which methods to call with period and which with colon. It's such a poor fucking language convention, it gives fucking PHP displaced embarassment.
Which also means that >Lua has only 1 feature for every task which makes it more elegant. deserves only one response, and that is: lol. lmao even.
Anonymous · 2026-07-19 17:20 [#10440][report] >>25453 It's actually not even 1-based indexing. Because Lua doesn't actually have arrays. It only has bool/string/number primitives, an associate hashmap object that it calls a 'table,' and a hacky add-on on top of that which mix-and-matches features of Symbol and Proxy in JS - which it refers to as meta-tables.
It doesn't actually have arrays. Arrays are just a convention expressed through part of its standard library, for iterating over numeric looking table keys. The standard library functions expect iteration to start at 1, but it doesn't have to. It could start at 0 as well. Or at 5. Or at 42. Or, if you're a particularly crafty fucker publishing code modules as a third-party, who wants to fuck with people: -1.
Anonymous · 2026-07-19 20:35 [#10444][report] >>25484 >Method vs non-method function calls are also caller controlled, meaning whether or not you get passed the proper 'this' is up to caller responsibility, This happens in every programming language tho
Anonymous · 2026-07-19 20:46 [#10445][report] >>25482 >Lua is slower than the fastest and most mature scripting runtime in the world, therefore it's a failure ok
Anonymous · 2026-07-19 21:07 [#10448][report] Redpill me on brazilians
Anonymous · 2026-07-20 17:45 [#10504][report] >>25495 It'a pretty meh for config; it's fine either way. But as a scriptable interface, it's leagues better than the "run sequential ex commands to change your buffer" language that is Vimscript. t. tried writing plugins in pure Vimscript and got frustrated at how autoload imposes a strict directory structure on you with terrible cross-submodule support
Anonymous · 2026-07-20 21:16 [#10513][report] >>25492 >V8 is 50MB of slop while LuaJIT is like 2MB brutal
Anonymous · 2026-07-20 21:25 [#10514][report] >>25482 >Actually- performance-wise Lua is utter shite. I can write real time software in Prolog for modern computers. PUC-RIO Lua is perfectly fine.
Anonymous · 2026-07-21 01:33 [#10517][report] >>25503 Why are users on this website such insufferable faggots? It's like reading linkedin, r*ddit, and lesswrong all at the same time.
Anonymous · 2026-07-21 01:45 [#10518][report] >>25402 >loukamb Liu Kang?
Anonymous · 2026-07-21 01:49 [#10520][report] >>25498 We're waiting on the logo before we start with the project.
Anonymous · 2026-07-21 01:52 [#10521][report] I hate this language and the fact that it gets embedded into fucking everything.
Anonymous · 2026-07-21 01:59 [#10522][report] >>25507 >I dislike that the popular language designed for embedding is frequently embedded into applications
Anonymous · 2026-07-21 21:16 [#10869][report] >>25396 >the superior alternative is being able to specify the bounds of the array on allocation >you can start from 0 or 1 or -50 or whatever you want to >t. fortran why the fuck would you want this
Anonymous · 2026-07-22 00:24 [#10939][report] >>25520 Can you really see no use for this? I guess it requires having 115 IQ at minimum to realize the numeric value associated with a data point along an axis (something you'd use a list data structure like an array for) isn't always the same value as the data point's position relative to the list in the program's memory. But you are so cnile that your brain can't even separate those two concepts at all, even though they're very different things... I feel bad for you, it's like having a mental illness.
Anonymous · 2026-07-22 00:40 [#10943][report] >>25521 >you are so cnile that your brain can't even separate those two concepts at all ...even though programming in C necessitates that I do exactly that?
Anonymous · 2026-07-22 00:49 [#10945][report] >>25439 yes refer to the included image
Anonymous · 2026-07-22 00:53 [#10946][report] 1-based indices actually have a property that starts at 0, that being the length. If I have 5 apples, I label them 1, 2, 3, 4, and 5, but if I don't have any apples, I have 0 apples (aka the length of the list is 0). So the number 0 isn't wasted in the case of a 1-based array. Whether it makes sense to start from 0 depends on the question you're asking, for example if you ask "how far away from me is the closest object?" a valid answer would be that it's 0 meters away from you. But if you ask how many objects there are, notice there HAS to be at least 1 object, otherwise the question of how far away the closest object is doesn't make any sense. The reason you index from 0 in C is because indexing an array with value n is asking "what is the nth repetition of this object?" which is closer to the question of distance. arr[4] in C is asking "give me the 4th repeated value" which happens to be the 5th value. The reason it's framed this way is because it's how you think about memory allocation (an array of type t and length n allocates sizeof(t)*n memory, and the index is a multiplication of sizeof(t)) but it's totally arbitrary.
Anonymous · 2026-07-22 00:56 [#10948][report] >>25522 You can differentiate the two things in your code, but apparently you don't realize that means you can turn it into an abstraction without losing anything. Just like when typing a string, you type "hello world" instead of "104 101 108 108 111 32 119 111 114 108 100".
Anonymous · 2026-07-22 00:58 [#10949][report] >>25525 >without losing anything except all respect for myself that i found array indices too difficult to understand.
Anonymous · 2026-07-22 01:02 [#10951][report] >>25526 I don't think you are fully committed to this logic unless you use ascii tables to write out strings and write 0 and 1 instead of true and false. In fact, you are probably stupid if you even so much as use indices, every value above 0 is an abstraction so it doesn't reflect the real data. You should be casting array+size+index to a pointer and dereferencing it directly, otherwise you're too stupid to understand pointers.
Anonymous · 2026-07-22 01:04 [#10952][report] >>25523 What does Haskell look like?
Anonymous · 2026-07-22 01:17 [#10955][report] >>25527 the amount of autism in this post...
Anonymous · 2026-07-22 01:35 [#10961][report] >>25529 It's exactly what you sound like kek
Anonymous · 2026-07-22 04:07 [#10980][report] >>25520 you get rid of annoying conversion steps where you have to shift indices and can instead just insert directly at that index you also reduce the chances of off by one errors and can use your mental energy on other stuff
Anonymous · 2026-07-22 14:56 [#11320][report] >>25531 >you get rid of annoying conversion steps you didn't get rid of shit. you just hid it and now the computer has to do it for you, reducing your performance because you're a lazy fuck.
Anonymous · 2026-07-22 15:10 [#11327][report] >>25534 >you didn't get rid of shit. you just hid it and now the computer has to do it for you you just described high level programming
Anonymous · 2026-07-22 16:04 [#11340][report] >>25534 When you do arr[3] your computer has to do *(type*)(arr+(sizeof(type)*3)) so it's the same thing, basically you're just making up fake reasons to justify baby duck syndrome
Anonymous · 2026-07-22 16:15 [#11344][report] >>25536 >When you do arr[3] your computer has to do *(type*)(arr+(sizeof(type)*3)) mov ebx, arr mov esi, 3 mov eax, [ebx + esi * 4]
all that C mumbo jumbo horseshit you typed out is not real
Anonymous · 2026-07-22 16:19 [#11346][report] >>25537 Even the most niggerlicious compiler will just calculate a single offset
Anonymous · 2026-07-22 16:23 [#11347][report] >>25538 No shit if you use a compile time constant but I was trying to avoid cherry picking the best case scenario because most code uses variable offsets much more than immediate offsets
Anonymous · 2026-07-22 19:24 [#11395][report] C doesn't exist. Only the Assembly it compiles into exists. >inb4 it compiles into machine code Assembly is machine code with words.
Anonymous · 2026-07-22 20:41 [#11424][report] >>25541 The assembly doesn't exist either, and neither does any other representation of the machine code. The only physical element at play is the electrons moving through your motherboard, riding motorcycles.
Anonymous · 2026-07-23 00:17 [#11498][report] >>25421 That image is some obscure reference. Well done.
Anonymous · 2026-07-23 17:38 [#11664][report] >>25523 Ruby-chan ToT
Anonymous · 2026-07-23 21:49 [#11713][report] >>25542 >only physical element at play is the electrons moving through your motherboard, riding motorcycles Wow
Anonymous · 2026-07-24 00:03 [#11758][report] >>25547 So why are you blatantly bumping the thread by posting empty replies such as this one? It's been going unnaturally like this for weeks. Please let it die.
Anonymous · 2026-07-24 00:05 [#11759][report] >>25548 LET IT LIVE
Anonymous · 2026-07-24 00:59 [#11798][report] >>25548 >why To make (You) seethe. Looks like it worked :-)
Anonymous · 2026-07-24 01:50 [#11820][report] But moon outside is only a halfie not a fullie.
Anonymous · 2026-07-24 02:20 [#11827][report] >>25418 go back nigger.
Anonymous · 2026-07-24 06:39 [#11842][report] >>25551 >>25540 Why is she doing weird arm things?
Anonymous · 2026-07-24 06:41 [#11843][report] >>25554 >stretching >flexing Do you think she should be in a T pose or something? At least try harder with your fake bumps...
Anonymous · 2026-07-24 06:47 [#11845][report] >>25554 she's stretching flexing and posing because she's staying fit and fast and strong >inb4 someone branches "Fatass Lua"
Anonymous · 2026-07-24 10:51 [#11905][report] I always loved Lua for its simplicity but as I've gotten older and more experienced I've realized dynamically typed languages just suck. I don't really see the point of it besides being a learning tool or a sandboxed environment for game mods.
people always bitch about indexing from 1 and yeah that's bad, but the way metatables obscure what's happening is worse imo
Anonymous · 2026-07-24 16:17 [#11926][report] >>25285 lua is a smol language. but this artist draws her as normal sized. i am disappoint.
Anonymous · 2026-07-24 16:56 [#11927][report] >>25559 She has big ambitions.
Anonymous · 2026-07-24 21:43 [#11929][report] >>25557 >dynamically typed languages just suck I guess it sucks if you're typeschizo like a Rustoddler or a Haskellfag. But not really.
Anonymous · 2026-07-24 21:55 [#11932][report] [deleted by 4chan - preserved by Cyberix]
>>25561 Typetroons need types to be a language construct just like gender is a social construct. They can't simply let a value be the type that it is naturally, it has to be annotated and explicitly casted, just like they annotated and typecast themselves into a woman.
Anonymous · 2026-07-24 22:22 [#11933][report] >genderfluid dynamictrannies getting uppity >i can be any type i want chud!! your integer will never be a real string
Anonymous · 2026-07-24 22:33 [#11935][report] >I must make everything in my life relate to trannies somehow, yes even integers /pol/ was a mistake.
Anonymous · 2026-07-24 23:29 [#11936][report] >>25557 lua is designed to be use to build configuration DSLs
Anonymous · 2026-07-25 03:52 [#11965][report] >>25565 lua is designed
Anonymous · 2026-07-25 04:07 [#11973][report] lua is based. first programming langauge i taught myself when i was 15 so i could make games on roblox.
Anonymous · 2026-07-25 05:25 [#12003][report] >>25285 >>25286 >>25469 >>25540 I love Lua-tan pleaes keep making these!
Anonymous · 2026-07-25 06:56 [#12010][report] >>25533 Draw it as an animu?
Anonymous · 2026-07-25 06:58 [#12011][report] >>25523 Where is Fortran?
Anonymous · 2026-07-25 07:11 [#12013][report] >>25562 >let a value be the type that it is naturally Which is...
Anonymous · 2026-07-25 08:15 [#12014][report] >>25571 A heterosexual variable simply has the type of the value that was assigned to it, and isn't worried about anything else.