Repository navigation
Releases
Tala 0.2.0.1
Build
- The compiler builds with exactly LLVM 23.1.3 on every platform, and the
build stops with an error ifllvm-configreports any other version.
LLVM 23.1.3 with libc++ (revision 1)
LLVM 23.1.3 built with libc++ for the Linux hosts of Tala's compiler.
Only llvm-config, the headers, the static libraries for x86-64 and the CMake exports are included,
with the headers and static libraries of LLD's COFF, ELF and Mach-O linkers.
These archives are build inputs for contributors, not a Tala release.
4bc4f92ef8ef9a039d901849e28bc80412caf9a28e284a0b0890027b46bc294f llvm-23.1.3-libcxx-fedora-43-x86_64.tar.zst
564915ceb7346534ee9965eb201f024feb7d6966d471e231df9ed8b817b035e6 llvm-23.1.3-libcxx-ubuntu-26.04-x86_64.tar.zst
Tala 0.2.0
Compile times
- The frontend spends about half as long in garbage collection, with no more
memory.
Licensing
- Project files move to the Progmasoft Linking Exception, Version 2.0. Code talac
generates, TalaRT and the standard library no longer put any duty on a program
built with talac. Earlier releases can rely on Version 2.0 too.
Incremental builds
--incremental=<directory>keeps an object per source and lowers only the
sources whose code, or the signature of what they call, changed. The sources
that do change are lowered on several threads.
Linking
-
LLD's COFF, ELF and Mach-O linkers are linked into talac, which links
executables itself. A Windows executable needs nothing from the host, and
its import libraries are written by LLVM. For Linux, macOS and the BSDs
talac takes the command line of the linker fromclang -###, which knows
where the target's C library is, and runs it with LLD; withoutclang, a
target of the host is linked byccas before. Building talac needs LLD's
static libraries and headers: the LLVM release for Windows has them, the
Linux toolchain carries them from revision 2, and on macOS they are built
from the LLVM sources against Homebrew's LLVM, because Homebrew'slldhas
only shared libraries;LLD_ROOTnames them where they are not beside
LLVM. -
An executable is linked for its target rather than for the host: a Windows
executable for the machine of the target from any host, and another Linux,
macOS or BSD target throughclang --target=<triple>. The runtime of another
target is looked up inruntimes/<triple>/beside talac. -
--sysroot=<path>names the system root the linker driver links against
on Linux, macOS and the BSDs; it must be a directory. A Windows target
links no system library and refuses it, whatever the host. -
The Tala runtime is TalaRT:
talart.libandlibtalart.aas archives,
talart.dll,libtalart.soandlibtalart.dylibas shared libraries.
By default a program takes TalaRT from the shared library, which talac
copies beside it and which it finds there through its run path or the
Windows loader.--static-talart-library=truelinks the archive in
instead. -
A Windows executable defines
_fltuseditself, so code that uses floating
point links without TalaRT's archive.
Tests
- A class other than the entry may have a
Main: it is an ordinary method, and
no longer stops the build with TAL2008. A test build of a program with a
Maincompiles for the same reason. talac --testbuilds the runner of the[Fact]methods of its sources. The
runner calls every fact in source order, printsPASSorFAILwith the
name of each and the totals, and exits with1when a test failed.#expect condition;checks a condition in test code. A false one prints the
file, line and column and the text of the condition, and for a comparison
the value of each operand that is not a literal; the test goes on and fails
at its end. Each operand is evaluated once, for the comparison and the
report alike.#expectoutside a[Fact]method and outside#if Factis
an error (TAP0044), and so is#expectused as a value (TAP0055).[Fact]and[Fact("name")]mark a static, parameterlessvoidmethod as a
test (TAE0015toTAE0020for facts that cannot run).
Conditional directives
#if,#elseif,#elseand#endifchoose code for the target at the
boundaries of declarations, members and statements, withFact,os(...),
family(...),true,false,not,&&,||and parentheses. Talac
passes the target's operating system to the frontend.#regionand#endregion, with an optional name that the closing directive
may repeat.- A directive that would split an expression, an unknown system or family, a
misplaced#elseifor#elseand an unclosed group are errors (TAP0042
toTAP0052andTAP0054).#defineand its symbols and the diagnostic directives are
refused as not implemented yet (TAP0053,TAP0047).
Runtime
- The runtime catalog gains
tala_test_fail,tala_test_endand
tala_test_finish(identities 14 to 16), and the runtime exports
tala_test_status, which the process entry of a test build returns.
Optimization levels
--opt-level=sand-Osoptimize without growing the code, and
--opt-level=zand-Ozmake it as small as LLVM can. As in Clang, both
run the default pipeline over functions markedoptsize, andzalso
minsize.--opt-level=gruns the optimizations of level1, which keep a program
easy to debug, as Clang's-Ogdoes. It ran none before, like0.
LLVM 22.1.6 with libc++ (revision 2)
LLVM 22.1.6 built with libc++ for the Linux hosts of Tala's compiler.
Only llvm-config, the headers, the static libraries for x86-64 and the CMake exports are included,
with the headers and static libraries of LLD's COFF, ELF and Mach-O linkers.
These archives are build inputs for contributors, not a Tala release.
1621b84ec14bc0212b9c366df84be4d12d80235c3843402216689e0498c6169d llvm-22.1.6-libcxx-fedora-43-x86_64.tar.zst
ed9bbc64f7230a2f5955b8b433559711ff3fe34499d8aba453425b56c69d4604 llvm-22.1.6-libcxx-ubuntu-26.04-x86_64.tar.zst
Tala 0.1.0
The numbering starts again
Tala restarts its version at 0.1.0. The numbers up to 0.6.0 were inherited
from the projects Tala grew out of, X# and Visual X#. Their tags and releases
stay as they were. From now on a release of the compiler repository is tagged
tala-<version>, and the Haskell packages, talac --version and the bundle
carry the same number. The language and the compiler did not change
because of the new number: Tala 0.1.0 accepts what 0.6.0 accepted.
Packages
tala-toolingis the one compiler package that talafmt, talalint and
tala-analyzer depend on. It re-exports the six modules they use.- The shared library talac loads, its C ABI and the frontend fuzzer moved to
tala-frontend-host, which is not published.tala-syntax,
tala-frontend,tala-core,tala-compilerandtala-toolingcarry the
metadata, bounds and license files that Hackage asks for.
Building and testing
- On Linux the compiler builds with libc++ against an LLVM 22.1.6 built with
libc++, which the helpers download and check against a recorded digest. - The official hosts are the ones the workflows test: Windows 10/11 (tested on
Windows Server 2025), macOS 26 Tahoe on Apple silicon and Ubuntu 26.04 LTS.
macOS 15, macOS on Intel and Fedora 43 are no longer tested. - A pull request that changes nothing the native build reads skips the native
jobs. - The fuzzing workflow adds AFL++ with CmpLog over the wire and command-line
targets. The Go helpers present the programs they start as steps. - OSV-Scanner checks the locked dependencies. Every pinned action names its
exact version.
LLVM 22.1.6 with libc++ (revision 1)
LLVM 22.1.6 built with libc++ for the Linux hosts of Tala's compiler.
Only llvm-config, the headers, the static libraries for x86-64 and the CMake exports are included.
These archives are build inputs for contributors, not a Tala release.
5355714911c1d1dcf7f3486d2f2c0b3a468be838314fbe42b49a07b1e86db7b5 llvm-22.1.6-libcxx-fedora-43-x86_64.tar.zst
5e8a4c1f52b7d7eedf155b76bd057cec079e11daa66822d1f6af1109c551694b llvm-22.1.6-libcxx-ubuntu-26.04-x86_64.tar.zst
Tala 0.6.0 (previous numbering)
Every program does one job
The compiler compiled, evaluated projects, formatted and linted, all behind
one command with its own option style. The work is now split by program, and
every command line follows the GNU form.
talacis only the compiler.talac Program.tala --entry=Demo.Program
writesProgram.exebeside the source (no extension outside Windows; the
.vxseextension is gone). The commandscheck,build,run,test,
format,lint,resolve,update,install,viget,versionand
interactiveare removed from it. A long option takes its value after=
(--emit=core), a short one joined or after=(-O2,-O=2).
-File,-Emit,-Build,-Helpand the-W...options are replaced by
inputs on the command line,--emit,--build,--helpand--warnings.
Several inputs are one program.--emit=metadatachecks a program without building it and writes
<name>.talameta. A check of one source needs no--entry.--warnings=none|low|medium|allsets the level and--warnings=shadowasks
for the shadowing warning, which no level turns on. The option is read; the
warning itself is not in the frontend yet.- An option the compiler reads and cannot carry out yet is refused by name:
library package types,--header,--llvm-compiler=orc, LTO,--llvm-args
and LLVM IR or bitcode as input. tazelis a program of its own and runs the project commands:
check,build,run,test,lock resolve,lock create-dump,fmt,
lint,versionandhelp. It reads the project file, finds the sources
and startstalac,talafmtortalalintas separate programs. Targets
are selected with--vipkg/-p,--executable/-eand--library/-l;
what follows--goes to the program a command starts
(tazel lint -- --fix).- A project file is evaluated inside Tazel. No Kotlin installation is needed;
the earlier route needed akotlincommand that nothing installed. - A project file may be named
BUILD.kts,BUILD.tzl,BUILD.tazel,BUILD
orTazel.build; the first that exists is used. - The project DSL changed:
compiler.standard = talaStandardOf(26);
optLeveland the optimization-pass switches sit directly incompiler;
llvm { args(...) };workspace { members(); defaultMembers(); exclude() }
replacesworkspaces;localDependency,testDependencyand
localTestDependency;feature = "..."replacesoptional;
localPlugin { path }replacesplugin("local"). Removed:wexperimental,
wundef,unsafe {},typeSafeFormat,compiler.versionas a setting,
FAMILY,cfg,eprintln, the bare host constants (WINDOWS,X86_64,
...; compare withOperatingSystem.WINDOWS), andframeworkof a test
suite.OS,ARCH,panicandeprintremain. LOCK.sqlite3is lockfile format 4.tazel lock create-dumpwrites
LOCK.dump; the separatetadcprogram is removed.- A plugin JAR describes itself in
META-INF/tazel-plugin.propertiesand is
written againstcom.progmasoft.api.tazel.dsl.plugin. - Tazel refuses, by name, what cannot work yet: library targets, projects
with dependencies, test suites,vipkg create,update,installand
viget push|update. talafmtformats in place by default and takes--checkand
--emit=files|stdout|coverage|checkstyle|json;talalinttakes--fix.
-In-Place,-Dry-Run,-Fixand-List-Checksare removed. Both take
several files,--help/-hand--version/-v.talitakes--helpand-h(was-Help).- talafmt and talalint are 0.2.0, for their new command lines; the
language server tala-analyzer is 0.3.3. All three are built with the
compiler of this release.
Tala 0.5.2 (previous numbering)
Visual X# is now Tala
The language and its tools have new names. The entries below and those of
earlier releases keep the names they were written with.
- The language is Tala and its sources end in
.tala(was.vxs). - The compiler is
talac(wasvxs), the REPL istali(wasvxsi) and
takes--eval(was-Eval), the formatter istalafmt, the linter is
talalint, the language server istala-analyzer, and the build system
and package manager is Tazel, whose project file isBUILD.kts, whose
lockfile isLOCK.sqlite3and whose plugin cache is.tazel/plugins. - Directories:
Compiler/isTalac/,ProjectSystem/isTazel/, and
Analyzer/,Formatter/,Linter/areEcosystem/tala-analyzer/,
Ecosystem/talafmt/,Ecosystem/talalint/. - C++ headers are included as
Progmasoft/Tala/...and the namespace is
Progmasoft::Tala; the Haskell modules areProgmasoft.Tala.*,
Progmasoft.Talafmt.*,Progmasoft.Talalint.*and
Progmasoft.TalaAnalyzer.*; the Cabal packages aretala-syntax,
tala-frontend,tala-core,tala-compiler,tala-analyzer,talafmt
andtalalint; the Kotlin packages arecom.progmasoft.tazel.*,
com.progmasoft.talafmt,com.progmasoft.talalintand
com.progmasoft.tala.analyzer; the Go module is
github.com/Progmasoft/tala/helpers. - Binary names: the frontend library is
tala-frontend, the runtime library
istala-runtime.liborlibtala-runtime.a, exported C symbols begin with
tala_, and environment variables and macros begin withTALA_. - Diagnostic codes begin with
TA(TAT0080wasVXT0080), and the magic
numbers of the wire formats areTACR,TACP,TAPP,TAMMandTADC.
Artifacts written by an earlier compiler are not read. - The C interface is TCI, the Tala C Interface (was VXCI).
- Not yet changed: the options of
talacstill have the-Optionform and a
native executable still ends in.vxse.
Compiler
- A callable parameter written without a type, as in
\x -> x + 1, is
reported asTAT0082. Its type was left unknown, since taking it from the
place that expects the callable is not implemented, and the program was
refused only by the LLVM lowering, with an error about the backend and no
place in the source. Coverage-guided fuzzing found it; the program is kept
as a seed. - A local whose value is computed by need no longer makes a long chain of
operators slow to compile. The lowering looked through the whole operand
tree again at every operator while such a local was in scope, so the time
grew with the cube of the length of the chain: a chain of 3 940 terms that
held one division did not finish in five minutes and now takes about a
second. The lowered program is the same. Coverage-guided fuzzing found it
as a timeout; a shorter program of the same shape is kept as a seed.
Native executables
vxs buildandvxs runproduce a native executable on Linux and macOS,
as they did on Windows. The program is linked by the C compiler of the
system withlibvxs-runtime.a, which stands beside the compiler, and with
the C library; objects for ELF and Mach-O are position independent. A
program that stops is reported byvxs runas 128 and the number of the
signal that ended it.
Command line
-Filewith a path that is not well-formed UTF-8 is reported as an invalid
value. On Windows the conversion to a native path threw, andvxs, which
is built without exceptions, stopped without a diagnostic. The new
command-line seeds found it in their first campaign.
Verification and tooling
Documents/abi-manifest.jsonstates the binary interfaces of the compiler in
one place: the C functions of the frontend library and of the runtime, the
numbers they exchange, the versions of the four wire formats, and how an
executable is entered and linked.verify-abireads every entry back from
the header or source that defines it and fails on a difference in either
direction; the compiler workflows run it.prebuildandoptional-packagessupport Debian 13, with apt as on
Ubuntu. Debian's own repositories have no .NET SDK;optional-packages
says so there and installs the rest.cross-platform-testchecks a branch on the platforms a developer is not
sitting at, before a pull request exists.cistarts the compiler
workflows for the current branch, on real Windows, macOS and Linux
machines, and can follow them to their end; the workflows can now be
started by hand for that.runuses Podman containers on the developer's
machine instead, for Ubuntu 26.04 and Fedora 43: macOS and Windows do not
run in a container and are listed with the reason.prebuildnow checks
for and installs Podman.- The fuzz corpora are larger. The lexer, parser and source targets are seeded
with the Visual X# sources the repository already holds, more than two
hundred programs, read where they are. The command-line, project, REPL,
ownership and differential corpora grow from 13 seeds to 107, written in the
form each harness reads; the one command-line seed there was separated its
arguments with line breaks, which the harness does not split on, and is
replaced. - CodeQL analyses C and C++ from a real build as well. The analysis without a
build, which runs for every pull request, holds every native source but
resolved 30 percent of their includes; the newc-cpp-tracedjob observes
a Bazel compilation of every native target. It runs for the default
branch, weekly, on request, and for a pull request labelled
codeql-traced. develop analyzeruns the Clang Static Analyzer over every first-party
C++ translation unit with the command Bazel compiles it with: the stable
checkers that have to be asked for beside the default ones, and a set of
checkers still in development whose findings are reported and do not fail
the run. A new workflow runs it for every pull request and uploads the
findings, with the path of each, to code scanning.- Every command of
helpers/defines its command line with Cobra.
verify-benchmarksandverify-examplestake the checkout as--root;
their earlier-Rootand-Helpare rejected.prebuildand
optional-packagestakecheckorinstallas a command, in lower case,
and print their help when no command is given.verify-docsrejects
arguments it used to ignore. An invocation a command does not understand
fails before it reads, probes or installs anything. develop fuzz,fuzz-stressandfuzz-threadtake--seconds,--jobs,
--corpusand--target, each beside the environment variable of the same
meaning;VXS_FUZZ_TARGETSis new.develop fuzz-targetslists the targets
and their limits. A selection that names an unknown target is refused before
a build.develop sanitizerslists what each sanitizer kind is on the host, and
develop sanitize allruns every checker the host has and reports each.develop benchmarktakes--output,--filter,--repetitions,
--native-onlyand--haskell-only.develop benchmark-reportprints a
result set as a table, anddevelop benchmark-comparesets one against
another and fails when a benchmark became slower than a threshold.optional-packagessupports the hostsprebuildsupports: it now installs
on Ubuntu 26.04 LTS with apt and on Fedora 43 with dnf as well.
Visual X# 0.5.1
Language
match,ifused as a value and a loop used as a value yield strings:
String kind = match (code) { 0 -> "none", _ -> "some" };. Only the
selected result is evaluated, as for the conditional expression. A
callable result is still not lowered and reportsVXT0051orVXT0044.- A string is a subject of
match:
match (name) { "none" -> 0, "some" -> 1, _ -> 2 }. A string pattern
accepts a subject that holds the same characters, as==does. String
patterns never cover every string, so such a match needs an arm that
accepts the rest, and a pattern written twice is reported as one that can
never be selected. A number is not a pattern of a string subject, nor a
string of a numeric one (VXT0054).
Fixed
value is "text"compared the two string objects in native code and not
their characters, so it was false for every string made at run time, also
undernot,orandandand written asis == "text". The reference
evaluator of the test suite compared characters and hid it. The pattern
now lowers to the comparison==uses, and the evaluator refuses the
equality primitive on two strings so that a lowering to it fails a test.
Release
- Advanced compiler-owned Haskell packages, the CLI, Bazel module, Kotlin
project model, and compiler project version to 0.5.1.
Visual X# 0.5.0
Why 0.5.0 and not 0.4.2
The third component of the version is for a release that a program and its
build artifacts written for the one before still work with. This release is
not one:
- The language changed what existing programs mean. Evaluation is by need,
so a value nothing reads is no longer computed, and==on two strings
compares their characters where it compared the objects. match,guardandenumbecame reserved words.- Every serialized stage changed incompatibly: Core went from version 8 to
10, CorePrep to 8, Xpp and Xmm to 7. No artifact of 0.4.1 is read. - A native executable is now linked with a runtime library that ships
beside the compiler, so an installation of 0.4.1 cannot be updated by
replacing the compiler alone. - The Haskell packages of the formatter, linter and analyzer bound the
compiler below 0.5 on purpose, and their bounds move with this release.
The language also grew by more than a patch carries: evaluation by need,
match, enums, constant expressions and console output. 0.4.2 was never
published; the number is skipped, not withdrawn.
Language
- A method reference
Type::Methodis the static method as a callable
value:auto f = Counter::Next;,Apply(Counter::Next). Where the method
has overloads, the type the place expects selects one, andVXT0080
reports a place that selects none. A reference through a value,
counter::Next, reportsVXT0081until values have members. A selector
with a dot and no call,Counter.Next, stays rejected withVXT0034. - A declaration may be named through the namespace it is declared in:
insidenamespace Demo;,Demo.Program.Run()isProgram.Run(),
Demo.Color.RedisColor.RedandDemo.Program::Runis
Program::Run. A namespace of several parts is written whole. A name of
the program spelled like the first part hides the namespace. Other
namespaces, and a qualified name in a type position, are not connected. - The conditional expression selects strings:
String kind = count > 0 ? "some" : "none";. Only the selected operand
is evaluated.?:is unchanged, because its left operand is also its
test and a string is not one. - Visual X# is a lazy language with call-by-need evaluation, and the
specification now says so inSpec/Language/Evaluation.vxs: a value is
computed when it is first needed and at most once, a value that is never
needed is never computed, effects happen where they are written, and
neither thunks nor effects have any notation in the source. The compiler
implements the first part of it: a local binding ofbool, numeric or
enum type whose initializer has no effect is computed by its first read
and not at all when nothing reads it, soint x = left / right; return 5;
no longer divides. That holds in the body of a callable as in the body of
a method. An expression written as a statement, and a value assigned to
the discard, are evaluated. Results, other types and assigned
or captured variables are still computed where they are written;
Documents/EVALUATION.mdlists what is pending. - Arguments are passed by need. An argument of
bool, numeric or enum type
that has no effect is computed when the method first needs it, at most
once however often the method reads it and however many methods it is
handed through, and not at all when no method needs it:
Choose(true, 1, left / right)no longer divides whenChoosereturns
its second parameter. A value the caller needs as well is computed once
for both. An argument of a call through a callable, an argument a closure
of the method captures, and arguments of other types are still computed
at the call. - Programs write to the console.
Console.PrintandConsole.Printlnwrite
a value,Console.PrintfandConsole.Printfna format with its
conversions applied,Console.Error,Errorln,ErrorfandErrorfndo
the same to standard error, andConsole.Formatreturns the string and
writes nothing.Systemis imported implicitly, soConsoleneeds no
qualification;System.Consoleis accepted. The example
Examples/HelloWorld/HelloWorld.vxscompiles to a native executable and
runs. - A format is a string literal and is checked when the program is compiled.
The conversions are%d,%u,%x,%f,%s,%cand%b, with%n
for the line terminator of the platform and%%for a percent sign; the
flags are-,0,+, space,#and'; a width or a precision may be
written as*and is then anintargument before the value. A
conversion that does not exist, a flag a conversion does not take, a
missing or a surplus argument and an argument of the wrong type are
errors,VXT0071toVXT0079. Examples 69 to 85 of
Spec/StandardLibrary/IO/ConsoleIO.vxsstate what the specification left
open: which flags each conversion takes, that%bwrites abool, that
%frounds the exact value with a tie to the even digit, and that a line
ends with the terminator of the platform. +joins two strings, and writes a value that is not a string as text
first when the other side is one: an integer in decimal, aboolas
trueorfalse, acharas itself.+=appends to a string variable.
==and\=on two strings compare the characters they hold; before,
they compared where the strings were kept. Examples 86 to 89 of
Spec/Language/Operators.vxs.- Output is an effect, and effects are not lazy: an expression that writes,
itself or through a method it calls, is evaluated where it is written and
in the order it is written, whether or not its value is ever needed. A
value that only computes is still computed by need in the same program.
Examples 15 and 16 ofSpec/Language/Evaluation.vxs. - An integer quotient or remainder by zero and a shift by an amount that is
negative or not less than the width of the shifted value have no value,
and a program that needs one stops. Example 14 of
Spec/Language/Evaluation.vxsstates the rule. Before, generated code gave
these operations no meaning and an optimized program could run on past
them with a result that was never computed. - When one statement needs several values that cannot be computed, which
failure the program meets is not determined, and a value that runs without
end counts as one that cannot be computed. Whether the program fails is
determined, and so is the order of statements and of effects. Example 13
ofSpec/Language/Evaluation.vxsstates the rule. - Added
match. The statementmatch (subject) { pattern -> body, ... }runs
the first arm whose patterns and guard accept the subject, and does nothing
when no arm accepts. In operand positionmatchis an expression: every
arm yields a value of one type, and some arm must accept whatever the
subject is. Several subjects are writtenmatch (a), (b)with one pattern
for each in every arm. The subjects are evaluated once, left to right. - A pattern is a literal,
_, or a type followed by a name or_. A type
pattern binds the value of the subject for the guard and the body of its
arm, as an ordinary local that may be assigned. An arm may have a guard,pattern if condition ->,
which is evaluated only when the patterns of that arm accept. - An arm that can never be selected is an error: a second arm for the same
literals, or any arm after one that accepts every value without a guard. - Added
ifas an expression:int larger = if (a > b) { a } else { b };.
Both blocks are required and each ends with an expression that has no
semicolon. Only the selected block runs. As the last item of a block that
is used as a value, anifwith two such blocks and amatchare the
value of that block. - The comma after a match arm is optional, as in the grammar. A
parenthesized pattern that follows an expression body without a comma is
read as a call of that body;VXP0038is reported at the arrow after it. - Added
guard (condition) else { ... }. The block runs when the condition is
false and must leave the enclosing scope withreturn,breakor
continue. - Added the block statement: a
{ ... }at the start of a statement is a
nested block. The names it declares end with it, so two blocks side by side
may declare the same name. matchandguardare now reserved words and can no longer name a local,
a parameter, a method or a class.- Subjects and results of
matchand results ofifexpressions are limited
tobooland numeric types for now. Thenullpattern, enum case patterns
such as.Ready, type patterns that name another type than their
subject's, and a binding in the condition ofif,guardorwhileare
recognized and rejected with dedicated diagnostics until reference
subjects, enums, class hierarchies and optional values exist. - A numeric constant pattern may be negative:
-1 -> .... The minus sign
belongs to the numeric literal; no other expression is a pattern. The
constant is checked against the type of its subject, so the most negative
value of a signed type is a pattern and a negative constant for an
unsigned subject is rejected. - A block used as a value may leave instead of yielding a value.
return
leaves the enclosing method andbreakandcontinuetarget the loop
around the expression, under the rules they have anywhere else. A block
that leaves has no value; the expression has the type of the blocks that
complete. An expression none of whose blocks completes is valid: it never
yields a value, what would have received the value is not lowered, and no
result slot or placeholder is created for it. - Such a block may stand in a loop header and in a loop used as an
expression. The condition and the update clause belong to their loop: a
breakin either leaves that loop; acontinuein the condition
evaluates the condition again without running the body or the u...