GithubHelp home page GithubHelp logo

coio's People

Contributors

nelsonxb avatar

Watchers

 avatar

coio's Issues

(Discuss) Explicit awaiting on API functions

In Lua, any function on the coroutine's stack can yield. It is possible to write a function that yields without the caller knowing it does this. In some ways, this is excellent. It means we are able to write a library that does async IO, and use other existing libraries that think they are using another blocking IO library.

However, one could imagine a case where one thread yields unexpectedly, while some shared variable is in an inconsistent state. We've suddenly run ourselves into a thread-safety situation, which async programmers may not be aware could happen (I've read a lot of people go on about how async programming avoids the problems with thread safety). You could very well argue that it's just straight careless to code in such a way as to allow this to happen, but you could also argue that it's not our place to assume our users are careful.

This idea hadn't occurred to me until I started this project, and I've been working with async happenings in JavaScript for quite some time. But, in JS, all async stuff is explicit. You always know when something is going to cause your algorithm to pause, because the language offers no ability to do otherwise. It is entirely possible that this explicitness will make someone realise at some point that they have to be careful.

So, here's the dilemma: should this API be such that we try to be explicit (like JavaScript's async/await), or do we keep with the benefits of allowing it to be implicit and just deal with the consequences carefully? Or is there a way to get the best of both worlds?

P.S.: If you happen to stumble upon this project before I answer this question myself, please be civil. It's so easy to get polarised when a yes/no question is asked, but refusing to see the situation from the other side never helps.

Building on Windows

So now I have this building on both Linux and Mac (thanks to LuaRocks' built-in build system), but I have neither the system nor the expertise to ensure it works on Windows.

I'm welcoming input on this, and if any modifications to the rockspec are required then PR's are also welcome.

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.