Bluejack ([info]bluujack) wrote,
@ 2009-03-07 20:34:00
Previous Entry  Add to memories!  Tell a Friend  Next Entry
Beware. Extra geeky.
I really should have separate blogs for separate subjects, I think. This is totally unrelated to anything most people who occasionally read this blog have any interest in, I'm sure.

But I need to vent.

I have a hunch that there's a single, evil mind behind three of the most venerable tools in the GNU family: Make, Flex, and Bison. (Curse you, Richard Stallman!) Certainly, all three of them share this in common:

* They have lots of documentation, none of which ever answers the question you're trying to find.
* They require the brain to think non-linearly, and to make non-obvious leaps of faith.

Since these are programming tools we're talking about, you will need to make a lot of non-obvious leaps of faith that result in very obvious thumps on the ground before you finally happen upon the correct answer.

In particular, I am currently trying to build something using Flex and Bison (AKA, lex and yacc), which involves using the "start condition" feature. These are poorly explained in the documentation, and do not provide get-you-going examples. Worst of all, the examples they do provide do not demonstrate the correct mechanism for marrying Flex, Bison, and start conditions.

So, I spent three hours attempting to figure out how to parse and pass a quoted string containing escape characters from flex to bison.

By the time I got it figured out, I had resorted to all sorts of hideous global variables to maintain state across multiple regular expression matches within the various rules of the start condition.

Lex and yacc are widely regarded as the tools to use when writing a compiler, but they feel like the kind of gruesomely hackish software a junior high school student might use to throw together a tetris demo. Obviously, a fiendishly clever kid, but I'm afraid we just can't give you more than a C, for this one. Maybe a C++.



(Read 6 comments) - (Post a new comment)

Geekmate on the C++ joke
(Anonymous)
2009-03-08 06:01 am UTC (link)
Bluntmon,

This be Doug.

I was just exchanged pleasantries with a friend about a geeky C++ joke I came across in The Computer Contradictionary by Stan Kelly-Bootle. Chris Hecker is the main programmer of Spore and one of my patrons.

Here is the email thread, so read it backwards.
---
Chris Hecker wrote:

Ah, found it:

http://books.google.com/books?id=tZKCZje8178C&printsec=frontcover&dq=computer+contradictionary#PPA33,M1

So, the original letter I wrote him had that, and then it had another snark in it, because he was talking about OOP and mentioning Bjarne Stroustrup and Bertrand Meyer, and I mentioned a concept and then said something like, "I'm not sure where this concept originated, whether it was BS or BM, but anyway..." Best programming/scat joke ever.

Chris

Doug Sharp wrote:
> You didn't know???
>
> Second edition 1995:
> "Thus, following Christopher Hecker, we can define class Language and
> overload the prefix and postfix Language::operator++:
> Language& Language::operator++()
> {
> BetterSelf();
> return(*this);
> }
> Inline Language& Language::operator++(int dumm) {
> Return(++(*this));
> }
> Language C, X;
> X= C++; // X is enhanced C and Bjarne's your Uncle!
>
> Hecker has therefore proposed, without hopes of general acceptance,
> that the language be called C.operator++(dummy)."
>
> About 1/3 of Bootle's C++ entry is your little jape.
>
> Smash the state!
>
> Doug
>
>> -----Original Message-----
>> From: Chris Hecker [mailto:XXX]
>> Sent: Sunday, January 18, 2009 3:00 PM
>> To: Doug Sharp
>> Subject: Re: Thanks again
>>
>> > I was reading Stan Kelly-Bootles Computer Contradictionary and
>> came > across your leetle ++C joke. Teefrigginghee.
>>
>> No way, is it in there? I used to have the original copy of the Unix
>> Review, but I can't find it. I love SKB.
>>
>> Chris
>>
>> Doug Sharp wrote:
>>> Chris,
>>>
>>> I was reading Stan Kelly-Bootles Computer Contradictionary and came
>>> across your leetle ++C joke. Teefrigginghee.
>>>
>>> Thanks,
>>>
>>> Doug
>>>
>

(Reply to this) (Parent)(Thread)

Re: Geekmate on the C++ joke
[info]bluujack
2009-03-08 08:41 am UTC (link)
Ha! Fun stuff.

I also was grooving on the C+-, next entry in the contradictionary.

(Reply to this) (Parent)


(Read 6 comments) - (Post a new comment)

Create an Account
Forgot your login or password?
Login w/ OpenID
English • Español • Deutsch • Русский…