Code Monkey home page Code Monkey logo

Comments (13)

stefanpenner avatar stefanpenner commented on May 19, 2024

@salomvary ooo, I want to make this work.

from es6-promise.

stefanpenner avatar stefanpenner commented on May 19, 2024

issue opened on parent project: tildeio/rsvp.js#330

I'll have this sorted out by the end of the weekend.

from es6-promise.

salomvary avatar salomvary commented on May 19, 2024

@stefanpenner fyi i'm using this to polyfill setTimeout https://gist.github.com/salomvary/5a295d32e0868ffde42a
(I have no idea how good it is though. There should probably be a better way of doing it.)

from es6-promise.

stefanpenner avatar stefanpenner commented on May 19, 2024

looks like platform has a hook for next micro task.

from es6-promise.

stefanpenner avatar stefanpenner commented on May 19, 2024

tildeio/rsvp.js#334 i'll bring that over here after i fix + update the build tooling

from es6-promise.

stefanpenner avatar stefanpenner commented on May 19, 2024

@salomvary so, I'm dubious of this. Nashorn doesn't have the same run to completion model that essentially all other JavaScript environments have. The threading model allows virtually all of our code to be re-entrant. I don't believe we can reasonable ensure correctness if threads are being used without much more effort.

I am open to suggestions or ideas on this..

from es6-promise.

salomvary avatar salomvary commented on May 19, 2024

Even Oracle is warning us on correctness when it comes to threading vs. nashorn. I'm not an expert of the field, can't give better suggestions atm

from es6-promise.

stefanpenner avatar stefanpenner commented on May 19, 2024

this requires some additional runtime guarantees, we likely need to run all code touching promises in something that ensures run-to-completion.

Maybe someone smarter then I has some ideas, but i believe this is out-of-scope of this project for now.

Will reopen if some reasonable solution exists, but I believe this requires a runtime to wrap the code interacting with promises. Which likely would be another project itself

from es6-promise.

salomvary avatar salomvary commented on May 19, 2024

Maybe someone smarter then I has some ideas, but i believe this is out-of-scope of this project for now.

Maybe someone from the Oracle team has recommendations? @szegedi wdyt?

from es6-promise.

stefanpenner avatar stefanpenner commented on May 19, 2024

I am very open to recommendations :)

from es6-promise.

maximenajim avatar maximenajim commented on May 19, 2024

Thanks, @stefanpenner, for looking into this. Have you by chance seen this talk by @william-tran about server-side JavaScript with Nashorn and Spring? https://youtu.be/kVyVyRdxwxE?t=1h17m37s
They seem to have a working solution for JavaScript promises in Nashorn (unfortunately, this project remains closed-source - awaiting sponsorship).

from es6-promise.

h0ru5 avatar h0ru5 commented on May 19, 2024

any news on this? said talk pointed towards ListenableFuture, but I did not get it to work...

from es6-promise.

stefanpenner avatar stefanpenner commented on May 19, 2024

@h0ru5 no, as mentioned above we could provide a serializable/thread-safe runtime around/integrated into nashorn to enable this, but I am unaware of something we can use today.

The introduction of real threads in nashorn, really makes it incompatible with vast amounts of existing JavaScript.

Although the above sounds like fun to implement, I really can't justify the time right now (non of my responsibilities have need for it)

from es6-promise.

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.