VCL language

Anders Berg andersb at
Tue Mar 28 00:42:12 CEST 2006


seeing that Poul-Henning is back to the VCL compiler again in the code, I
think it is time to start a more detailed discussion about the VCL.

My guess is that we are gonna spend "alot" of time on it, and it could be
a natural part of a face-to-face meeting. I also acknowledge that the
sooner we "freeze" the language, the easier and less rewrite of code
Poul-Henning has to do.

I think our small "proof-of-concept" and the general look-and-feel of VCL,
will make it suitable and _really_ good for Varnish. As my footnote on the
Object part of: states, I was having some
problems getting the hang of the Object part. I later posted some of the
"problems" I had in:
(talk about of-topic topic :))

I/We haven't gotten down to trying/thinking/poking/defining/documenting
the VCL yet, but I _think_ I might have come up with a "system" to make
VCL easier to understand, and possible easier to code both for
Poul-Henning and the end user. I am attaching 2 documents:
vcl_diagram_v1.png and vcl_diagram_proposal.png (*v1 is approx. what we
have today)

Not gonna spend to much time discussing details here, but the main idea is
to have the first part of the "variable" name tell you if this is a
backend variable or a client variable.

Also, the object (document if you like) has 2 sets of variables. For
example I think that backend.obj.usage and client.obj.usage makes sense.
Lets say it's a number/factor to say how often this object is
used/refreshed. A JPEG will have a low backend.obj.usage (since it typical
is not often requested from backend) but client.obj.usage will be high
(because its requested often, logo etc...). I can also think of more uses

I have left out to define more variables in vcl_diagram_proposal.png, but
here are some examples of other "new" areas of variables:

if ( ~{ =

This is rewrite :)

if (backend.res.error = 503){
    client.res.error = 404

useful? Anyway, I am sure there are variables we need to be able to play
with in both backend.res and client.res. client.res.error is btw the same
as error in "v1" of VCL.

Anyone think this might be a good way to "split" VCL up and make easier?

I know you already have done alot of work in the VCL compiler
Poul-Henning, and I hope/guess that to much time hasn't been "wasted".

Anders Berg
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vcl_diagram_v1.png
Type: image/x-png
Size: 54533 bytes
Desc: not available
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vcl_diagram_proposal.png
Type: image/x-png
Size: 61537 bytes
Desc: not available
URL: <>

More information about the varnish-dev mailing list