Using a parser generator in next generation VCL compiler

Poul-Henning Kamp phk at phk.freebsd.dk
Fri Dec 22 18:16:56 CET 2006


In message <20061222162936.GC3344 at pixel.global-banlist.de>, Marcus Rueckert wri
tes:

>> No I didn't, because I also don't want Varnish to depend on everything
>> and the kitchensink :-)
>
>does it really matter whether you depend on the generated source of
>lex/yacc or ragel?:)
>you can run the ragel when creating a new release so you dont need ragel
>on the build hosts.

Maybe not, but it matters to me that I depend on none of the three.

We are not talking about parsing ADA here, nor COBOL or PL/1 or for
that matter C.  We are talking about a quite small programming
language.  There is no rocket science involved.

I do realize that all of you have been brainwashed by CS professors
that yacc/lex is the holy grail of compiler construction.

But I maintain that lex or yacc would be a step backwards for VCL.

Primarily because error reporting sucks with code generated by
those, but also because of both lex and yacc loose readability once
you move from text-book examples to real-world code.

So for anybody wanting to convince me that using lex/yacc/something
else is a better path, here is the minimum hurdle to clear:

1.  At least as good and precise error reporting facilities,
    including being able to quote the source code with a
    graphical marker of the trouble spot.

2.  At least as readable and clear source code.

As to deciding if it is a worthwhile use of the projects
resources to do so, my vote is a no.  There are far more
important fish to fry.


-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.



More information about the varnish-dev mailing list