Giter Club home page Giter Club logo

.github's Introduction

rfcs

Create an issue for the library/idea that you'd like to see, we'll discuss it and there's a high chance that we are going to implement it! Thanks :)

Tiny libraries

.github's People

Contributors

aslemammad avatar

Stargazers

Rózsa Zoltán avatar Andy Lu avatar Neos21 avatar Marcelo Dias avatar Emin Gasimov avatar  avatar Sadegh Barati avatar Asım Tahir avatar  avatar

Watchers

 avatar  avatar

.github's Issues

Successor to greenlet()?

I'd be intrigued to see (and help make) something like a combination of https://github.com/developit/greenlet (but more modern) with https://github.com/un-ts/synckit (but simpler)

Something so that I can do:

import { greenlet, yellowlet } from "tinylet"

// runs in Worker thread
// supports ALL transferable objects (not just some like https://github.com/developit/greenlet)
const f = greenlet((a, b) => {
  let n = 0;
  for (let i = 0; i < a; i++) {
    n += b;
  }
});
console.log(await f(100, 6))

// runs in Worker thread
// uses SharedArrayBuffer Atomics.wait()
// only works in an existing Worker thread or Node.js (Node.js allows main thread Atomics.wait())
// async => sync
const g = yellowlet(async (u) => {
  const response = await fetch(u)
  return await response.text()
})
console.log(g("https://jsonplaceholder.typicode.com/todos/1"))

A critical feature could be preserving import() statements so that you can do something like this and have it actually work:

const f = greenlet(async () => {
  const { doThing } = await import("./thing.js")
  return doThing()
})

console.log(await f())

I don't know how feasible that is. 🤔

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.