Lambda the Ultimate

inactiveTopic An AWK to C++ Translator
started 3/17/2003; 6:15:49 AM - last post 3/17/2003; 8:21:01 AM
Ehud Lamm - An AWK to C++ Translator  blueArrow
3/17/2003; 6:15:49 AM (reads: 1666, responses: 2)
An AWK to C++ Translator
Brian Kernighan. An AWK to C++ Translator. Usenix C++ 1991

So you built a DSL, but now you want to extend programs written in your DSL by combining them with code in some standard langauge.

Sounds like a plausible scenario?

Well, Brian had a go at translating AWK into C++. It wasn't an easy task. Read the paper for the details.

The paper makes for interesting reading. It was written when C++ was a young language. The paper even concludes with remarks about the numbers of bugs in cfront Brian encountered

The benchmark information at the end of paper is also interesting. It seems that in many cases translation into C++ didn't improve running times that much.

And oh, AWK libraries are one of my known favorites. I implemented them in several languages, and I always underesitamte the effort this requires ( Olin has a nice Scsh version so why build others, you ask. Well, call me a fanatic.)

Posted to general by Ehud Lamm on 3/17/03; 6:18:29 AM

Florian Hars - Re: An AWK to C++ Translator  blueArrow
3/17/2003; 7:47:13 AM (reads: 682, responses: 1)
I just found a related project: awka (while I was looking for an URL for the obwious question: But does it compile awklisp?). akwa seems to be anything from quite a lot faster to significantly slower if compared to different awk interpreters, depending on the code.

Ehud Lamm - Re: An AWK to C++ Translator  blueArrow
3/17/2003; 8:21:01 AM (reads: 713, responses: 0)
Perhaps the most important point about bwk's paper is that he wanted readable (and maintainable) C++.

Thus his program is not simply a compiler, but rather a source to source translator.