Have you seen the Haskell School of Expression book by Paul Hudak? <br><br>The book is available on line, Ch 9 and 10 talks about music.<br><br><a href="http://plucky.cs.yale.edu/cs431/HaskoreSoeV-0.7.pdf">http://plucky.cs.yale.edu/cs431/HaskoreSoeV-0.7.pdf</a><br>
<br>Daryoush<br><br><br><br><div class="gmail_quote">On Mon, Nov 16, 2009 at 3:16 AM, CK Kashyap <span dir="ltr"><<a href="mailto:ck_kashyap@yahoo.com">ck_kashyap@yahoo.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><div>Thanks Don,<br><br>I read the PDF. I was not able to figure out how to get the BASIC module. Wanted to see a reference implementation.<br>
<br>The DSL I want to start with is a music generation DSL ... It should generate a wave file<br>with music data as input -> for example the input could contain<br>C3 D3 E3 ... -> should output a wave file with those notes ... some kind of mnemonics for tempo will also be there.<br>
Later I'd like to incorporate parallel sequence generation -> where I could get chord effect etc ...<br>I had done a rudimentary implementation in C a while back -> <br><span><a href="http://kashyap-1978.tripod.com/Escapades/Goodies/Construct_WAV.html" target="_blank">http://kashyap-1978.tripod.com/Escapades/Goodies/Construct_WAV.html</a></span><br>
<br>I'd appreciate
it very much if you could give me some pointers on getting started.<br><br></div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">Regards,<br><font color="#888888">Kashyap<br></font><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt;">
<div class="hm"><font face="Tahoma" size="2"><hr size="1"><b><span style="font-weight: bold;">From:</span></b> Don Stewart <<a href="mailto:dons@galois.com" target="_blank">dons@galois.com</a>><br><b><span style="font-weight: bold;">To:</span></b> CK Kashyap <<a href="mailto:ck_kashyap@yahoo.com" target="_blank">ck_kashyap@yahoo.com</a>><br>
<b><span style="font-weight: bold;">Cc:</span></b> <a href="mailto:haskell-cafe@haskell.org" target="_blank">haskell-cafe@haskell.org</a><br><b><span style="font-weight: bold;">Sent:</span></b> Mon, November 16, 2009 12:57:54 AM<br>
<b><span style="font-weight: bold;">Subject:</span></b> Re: [Haskell-cafe] DSL in Haskell<br></font></div><div class="im"><br>
ck_kashyap:<br>> Hi All,<br>> I was reading a Ruby book and in that it was mentioned that its capability to<br>> dynamically query and modify classes makes it suitable for implementing DSL's<br>> ... I am referring to Ruby's reflection and methods like "method_missing" here.<br>
> It can allow things like not having to define constants for all possible<br>> unicode code points etc...For example, first use of U0123 could bring such a<br>> constant definition into existence etc<br>> <br>
> I see multiple search hits when I look for Haskell and DSL - can someone please<br>> point me to a good primer or explain to me how equivalent of above mentioned<br>> features in Ruby can be done in Haskell ... or the Haskell alternative for it.<br>
<br>The Haskell equivalent would be overloading, primarily via type classes.<br><br>See Lennart Augusston's BASIC for an example of this in the extreme:<br><br><span> <a href="http://augustss.blogspot.com/2009/02/more-basic-not-that-anybody-should-care.html" target="_blank">http://augustss.blogspot.com/2009/02/more-basic-not-that-anybody-should-care.html</a></span><br>
<br>That's BASIC syntax, in Haskell, relying on overloading numbers, strings<br>etc. And all statically typed.<br><br>For a survey of some of the more recent EDSLs in Haskell, see this brief<br>overview,<br><br><span> <a href="http://www.galois.com/%7Edons/papers/stewart-2009-edsls.pdf" target="_blank">http://www.galois.com/~dons/papers/stewart-2009-edsls.pdf</a></span><br>
<br>-- Don<br></div></div></div>
</div><br>
</div><br>_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
<br></blockquote></div><br><br>