- An internal DSL is written in an everyday language, let's assume C#, and is a constraint about the language to restrict it to domain-specific needs. Fluent NHibernate is an example of an internal DSL.
- An external DSL takes the shape of parsing code external to an everyday language, let's assume C#, which would then take action based upon the interpreted inbound data. NAnt is a good example of this. On the surface and in the strictest sense, it's just XML, but the various variations of XML nodes and tags hold functional meaning beyond what would be encompassed in a strict XML interpretation. In the case of NAnt, the markup is parsed and the parsing agent makes sense of the markup. "Regular" NHibernate is an example of an external DSL.
- One may write code for parsing on his/her own in C#.
- One may use a lexer/parser instead such as:
- yacc
- ANTLR
- Irony
- In writing Irony code in C#, one writes code that defines a parser that will parse flat files.
- Irony Grammar Explorer is a tool that allows one to test one's parser by inputting would-be text and seeing how the text ends up as:
- parse tree
- AST (Abstract Syntax Tree)
Monday, November 14, 2011
what is a DSL?
I saw Jimmy Bogard and Pedro Reys of Headspring speak on DSL (Domain Specific Languages) tonight at the Austin .NET User's Group. A domain specific language is "a computer programming language of limited expressiveness focused on a particular domain." My notes:
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment