Blog

Quillo 0.6: private names, plugins by name, and quillo install

3 min read

Quillo 0.6 lets a file keep names to itself, takes plugin functions by name and under names of your own, installs plugins from the catalog, and drops the quotes from use.

Quillo 0.6 is out. Nothing in it breaks a program written for 0.5: every addition is something you opt into. Here is what is new.

Private names

Every file a program uses puts its names in one namespace, so a helper called total in one file clashed with a total in another, and big programs prefixed everything. Now a file keeps its helpers to itself:

// lib/cart.qweprivate let TAX = 0.12private fn total(lines: list) = sum(lines | map((l) => l.price * l.qty))public fn cart_total(lines: list) = total(lines) * (1 + TAX)

private goes before a fn, view, component or top-level let. Two files may each have a private total; another file that calls one is told it is private, and editors offer it only where it belongs. public says the default, for files that want to say what they offer.

Plugins, by name

A .qwer file is Rust whose pub fns become Quillo functions. Take only the ones you call, and give one another name when two plugins use the same:

use cache_get as redis_get, cache_set as redis_set from redisuse memcache_get as memo_get from memory_cache.qweruse csv_parse, csv_write from csv

Since then the file comes first: import redis use cache_get as redis_get. This spelling still works, with a warning, and quillo fix turns it around. See What a file sees for why.

A name a plugin does not have is an error that names the nearest it does, and two plugins exporting one name are now warned of, with the as that keeps both.

quillo install

The plugin catalog has 237 plugins: CSV and Excel, JWT and two-factor codes, QR codes and PDFs, Redis, S3 and email, search, maps and more. Each one is versioned, and built and tested before the site is published.

quillo install csv qr jwt          # into this folder, hash and version checkedquillo install --update            # what the catalog has newerquillo install --list pdf

Paths without quotes

use lib/auth.qwe, or use lib/auth for a .qwe file. Quoted paths work as they always did.

And the rest

Route groups (routes /admin | auth.required { ... }), every on the server for game loops and polls, a component's own scoped CSS, exact decimals from the database to the page, --split, --scale and --join for services, and the fixes from eight rounds of building real apps in Quillo. The changelog has them all.

Next

Before 1.0, .qwe files get modules of their own: a file sees what it imports, and names can be taken from it as they are from plugins. It will come with a quillo fix that writes the imports for you.

Upgrade: pull and build, cargo build --release. The Rust page and the structure guide cover the new parts.

The Quillo newsletterNew posts, components and plugins, about once a week. No tracking.

Thread
8Useful? Like it, or add to its thread below.

Thread 0 posts

On Quillo 0.6: private names, plugins by name, and quillo install: questions, tips, corrections, and code that uses it.

No posts yet. The first one opens the thread.