|Subject:||Re: [Haskell-cafe] A question on DSL's|
|From:||John Van Enk|
|Date:||Mon, 4 Jan 2010 12:21:06 -0500|
To start with, can you clarify that you are looking for an Embedded DSL (sometimes called Light Weight DSL)?
A _proper_ DSL has its own interpreter/compiler where an EDSL/LwDSL leverages the compiler of a host language (in this case, Haskell).
Assuming you're referring to an EDSL, I'll respond. :)
I don't think the second option is ever used. Modifying the compiler backend doesn't seem to make a lot of sense to me. I'm not aware of any circumstance where this has been done.
Your first option is closer. Generally, when emitting some sort of target code from a large EDSL, you'll have two stages. Your first takes the embedded syntax of your EDSL and converts it to an Abstract Syntax Tree. Your second stage accepts the AST as input and emits target code.
Take Tom Hawkins' Atom EDSL as an example. When we write Atom code, we're building up an AST. After the AST is built up, the "compile" function converts the AST to C code.
For smaller EDSLs, it's more than possible to have the functions themselves emit the code we're after (rather than relying on an AST and compile function).
Is this what you're looking for?
On Mon, Jan 4, 2010 at 12:14 PM, CK Kashyap <[email protected]> wrote:
_______________________________________________ Haskell-Cafe mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell-cafe
|<Prev in Thread]||Current Thread||[Next in Thread>|
|Previous by Date:||Re: [Haskell-cafe] A question on DSL's, Jasper Van der Jeugt|
|Next by Date:||Re: [Haskell-cafe] A question on DSL's, CK Kashyap|
|Previous by Thread:||Re: [Haskell-cafe] A question on DSL's, Tom Hawkins|
|Next by Thread:||Re: [Haskell-cafe] A question on DSL's, CK Kashyap|
|Indexes:||[Date] [Thread] [Top] [All Lists]|