Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8903503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T01:53:07+00:00 2026-06-15T01:53:07+00:00

With examples can someone demonstrate how lazy evaluation is different than reactive programming. Alternatively,

  • 0

With examples can someone demonstrate how lazy evaluation is different than reactive programming. Alternatively, are they very similar?


Given c = 3; both approaches would seem to involve implementing b = c + 2; at least internally regardless of how the code looks as int b() {return c + 2;}. In both cases it’s not known what b is until its value is required, then the calculation occurs.

What would the name be that describes this approach?


So reactive programming uses or simulates lazy evaluation? Languages with lazy evaluation are programmed in a reactive way?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T01:53:09+00:00Added an answer on June 15, 2026 at 1:53 am

    You seem to be confusing lazy evaluation and reactive programming as being at the same “logical level.”

    To me, lazy evaluation is a language facility that allows the existence and manipulation of infinite data. (Data that has a sort of “finite structure” but is infinite in the sense that you can pull off as much as you want and still have some left over.) If you scratch your head a bit and try some examples, you will see that having lazy evaluation is good in the presence of infinite data structures because you don’t “loop forever” when using these values. (Though there are other uses for lazy evaluation as well, there are certainly some performance gains to be had at times.)

    Wikipedia defines reactive programming:

    In computing, reactive programming is a programming paradigm oriented around data flows and the propagation of change. This means that it should be possible to express static or dynamic data flows with ease in the programming languages used, and that the underlying execution model will automatically propagate changes through the data flow.

    To me, this doesn’t really go with lazy evaluation at all. Lazy evaluation just means that you only compute as much of an answer as you need to do more work, and then keep around a holder (typically called a “thunk”) that will let you do more work when you need it so you can compute more answers. (By the way, this ability to pull off “as much as you need” is exactly what allows you to play with infinite data using lazy evaluation.)

    By contrast, reactive programming allows you to define — succinctly — how data flows will be propagated. (For example, a reactive framework would let you set up that example you gave without explicitly having to implement it using callbacks and function pointers.) But in reality, this line is very fuzzy. There are certainly reactive frameworks in imperative languages: most people will call GUI frameworks reactive.

    By contrast, in functional reactive programming(FRP), you declaratively specify reactive data. This is implemented “under the hood” using the laziness of the Haskell language (in that particular case) because that is the method most amenable to doing updates (since it most directly fits that paradigm).

    But in language like C or C++, you typically do reactive programming via function pointers or callbacks, without an explicit notion of lazy evaluation. Sure, there will probably be some laziness under the hood to support this kind of stuff, but you aren’t really at the right semantic level to make that distinction, and in this case you can usually use lazy ‘tricks’ to speed up the reactive framework (which ostensibly updates something — say the GUI — on demand as the user uses more pieces of it).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can someone point me to examples of multiparadigm (object-functional) programming in F#? I am
Can someone give an example for finding greatest common divisor algorithm for more than
can someone please give me some examples where enumeration is used? i dont understand
I can only find mod rewrite examples/tutorials for query's, so can someone help me
Can someone give me a simple example of a AnnotatedTimeLine visualization? All the examples
Can someone provide practical, everyday examples of event bubbling and event capturing in jQuery/javascript?
Can someone show me an example which demonstrates the different behavior of these two
Can someone give some examples of using weak references in .net projects ?
In many iOS books and tutorials they demonstrate how in interface builder you can
Can someone point me out to some C# code examples or provide some code,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.