>Lua is so heckin fast brozzzz. >is actually slower than PHP. >is actually slower than JS

>Lua is so heckin fast brozzzz
>is actually slower than PHP
>is actually slower than JS

Shopping Cart Returner Shirt $21.68

Nothing Ever Happens Shirt $21.68

Shopping Cart Returner Shirt $21.68

  1. 1 month ago
    Anonymous

    performance depends on the implementation

    • 1 month ago
      Anonymous

      LuaJIT is very fast.

  2. 1 month ago
    Anonymous

    Have you tried not being shit at coding in LUA?

  3. 1 month ago
    Anonymous

    Is this bad code?
    https://github.com/neeshy/picochan

    • 1 month ago
      Anonymous

      I would get a real web framework tbh

      • 1 month ago
        Anonymous

        >I would get a real web framework tbh
        Which would you suggest? I found some written in PHP, Perl. Trying to find a chan written in Rust.

    • 1 month ago
      Anonymous

      yes. goddamn you are absolutely shit at coding in LUA... you don't need to define every fricking local for fricks sake. This isn't C, as long as dependancies are met, let the LUA handlers handle themselves. Stop trying to "optimize" and let LUA do the heavy lifting.

      • 1 month ago
        Anonymous

        Say what ?

      • 1 month ago
        Anonymous

        >you don't need to define every fricking local for fricks sake
        this is like lua optimization 101 man

        • 1 month ago
          Anonymous

          yes. goddamn you are absolutely shit at coding in LUA... you don't need to define every fricking local for fricks sake. This isn't C, as long as dependancies are met, let the LUA handlers handle themselves. Stop trying to "optimize" and let LUA do the heavy lifting.

          locals have nothing to do with optimization
          they're about preventing collisions in the global namespace

          • 1 month ago
            Anonymous

            Not only what anon said, but locals avoid repeatedly hashing tables which also improves performance.
            Linked is about Gmod but it has a lot of general Lua examples (like using table.insert vs table[#table+1]) as well.
            https://github.com/OverlordAkise/gmod-lua-performance?tab=readme-ov-file#local-vs-global-variable-speed

          • 1 month ago
            Anonymous

            i was going to say the same thing about locals and perf. locals are on the stack so access is just indexing so much more performant.
            however, there are a limit to number of locals in any function: 200.
            (due to the way the register-based VM is designed)

      • 1 month ago
        Anonymous

        [...]
        locals have nothing to do with optimization
        they're about preventing collisions in the global namespace

        This isn't true. Without local the variable is part of the global table, which requires a hash lookup on every use. Using local defines it as variable on the stack, which doesn't need a lookup.

        • 1 month ago
          Anonymous

          I'm not disagreeing, but I'm going to need to see some real proof and profiling.
          Hash lookup is O(1) and Lua's hash table implementation is very efficient.
          I'm far more worried about collisions for program correctness, and also type checks could be slower. In a JIT I imagine the difference is more substantial, with type checks being the slowdown, but I'd need to see real hard data.

          • 1 month ago
            Anonymous

            >some real proof and profiling.
            You can make your own trivial benchmark.
            >Hash lookup is O(1)
            Only in the best case and there's still constant overhead. A "local" is just a register index in the byte code.
            >I'm far more worried about collisions for program correctness,
            That speaks in favor of "local" though.

          • 1 month ago
            Anonymous

            >That speaks in favor of "local" though.
            Yes. Hence
            >I'm not disagreeing
            Using locals is obviously best practice.

          • 1 month ago
            Anonymous

            I believe non jit bytecode for indexing something global in an expression is equivalent to indexing it, assigning it to a local (within the same scope, not hoisted in any way) and then using it in an expression.

    • 1 month ago
      Anonymous

      nice project, is it yours? what features it has so far?

    • 1 month ago
      Anonymous

      Im installing it

    • 1 month ago
      Anonymous

      Load the file to claude.ai and ask for improvements that can be made

      • 1 month ago
        Anonymous

        >Competency crisis

      • 1 month ago
        Anonymous

        >asks for your email
        closed the page right here

    • 1 month ago
      Anonymous

      done listen to this moron:

      yes. goddamn you are absolutely shit at coding in LUA... you don't need to define every fricking local for fricks sake. This isn't C, as long as dependancies are met, let the LUA handlers handle themselves. Stop trying to "optimize" and let LUA do the heavy lifting.

      everything in lua should be defined local unless it needs to be global. There is absolutely a difference in performance and also you don't want to trash the global namespace.
      I have written a lua disassembler and a c# bytecode to lua bytecode translator

      • 1 month ago
        Anonymous

        >also you don't want to trash the global namespace.
        This, even if there wasn't a difference in performance you still wouldn't want to just shit up the global namespace. This is fricking scope 101.

  4. 1 month ago
    Anonymous

    >comparing Lua to PHP
    First sign you want to put a square peg into a round hole.

    • 1 month ago
      Anonymous

      both are good at scripting. php-cli is a thing for long long time

      • 1 month ago
        Anonymous

        No, lua is not. It is for embedded scripting within other programs and applications. Anything else is memers getting out of hand.

        • 1 month ago
          Anonymous

          ????

    • 1 month ago
      Anonymous

      I have trouble fitting in.

  5. 1 month ago
    Anonymous

    Can ChatGPT Quantum AI Optimize my LUA into Quantum Optimized AI Assembly?

    • 1 month ago
      Anonymous

      Absolutely! ChatGPT Quantum AI employs cutting-edge quantum algorithms and artificial intelligence techniques to optimize LUA code into Quantum Optimized AI Assembly, harnessing the power of quantum computing to achieve unparalleled performance enhancements. By leveraging quantum entanglement and superposition, our advanced algorithms restructure the code at the atomic level, enhancing computational efficiency and unlocking new realms of optimization potential. With ChatGPT Quantum AI, your LUA code transcends conventional limitations, paving the way for transformative advancements in quantum-optimized AI assembly.

  6. 1 month ago
    Anonymous

    Nobody said it's fast. Only LuaJIT is fast, at its time it could beat the big JS engines and rival C in some cases. Lua's strong suit is that it's small and easy to embed. moron.

    • 1 month ago
      Anonymous

      LuaJIT still beats JS engines.
      Only artificial benchmarks made by Google disagree.
      Try it yourself.

  7. 1 month ago
    Anonymous

    I still don’t get if I should use standard lua or luajit. I also don’t get any of the 3rd party libs - I checked one of them and there’s like hordes of posts complaining you need to be a rocket scientist to figure out how to get it all installed.

    Great language to embed though.

    • 1 month ago
      Anonymous

      luajit is the fast one that games tend to use with a good FFI library
      it's the one used by things like openresty
      >I also don’t get any of the 3rd party libs - I checked one of them and there’s like hordes of posts complaining you need to be a rocket scientist to figure out how to get it all installed.
      most of them you need to know how to build C libraries so that makes sense, it's probably way too challenging for the kind of pythonlet who immediately defers to third party libs

    • 1 month ago
      Anonymous

      Standard Lua is interpreted (slow) and you have to write these annoying wrapper functions around whatever C functions you want to call. LuaJIT is JIT compiled (fast) and has a C FFI library that can take standard C declarations and generate Lua functions from them, and basically auto dlsym/GetProcAddress them from the current process as long as they're exported in the symbol table. Standard Lua's advantage is that it's very small and portable compared to LuaJIT.

  8. 1 month ago
    Anonymous

    >counts from 1
    Into the trash it goes.

    • 1 month ago
      Anonymous

      That's just the custom, you can change it if you like. No different from Fortran.

      • 1 month ago
        Anonymous

        that's such a load of horseshit
        I bet you actually believe that
        stupid FRICKING luatard
        nobody does that because it makes your code incompatible with practically every example you might find on the internet
        sounds like fricking fun
        but nah bro you can totally just flip a switch and lua is 0-indexed

        • 1 month ago
          Anonymous

          >example you find on the internet
          If you weren't such a shit programmer you wouldn't need to rely on copy-pasting some shit code you found on the internet.
          Also it takes like 10 fricking seconds to swap shit from 0 to 1 or vice versa you pseud.

          • 1 month ago
            Anonymous

            bullshit
            disingenuous homosexual
            go on, wallow in your terrible 1-indexed meme lang
            feed the delusion

          • 1 month ago
            Anonymous

            >bullshit
            Legitimate skill issue if you struggle to comprehend how to transform 0 to 1 indexes. This is something even the most basic shit-for-brains programmer can do.

        • 1 month ago
          Anonymous

          function iter (a, i)
          i = i + 1
          local v = a[i]
          if v then
          return i, v
          end
          end

          function ipairs (a)
          return iter, a, -1
          end

          local arr = {[0]="anon", "is", "a", "homosexual"}

          for _, v in ipairs(arr) do
          print(v)
          end

  9. 1 month ago
    Anonymous

    What does g think of Luau?

  10. 1 month ago
    Anonymous

    Lua is actually faster than Rust bro

    • 1 month ago
      Anonymous

      Strange, almost every benchmark of luajit than I find is slower than Python, but this is pretty fast.

      • 1 month ago
        Anonymous

        show your benchmarks

      • 1 month ago
        Anonymous

        frick are you moronic?
        what a stupid lie
        luajit compiles to ASM you dipshit
        it's going to be leagues faster than interpreted nonsense like python, even if it wasn't really well made it would be closer to the same category as C# and java

        • 1 month ago
          Anonymous

          and the baseline luajit interpreter is in hand written assembly. gotta wonder what he's looking at. maybe some graalvm implementation of python no one uses?

          • 1 month ago
            Anonymous

            oh is that what dynasm lib is for?
            neat
            i was wondering why that was in the codebase

        • 1 month ago
          Anonymous

          and the baseline luajit interpreter is in hand written assembly. gotta wonder what he's looking at. maybe some graalvm implementation of python no one uses?

          Everything compiles down to machine code, through ASM.
          Of course an interpreter has some overhead but there is much more to the speed difference than that.

          Is this bad code?
          https://github.com/neeshy/picochan

          function html.cfinish()
          html.container.finish()
          html.finish()
          end

          function html.list.finish()
          printf("</ul>")
          end

          Way too many small functions that do nothing.

          • 1 month ago
            Anonymous

            Interpretation is not JIT, they are different technologies.
            have a nice day, codelet moron.

          • 1 month ago
            Anonymous

            LuaJIT is actually a trace compiler, which AFAIK means it executes the code first, and then generates code that only does what's in the trace. If the code, at runtime, deviates from the trace, it falls back to interpretation. For example, an inner loop may add numbers to a variable. The JIT will compile it to use a register for addition, and a type check for the input. If the input isn't a number at any point of execution, it falls back to interpretation.
            My superficial understanding of this may be wrong, though.

          • 1 month ago
            Anonymous

            No shit they are different. But they are both interpreters. JiT is actually just a minor detail, the difference is the interpreter either interprets a split second before, or it interprets "just in time".

        • 1 month ago
          Anonymous

          The real funny thing is that many tried to do the same with Python (including Googler). But Python as a language is so fricked that it's incredibly hard to optimize.

          • 1 month ago
            Anonymous

            The thing about python is that you are, in the majority of circumstances, just using it to call to something in C. It's good for gluing things together. Lua is a good embedded language.

  11. 1 month ago
    Anonymous

    op is either not using lua jit or is a homosexual

  12. 1 month ago
    Anonymous

    >not using luajit
    Sounds like the problem is with you.

  13. 1 month ago
    Anonymous

    >muh performance
    Get over yourself kids.
    Lua is cool and expressive.
    If you want fast use java or go.

Your email address will not be published. Required fields are marked *