Skip to content

VIP3: VCL implemented VMODS

Poul-Henning Kamp edited this page Mar 7, 2016 · 1 revision

Synopsis

Allow VMOD-like packages to be built from pure VCL source code.

Depends on

VIP2: VCL typed functions

Why?

The "include" facility in VCL is purely textual, allowing such weirdness as:

if (include "foobar.vcl") {
    ...
}

This is a nice and strong mechanism, but it comes with built in limitations.

For instance we have to be very restrictive about where nested includes come from, and this makes it hard to use include for packages of VCL functionality, which cannot simply be dumped in their own subdirectory.

How?

On encountering a "import" statement which imports a VCL file rather than a VMOD, the VCC should spawn a new copy of itself that compiles the VCL code into a VMOD.

A new reserved word ("public" ?) will be necessary to mark the typed VCL functions which should be exported to the importing VCL code.

When compiling VCL into VMOD, the "include" functionality should resolve relative to the directory of the imported VCL file.

Clone this wiki locally