Git Product home page Git Product logo

Comments (3)

agocorona avatar agocorona commented on August 25, 2024

I reproduce here what I said in the chat, for documentation:

https://gitter.im/Transient-Transient-Universe-HPlay/Lobby?at=59117b408a05641b116408cd

The applicative as is defined now, the operands have no buffers. That means that if one of the operands receive events faster than the other, the events of the first will be lost and only the values that are at the time the slower operand receive a value are returned

That may be fixed using Channels instead of IORefs in the Applicative instance. But I have to take a look.

There should have been four results in the applicative expression of above, but since events happens fast, the first operand has executed 1 and 2 before the second operand begins to execute, so the only two results have 2 in the first element o the tuple.

But using channels would be problematic . Unbounded channels would produce space leaks if one of the operands do not receive any events. bounded channels either can block or can reproduce the overruns that we already have

from transient.

agocorona avatar agocorona commented on August 25, 2024

Sorry the explanation is not correct. A buffer is not necessary since the result are generated at the frequency of the fastest operand. It's all because the events of the first operand are fired before the second operand of the applicative begin to execute. All the events that happens before the first result of the second operand are lost since the second operand is empty at this time.

That is less a problem than what I supposed, but it is harder to fix.

from transient.

agocorona avatar agocorona commented on August 25, 2024

I close this for the moment since the philosphy of transient is to return what happens right now, contrary to the philosophy of standard FRP, where recording everything is essential.

The other behaviour can be solved by using a transactional buffers, like Control.Concurrent.TChan or simply using threads 0 as prefix. This should avoid asynchronous thread, so the events will not be processed in parallel.

from transient.

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.