POV-Ray : Newsgroups : povray.off-topic : Liquid Physics : Re: Liquid Physics Server Time
1 Oct 2024 15:20:44 EDT (-0400)
  Re: Liquid Physics  
From: scott
Date: 1 Apr 2008 01:50:08
Message: <47f1db20$1@news.povray.org>
> A true Haskeller would define a notionally infinite list which notionally 
> contains the entire state of the system at every future point in time. 
> Examining the elements of this list causes the integration to actually be 
> performed, and assuming you let go of the start of the list, the GC will 
> delete each state after it has been calculated.

What's that like on performance though?  What would it be like if your state 
block consisted of hundreds of 4D vectors, and the system was being updated 
at 1000 Hz?  Would the GC be noticeable?

> (You can't really speak of assigning several values to the same variable 
> "one after the other" because [pure] Haskell function don't have any 
> notion of "time".)

Ah ok I see, so it's like you every variable is defined as "const" in the 
C++ sense, you can't modify it.

>   animate state = do
>     dispaly state
>     let new_state = integrate state
>     animate new_state

I assume that the compiler is clever enough to not keep on the stack any 
data that is not needed, ie old versions of state that are no longer needed. 
If you attempted that method in C++ you would fill up the RAM very quickly 
;-)


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.