On Mon, Aug 6, 2012 at 1:17 PM, Miguel Negrao
<[email protected]> wrote:
>
> A 31/07/2012, às 15:03, Haskell Media escreveu:
>
>> Hi,
>>
>> I was wondering if there was a livecoding environment like Overtone or 
>> Impromptu but for Haskell.
>>
>> So again, I'm looking for the same type of coding environment like Impromptu:
>
> I’ve actually been wondering on how this can be done functionally
> and haven’t really figured it out. For instance the SuperCollider
> language allows to do interactive programming where you type some
> code get some sounds going and then you can change code as you go
> along. Sometimes it’s just stopping the previous sounds and starting
> new ones (easy to do in Haskell) but other times it’s more about
> changing subparts of the program which is usually done by
> re-evaluating a variable to a new value and this cannot be done in
> Haskell (can it ?).  So I’m curious how does interactive programming
> work in a functional language, specially changing just some parts of
> the program while it is running and keeping the current state of the
> program (i.e. not restarting from scratch) ?

Well, the way state updates are handled in a functional paradigm is
through "modification" of persistent data structures, i.e. building up
a new version of some state structure, and perhaps atomically updating
the identity of an object to point to the new version when it's ready.

Basically SuperCollider just sends messages to the server to update
its variables or rearrange its UGen network.  I don't see why it
shouldn't be possible to have some state monad that uses messaging to
a real-time server to ensure that the server state always reflects the
current state monad variable.  Live coding could then be done within
this monad.  This doesn't imply that old values are destroyed or
forgotten.. they may be memorized by some other part of the Haskell
program, yet the current state of the server is ensured to be
synchronized with the state of the Haskell monad by means of
"programming the semicolon" to send synchronization messages.

Just an idea.

Steve

_______________________________________________
haskell-art mailing list
[email protected]
http://lists.lurk.org/mailman/listinfo/haskell-art

Reply via email to