Comment

Comment by pguillory

In addition to what benjaminva said, luv uses callbacks (like Node.js), whereas this uses coroutines. So for example with luv you might do something like:

    fs.readFile(filename, function(err, data)
      -- remember to check err
    end)
With this binding the code would look like:

    local data = fs.readfile(filename)
    -- err was raised if one occurred
With coroutines, you can use exceptions and for/while loops and they continue to work as you would expect.
parent pguillory 12 years ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton