[Haskell-cafe] feasability of implementing an awk interpreter.

Brandon S Allbery KF8NH allbery at ece.cmu.edu
Sat Aug 21 23:37:03 EDT 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 08/21/2010 11:22 PM, Bill Atkins wrote:
> I don't think Template Haskell will be essential for this - you
> will probably need a parser (probably written with Parsec), an
> eval function, and a state monad to represent imperative changes
> made by the language you're evaluating.  Template Haskell is more
> for the elimination of boilerplate code or turning specs into
> compile-time constraints.
>
> On Thursday Aug 19, 2010, at 11:05 PM, Michael Litchard wrote:
>> I'd like the community to give me feedback on the difficulty
>> level of implementing an awk interpreter. What language features
>> would be required? Specifically I'm hoping that TH is not
>> necessary because I'm nowhere near that skill level.

Something that might not be clear to a beginning Haskell programmer is
that laziness subsumes many of the things you would use macros for in
another language.  In particular, you can trivially create new
"control structures" because the code you control with them only
executes when needed.  This is why Haskell is popular for EDSLs
(embedded domain-specific languages).  Template Haskell can usually be
ignored until you're programming in the type system or other advanced
usages.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxwm14ACgkQIn7hlCsL25X+DwCfdsb+UABmQw1y9489F973EpC1
oKAAn1a2OKqrJpAzpZzUenHaP8gG6zPo
=eWBI
-----END PGP SIGNATURE-----

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20100821/4f444711/attachment.html


More information about the Haskell-Cafe mailing list