Coder Social home page Coder Social logo

Lua 5.1 + coco patch supported? about cqueues HOT 4 CLOSED

wahern avatar wahern commented on July 16, 2024
Lua 5.1 + coco patch supported?

from cqueues.

Comments (4)

daurnimator avatar daurnimator commented on July 16, 2024

As cqueues is targetted at working whether lua is embedded, or extended, users probably don't have the power to modify their lua installation.

In any case, the are few places in cqueues that a yield is inside of an iterator

  • socket:lines()
  • socket:accept()

It could be useful as a footnote, but as it is only relevant to an old lua release, I'm not sure if it makes sense going forward...

from cqueues.

wahern avatar wahern commented on July 16, 2024

On Wed, Jan 07, 2015 at 01:12:15AM -0800, Anders Bergh wrote:

The documentation says:

1.2.1 LuaJIT, Lua 5.2, Lua 5.3

cqueues principally targets Lua 5.2 and above. It???s not fully portable
to Lua 5.1 because cqueues relies on ephemeron tables to prevent
coroutine/controller reference cycles, and because Lua 5.1 does not
support yielding from metamethods and iterators. LuaJIT removes the
latter of these handicaps, and so cqueues targets LuaJIT secondarily.

Lua 5.1 with Coco (by the LuaJIT author himself) also removes the yield from metamethod/iterator handicap. Should the documentation mention this?

Lua 5.1 with Coco isn't technically Lua 5.1, it's a patched Lua 5.1. I'm
reticent to mention that it might work with a patched version of Lua. My
intention was to leave it implied that if a patched version can do the
things mentioned, it might work, but the burden is on the user to ensure
compatibility.

Even better IMO than Coco, which plays games with the C stack, is Rici
Lake's yieldable for loops patch:

http://lua-users.org/wiki/YieldableForLoops

Mike Pall adopted this approach for LuaJIT 2.0 and dropped Coco.

cqueues might work with a Lua 5.1 patched with Rici's code. I haven't tried,
though.

I'm not actually sure if cqueues still yields from any metamethods. That
part I might need to remove.

from cqueues.

daurnimator avatar daurnimator commented on July 16, 2024

btw, another 5.1 feature missing is __gc on tables. This particularly matters in dns.resolvers.lua

from cqueues.

wahern avatar wahern commented on July 16, 2024

Closing for now because nothing concrete to resolve.

from cqueues.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.