Mike Jones asked:

 | Has anyone built any block simulators (for modeling
 | continuous electronic systems, like OP Amps, RC
 | networks, etc) in Haskell?

Johannes Waldmann added:

 | I'm also interested in this. I am thinking of
 | extending Paul Hudak's Haskore system to generate and
 | handle true audio data (instead of, or in addition to)
 | MIDI data.

Jerzy Karczmarczuk answered:

 | HAWK!!! See the Haskell Home page, you find all about.
 : 
 | DSP, audio streams, etc. Do you realize the amount of
 | data processed in order to generate 10 seconds of
 | audio stream at 96kHz of the sampling frequency?

I did not reply with *my* abvious answer: LAVA!! :-) This is
because I thought the original question was about
*continuous* systems, and Lava (and Hawk) are about
discrete/digital systems.

But if you find that the Hawk way is interesting to do these
kind of things, take a look at Lava as well. Lava has
recently gotten a major rewrite (no monads left!), and at
the moment we are evalutating the new version in a course.
One can take a preview in the Lava tutorial, available on:

  http://www.cs.chalmers.se/Cs/Grundutb/Kurser/svh/

The main difference between Hawk and Lava is the
following.

Hawk programs describe sequential systems mainly targeting
simulation (running these in Haskell). This means one can
use any Haskell datatype and function in the definition of a
system. Very powerful and expressive!

Lava programs can be simulated, but also unfolded to yield a
description of the system in a different, lower-level,
language. Examples of these languages are VHDL, 
C, EDIF, state machine notation, temporal propositional
logic, etc.

This means that the programmer is limited to use datatypes
that can be expressed in terms of basic types supported by
the target language (usually booleans and integers or
floats), and to use functions that can be expressed in terms
of basic operations on these types.

When describing a specific domain, for example gate-level
hardware, this does not seem to be too much of a problem.

It would be interesting to see if one can use the Lava
approach to describe a system that performs, say, an
algorithm on an audio stream. The algorithm would be
expressed in terms of basic operations on audio streams. 
In the end one could generate C (or so) from this
description.

If anyone is interested in doing such a thing, I would be
happy to send a preliminary version of Lava, and to
explain how it is implemented and how to modify it to
deal with other domains than digital hardware.

Regards,
Koen.

--
Koen Claessen         http://www.cs.chalmers.se/~koen     
phone:+46-31-772 5424      e-mail:[EMAIL PROTECTED]
-----------------------------------------------------
Chalmers University of Technology, Gothenburg, Sweden




Reply via email to