[Haskell-cafe] feasability of implementing an awk interpreter.
Brandon S Allbery KF8NH
allbery at ece.cmu.edu
Thu Aug 19 23:54:31 EDT 2010
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 08/19/2010 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.
At most TH might save you a little boilerplate, but I don't think
there would be enough to bother with it anyway.
It should be fairly straightforward to implement in terms of state
transformers atop IO for the runtime part, and any reasonable parser
framework would do for the program-parsing phase. The hardest part is
probably working out how you want to represent the state of the awk
engine (variables; input line and fields; "compiled" program fragments
and the patterns they're attached to; etc.)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkxt/HYACgkQIn7hlCsL25X3XwCfW7iw6RZM2r6nDynrNLZ2sAqQ
PBMAnRJM/zcyRaZWumuBNytCNRUWGcvE
=xrvu
-----END PGP SIGNATURE-----
More information about the Haskell-Cafe
mailing list