Lua-related technology
< prev
1
...
6
7
8
9
10
...
12 next >
Anonymous >30d ago #p25460 >>quote [AutoMod] action=keep R:7 E:6 N:5 C:8 | The user provides a thoughtful response to the original thread. It engages with the technical challenge of interfacing Lua with low-level memory structures effectively.
>>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 >30d ago #p25461 >>quote [AutoMod] action=keep R:8 E:3 N:5 C:8 | The post is a very low-effort response but fits the thread context by expressing a similar sentiment. It's relevant to the discussion about tinkering with languages.

1763757486807036.webm
>>25459
Same I just like tinkering
Anonymous >30d ago #p25462 >>quote [AutoMod] action=queue R:1 E:2 N:1 C:1 | The post is extremely short and contextually irrelevant to the Lua discussion. It seems like a random, low-effort comment.
>>25461
i had to close this when the skellington appeared
2spoopy4me
Anonymous >30d ago #p25463 >>quote [AutoMod] action=keep R:9 E:8 N:7 C:9 | This post provides a solid, technical point about LuaJIT's FFI capabilities. It directly addresses the context of embedding and performance discussions well.
>>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 >30d ago #p25464 >>quote [AutoMod] action=keep R:9 E:8 N:7 C:9 | This post directly engages with the technical discussion about FFI and memory management in Lua. The argument is well-articulated and relevant to the thread's theme.
>>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 >30d ago #p25465 >>quote [AutoMod] action=keep R:9 E:8 N:7 C:9 | The post provides a concrete, relevant solution using CheatEngine as a real-world example. It directly addresses the technical challenge posed in the thread effectively.
>>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 >30d ago #p25466 >>quote [AutoMod] action=keep R:9 E:8 N:9 C:9 | This is a solid, technically dense response that directly addresses the technical query with relevant context. The links are appropriate and the explanation is concise and accurate.
>>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 >30d ago #p25467 >>quote [AutoMod] action=keep R:10 E:10 N:9 C:9 | The post is a direct, concise, and relevant response to the thread's context. It adds a sharp, relevant, and slightly provocative comment.
>>25289
the textadept creator has a degree in rocket science, not even kidding
Anonymous >30d ago #p25468 >>quote [AutoMod] action=keep R:9 E:8 N:7 C:9 | The post directly addresses the thread topic with a strong, opinionated stance. It's engaging and relevant to the discussion.
lua?
Anonymous >30d ago #p25469 >>quote [AutoMod] action=keep R:10 E:10 N:9 C:9 | A direct, enthusiastic response to the thread topic. It fits perfectly within the context of a discussion about Lua's merits.

g936zvfqiuvg1.png
>>25468
Lua!
Anonymous >30d ago #p25470 >>quote [AutoMod] action=keep R:10 E:10 N:9 C:10 | The post offers a direct, albeit dismissive, comparison between Lua and Python in a typical forum debate. It's a solid, concise response to the OP's enthusiasm.
>>25285
Sorry anon, Lua is a neat but unfortunately this is a #895129 thread so Python is preferred over any #FFFFFF language.
Anonymous >30d ago #p25471 >>quote [AutoMod] action=queue R:1 E:1 N:1 C:1 | The post is extremely short and offers no substance in the context of a discussion about Lua's utility. It is essentially noise.
>>25470
Lua is Brazillian doe
Anonymous >30d ago #p25472 >>quote [AutoMod] action=keep R:10 E:8 N:9 C:9 | The post is a direct, engaging response to the thread context. It prompts discussion effectively and fits the context perfectly.
Anonymous >30d ago #p25473 >>quote [AutoMod] action=keep R:9 E:8 N:7 C:9 | This is a solid, technical discussion about the limitations of embedding scripting languages and FFI concepts. The context is highly relevant to software architecture discussions.
>>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 >30d ago #p25474 >>quote [AutoMod] action=keep R:8 E:7 N:6 C:8 | The post engages directly with the OP's premise by offering a technical counter-argument regarding Lua's performance and size.
>>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 >30d ago #p25475 >>quote [AutoMod] action=keep R:10 E:8 N:9 C:9 | The response directly addresses the previous question with a clear and concise answer. It is a solid contribution to the technical discussion.
>>25473
>read but not write?
It can do both.
Anonymous >30d ago #p25476 >>quote [AutoMod] action=keep R:10 E:8 N:9 C:9 | The post provides a relevant link to the topic and offers a concise, thought-provoking perspective. It fits well within the context of a technical discussion.
>>25473
You might be interested in https://terralang.org/
Not a great language but a good proof of concept
Anonymous >30d ago #p25477 >>quote [AutoMod] action=keep R:10 E:10 N:9 C:9 | This is a solid, technical argument regarding Lua's memory management and interaction with C structures. The explanation is precise and directly addresses the technical nuance of the interaction.
>>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 >30d ago #p25478 >>quote [AutoMod] action=keep R:10 E:10 N:9 C:9 | This is a solid, technical response directly addressing the technical point raised in the thread. It clearly explains the underlying C concept effectively.
>>25477 (me)
obj in this case is an object with type "userdata" (not table) which is literally just a C pointer.
Anonymous >30d ago #p25479 >>quote [AutoMod] action=keep R:10 E:9 N:8 C:10 | The post is a direct response to a previous comment, engaging with the technical context effectively. It builds on the discussion well.
Anonymous >30d ago #p25480 >>quote [AutoMod] action=keep R:10 E:9 N:8 C:9 | This is a solid, concise comment that directly addresses the comparison between TypeScript and Lua for scripting tasks. It fits perfectly within the context of the thread.
>>25449
typescript and lua are good lang for slopcoding, idk why it sucked for vanilla js
Anonymous >30d ago #p25481 >>quote [AutoMod] action=keep R:10 E:8 N:7 C:9 | The post is a direct, albeit simplistic, response to the thread context. It offers a very relatable, low-effort justification for using Love2D over Pygame.
>>25285
I am using Love2D to make a game because I am too stupid to install pygame.
It is what it is.
Anonymous >30d ago #p25482 >>quote [AutoMod] action=keep R:9 E:8 N:7 C:8 | The post provides a strong, evidence-based counterargument regarding Lua's performance claims. It effectively uses external benchmarks to challenge the OP's simplistic assertion.
>>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 >30d ago #p25483 >>quote [AutoMod] action=keep R:9 E:8 N:7 C:9 | The post provides a valid, relevant counter-argument to the original thread's premise. It engages directly with the comparison between Lua and JavaScript's scoping rules.
>>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 >30d ago #p25484 >>quote [AutoMod] action=keep R:9 E:8 N:7 C:8 | This is a solid, detailed critique of Lua's object model and metatables. It dives deep into the implications of loose semantics effectively. The argument is well-supported and sophisticated for a tech forum.
>>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.
< prev
1
...
6
7
8
9
10
...
12 next >
Reply