<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><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 -&gt; for example the input could contain<br>C3 D3 E3 ... -&gt; 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 -&gt; where I could get chord effect etc ...<br>I had done a rudimentary implementation in C a while back -&gt; <br><span><a target="_blank" href="http://kashyap-1978.tripod.com/Escapades/Goodies/Construct_WAV.html">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>Kashyap<br><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"><font face="Tahoma" size="2"><hr size="1"><b><span style="font-weight: bold;">From:</span></b> Don Stewart &lt;dons@galois.com&gt;<br><b><span style="font-weight: bold;">To:</span></b> CK Kashyap &lt;ck_kashyap@yahoo.com&gt;<br><b><span style="font-weight: bold;">Cc:</span></b> haskell-cafe@haskell.org<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><br>
ck_kashyap:<br>&gt; Hi All,<br>&gt; I was reading a Ruby book and in that it was mentioned that its capability to<br>&gt; dynamically query and modify classes makes it suitable for implementing DSL's<br>&gt; ... I am referring to Ruby's reflection and methods like "method_missing" here.<br>&gt; It can allow things like not having to define constants for all possible<br>&gt; unicode code points etc...For example, first use of U0123 could bring such a<br>&gt; constant definition into existence etc<br>&gt; <br>&gt; I see multiple search hits when I look for Haskell and DSL - can someone please<br>&gt; point me to a good primer or explain to me how equivalent of above mentioned<br>&gt; 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>&nbsp; &nbsp; <a
 target="_blank" href="http://augustss.blogspot.com/2009/02/more-basic-not-that-anybody-should-care.html">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>&nbsp; &nbsp; <a target="_blank" href="http://www.galois.com/%7Edons/papers/stewart-2009-edsls.pdf">http://www.galois.com/~dons/papers/stewart-2009-edsls.pdf</a></span><br><br>-- Don<br></div></div>
<!-- cg19.c4.mail.gq1.yahoo.com compressed/chunked Mon Nov  9 09:29:38 PST 2009 -->
</div><br>

      </body></html>