<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 -> 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 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 <dons@galois.com><br><b><span style="font-weight: bold;">To:</span></b> CK Kashyap <ck_kashyap@yahoo.com><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>> 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
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> <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>