THE CYBERIX NETWORK

The sophisticated man's creative playground

i am not a robot. i am a human being. please believe me.

Lua-related technology

SHARE · Back to threads · Report thread

Anonymous · original post · 2026-07-16 21:18:36

>>25434
Guido is such faggot

Report · Quote

Anonymous · reply · 2026-07-16 21:33:09

>>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.

Report · Quote

Anonymous · reply · 2026-07-16 21:37:08

>>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.

Report · Quote

Anonymous · reply · 2026-07-16 21:44:30

>>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.

Report · Quote

Anonymous · reply · 2026-07-16 22:50:10

does C chan have huge jugs?

Report · Quote

Anonymous · reply · 2026-07-17 05:19:04

>>25437
sneeeeed

Report · Quote

Anonymous · reply · 2026-07-17 09:30:01

>>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

Report · Quote

Anonymous · reply · 2026-07-17 09:31:01

>>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

Report · Quote

Anonymous · reply · 2026-07-17 09:44:40

>>25442
> OpenResty
Retarded faggot shill

Report · Quote

Anonymous · reply · 2026-07-17 12:49:15

>>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.

Report · Quote

SmoothPorcupine · reply · 2026-07-17 13:16:31

>>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

Report · Quote

Anonymous · reply · 2026-07-17 13:18:23

>>25443
How many of these are caused by Lua?
>>25444
First one is not even OpenResty's but upstream Nginx's

Report · Quote

Anonymous · reply · 2026-07-17 18:03:14

>>25443
Can't spell CVE without C

Report · Quote

Anonymous · reply · 2026-07-17 18:24:41

>>25307
Lua is JIT compiled and quite optimized. It is pretty fast

Report · Quote

Anonymous · reply · 2026-07-17 19:38:52

>>25285
just vibecoded a 4000 line lua module and it works quite well

Report · Quote

Anonymous · reply · 2026-07-17 20:19:33

>>25308
In what ways is lua the language better than Javascript?

Report · Quote

Anonymous · reply · 2026-07-17 20:25:22

>>25353
Yeah, most coders don't even bother to try lua and so don't complain about it at all.

Report · Quote

Anonymous · reply · 2026-07-17 21:36:33

>>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 .

Report · Quote

Anonymous · reply · 2026-07-17 21:42:32

>>25285
>1-based indexing
Or should I say
>1-cringe indexing

Report · Quote

Anonymous · reply · 2026-07-17 21:50:23

>>25453
t. 0 coder

Report · Quote

Anonymous · reply · 2026-07-17 23:49:15

>>25285
this is such a great picture, who drew it?

Report · Quote

Anonymous · reply · 2026-07-18 02:38:57

>>25453
luajit has both 1-based and 0-based indexing ;)

Report · Quote

Anonymous · reply · 2026-07-18 03:05:02

>>25287
What would you scripting support in an emulator allow you to do?

Report · Quote

Anonymous · reply · 2026-07-18 03:09:10

>>25457
testing, macros, speedrunning, debugging, modding, maybe more I didn't imagine right now.

Report · Quote

Anonymous · reply · 2026-07-18 03:46:26

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.

Report · Quote

Anonymous · reply · 2026-07-18 05:54:41

>>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...

Report · Quote

Anonymous · reply · 2026-07-18 05:55:08

>>25459
Same I just like tinkering

Report · Quote

Anonymous · reply · 2026-07-18 06:09:12

>>25461
i had to close this when the skellington appeared
2spoopy4me

Report · Quote

Anonymous · reply · 2026-07-18 06:13:14

>>25460
luajit has ffi built-in that lets you operate on raw memory pointers, for vanilla lua you'd need a separate ffi library.

Report · Quote

Anonymous · reply · 2026-07-18 06:47:55

>>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

Report · Quote

Anonymous · reply · 2026-07-18 07:32:51

>>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.

Report · Quote

Anonymous · reply · 2026-07-18 07:35:27

>>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.

Report · Quote

Anonymous · reply · 2026-07-18 08:12:05

>>25289
the textadept creator has a degree in rocket science, not even kidding

Report · Quote

Anonymous · reply · 2026-07-18 14:02:41

lua?

Report · Quote

Anonymous · reply · 2026-07-18 14:47:35

>>25468
Lua!

Report · Quote

Anonymous · reply · 2026-07-18 19:25:54

>>25285
Sorry anon, Lua is a neat but unfortunately this is a #895129 thread so Python is preferred over any #FFFFFF language.

Report · Quote

Anonymous · reply · 2026-07-18 21:22:26

>>25470
Lua is Brazillian doe

Report · Quote

Anonymous · reply · 2026-07-19 00:47:41

>>25455
sauce now OP

Report · Quote

Anonymous · reply · 2026-07-19 01:59:28

>>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

Report · Quote

Anonymous · reply · 2026-07-19 03:52:19

>>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

Report · Quote

Anonymous · reply · 2026-07-19 09:31:26

>>25473
>read but not write?
It can do both.

Report · Quote

Anonymous · reply · 2026-07-19 09:32:32

>>25473
You might be interested in https://terralang.org/
Not a great language but a good proof of concept

Report · Quote

Anonymous · reply · 2026-07-19 09:36:37

>>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.

Report · Quote

Anonymous · reply · 2026-07-19 09:37:38

>>25477 (me)
obj in this case is an object with type "userdata" (not table) which is literally just a C pointer.

Report · Quote

Anonymous · reply · 2026-07-19 13:53:11

>>25455
me

Report · Quote

Anonymous · reply · 2026-07-19 14:07:52

>>25449
typescript and lua are good lang for slopcoding, idk why it sucked for vanilla js

Report · Quote

Anonymous · reply · 2026-07-19 16:20:07

>>25285
I am using Love2D to make a game because I am too stupid to install pygame.

It is what it is.

Report · Quote

Anonymous · reply · 2026-07-19 17:05:01

>>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.

Report · Quote

Anonymous · reply · 2026-07-19 17:08:30

>>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.

Report · Quote

Anonymous · reply · 2026-07-19 17:15:01

>>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.

Report · Quote

‹ Newer posts Page 4 of 6 Older posts ›

Reply to this thread

Posting requires a durable account or a TripPass. Reading remains available.

Sign in or create or attach a TripPass to post. Browsing is open.