May Waste

What Vela has today that may not earn its place: words and forms to keep an eye on, and to merge or drop if they never find a use of their own.

Vela means to stay small, and a small language pays for every word it keeps. Each entry here is built and works; none is a mistake. Each is here because today it does little that something else doesn't already do, or because it is one of several ways to write the same thing. Nothing on this page changes the language: it is a list to come back to, so that what never earns a use of its own can go before programs lean on it.

How to read the marks. watch keeps it and looks again once programs use it; merge means several forms could become one; drop? means it may go if nothing needs it. A mark is a note, not a decision: each change is a breaking one and is asked about first.

Words a type asks for

same watch

<T: same> lets a task that takes types compare its values with == (see Generics). Since == came to compare every type by its own rule (see Comparing): numbers by value, text by its bytes, pointers and slices by what they point to, and arrays, shapes and tuples by where they are, almost every type is same. What is left out is a maybe of its own (a kind that carries one compares it), a value that can fail (T ~ E), a region, and a kind that carries a value that can fail.

Why it may waste
A word that nearly every type has says little: most bodies could compare their values without it, and a missing same is mostly a word to type, not a mistake caught.
Why it stays
It is the one thing between a task's body and a maybe or a failing value compared by mistake, and a shape of your own may one day say it is not same (see Future). same means == and never similarity; that is similar.
What would settle it
If shapes never come to choose their own words, same could be what every type but those few has without writing it, as a type has str by default.

similar watch

<T: similar> lets a body compare its values item by item with ~= and <>. The two words take nearly the same types: similar takes a maybe too, and same takes an array, a shape, or a tuple holding a value that can fail, which == compares by where it is without reading it.

Why it may waste
Two words that let in nearly the same types could be one.
Why it stays
They ask for different costs: == is cheap and ~= grows with the value, and the word says which a body means to pay for.

frozen watch

<T: frozen> lets a body put a T in a tuple, whose items never change, so the type holds nothing that changes through a pointer, a slice, or an array.

Why it may waste
It is needed only by a task that takes types and makes a tuple of them, which is rare.
Why it stays
Without it, a tuple built in such a task could hold what changes, which the tuple's own rule refuses everywhere else.

Several ways to write one thing

Five ways to make text of a value merge

x.str() at r
x.str()@r
x.str(r)
text(x) at r
text(x)@r

All five are the same call (see Values as text): at r and @r are how every call that takes its region last is written, and text(x) names the type the value becomes, as int(x) and float(x) do.

Why it may waste
A reader meets five spellings of one thing, and the guide spends words on each.
Why it stays for now
Each follows a rule that holds elsewhere: @r inside a + chain, the region in the parentheses for any task, and text(x) beside int(x). Dropping one breaks the rule it follows, not only the form.
What would settle it
Which forms programs actually use. If text(x) is never written, it can go; if x.str(r) is, the region after the call could be the only other form.

new T(v) at r and new@r T(v) merge

Both copy a value into a region (see Regions) and mean exactly the same.

Why it may waste
Two spellings of one thing, which the guide and Studio each have to know.
Why it stays for now
new@r reads well inside a longer line, as @r does after a call; if the region after a call settles on one form, new follows it.

!= and <> beside not watch

a != b is not (a == b), and a <> b is not (a ~= b).

Why it may waste
Each is a shorthand for what not already says. <> also has a second job: it is read as the empty types of Box<> and first<>(x), which the parser and Studio must tell apart.
Why it stays
Both are asked for often enough to earn a symbol, and each pairs with the symbol it negates.

Parameters

fixed x: T parameters watch

A fixed x: T parameter is always a copy, and a plain x: T is a copy too unless the value takes more than 64 bytes, when the compiler reads it where the caller keeps it (see Parameters that read). The two differ only for a large value, and only where the body reads where the value is: == on it, or &x.

Why it may waste
For a value of 64 bytes or less, fixed x and x give the same program, and for a larger one fixed x costs a copy the compiler would have saved. Most of its use may be to silence the warning, which ~= does too.
Why it stays
It is the one way to say "a place of its own" when a body compares by where a value is; without it, what x == y means would rest on a size.

Reading what the compiler knows

x.type watch

x.type is the type of a value as text, known to the compiler (see The type of a value).

Why it may waste
Outside a task that takes types, the type is written in the code already, so .type is mostly for looking at a program, not for what it does; it also takes type as a reserved word, which no field or variable can be called.
Why it stays
In a task that takes types, it says which type a use gave, which nothing else does.

Showing an address, show(&x) watch

&x can be shown and turned into text as well as compared (see Addresses).

Why it may waste
An address differs with every run, so a program's output that shows one can never be tested for; it serves looking into a program, and &a == &b is what a program decides with.
Why it stays
Seeing where two names point is how aliasing, hidden parameters, and references are understood, and it costs one writer.

Adding to this page

An entry names the feature, links to where the guide explains it, and says three things: why it may waste, why it stays, and, where it is known, what would settle it. When a feature here is dropped or merged, its entry says so and when, and links to the change; when it finds a use of its own, the entry goes.