Skip to content
This repository was archived by the owner on Nov 15, 2026. It is now read-only.

Releases

Tala 0.2.0.1

Choose a tag to compare

@Leitwolf11 Leitwolf11 released this 06 Nov 06:48
21e201b

Build

  • The compiler builds with exactly LLVM 23.1.3 on every platform, and the
    build stops with an error if llvm-config reports any other version.

LLVM 23.1.3 with libc++ (revision 1)

Pre-release

Choose a tag to compare

@github-actions github-actions released this 01 Nov 23:57
a04b5fe

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

Choose a tag to compare

@Leitwolf11 Leitwolf11 released this 31 Oct 22:40
b2c5a98

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 from clang -###, which knows
    where the target's C library is, and runs it with LLD; without clang, a
    target of the host is linked by cc as 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's lld has
    only shared libraries; LLD_ROOT names 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 through clang --target=<triple>. The runtime of another
    target is looked up in runtimes/<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.lib and libtalart.a as archives,
    talart.dll, libtalart.so and libtalart.dylib as 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=true links the archive in
    instead.

  • A Windows executable defines _fltused itself, 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
    Main compiles for the same reason.
  • talac --test builds the runner of the [Fact] methods of its sources. The
    runner calls every fact in source order, prints PASS or FAIL with the
    name of each and the totals, and exits with 1 when 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. #expect outside a [Fact] method and outside #if Fact is
    an error (TAP0044), and so is #expect used as a value (TAP0055).
  • [Fact] and [Fact("name")] mark a static, parameterless void method as a
    test (TAE0015 to TAE0020 for facts that cannot run).

Conditional directives

  • #if, #elseif, #else and #endif choose code for the target at the
    boundaries of declarations, members and statements, with Fact, os(...),
    family(...), true, false, not, &&, || and parentheses. Talac
    passes the target's operating system to the frontend.
  • #region and #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 #elseif or #else and an unclosed group are errors (TAP0042
    to TAP0052 and TAP0054). #define and its symbols and the diagnostic directives are
    refused as not implemented yet (TAP0053, TAP0047).

Runtime

  • The runtime catalog gains tala_test_fail, tala_test_end and
    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=s and -Os optimize without growing the code, and
    --opt-level=z and -Oz make it as small as LLVM can. As in Clang, both
    run the default pipeline over functions marked optsize, and z also
    minsize.
  • --opt-level=g runs the optimizations of level 1, which keep a program
    easy to debug, as Clang's -Og does. It ran none before, like 0.

LLVM 22.1.6 with libc++ (revision 2)

Pre-release

Choose a tag to compare

@github-actions github-actions released this 30 Oct 18:13
becd6b6

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

Choose a tag to compare

@Leitwolf11 Leitwolf11 released this 18 Oct 18:04
45cc3c3

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-tooling is 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-compiler and tala-tooling carry 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)

Pre-release

Choose a tag to compare

@github-actions github-actions released this 16 Oct 05:13
2fbb934

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)

Choose a tag to compare

@Leitwolf11 Leitwolf11 released this 16 Oct 04:17
e5408a1

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.

  • talac is only the compiler. talac Program.tala --entry=Demo.Program
    writes Program.exe beside the source (no extension outside Windows; the
    .vxse extension is gone). The commands check, build, run, test,
    format, lint, resolve, update, install, viget, version and
    interactive are removed from it. A long option takes its value after =
    (--emit=core), a short one joined or after = (-O2, -O=2).
    -File, -Emit, -Build, -Help and the -W... options are replaced by
    inputs on the command line, --emit, --build, --help and --warnings.
    Several inputs are one program.
  • --emit=metadata checks a program without building it and writes
    <name>.talameta. A check of one source needs no --entry.
  • --warnings=none|low|medium|all sets the level and --warnings=shadow asks
    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.
  • tazel is a program of its own and runs the project commands:
    check, build, run, test, lock resolve, lock create-dump, fmt,
    lint, version and help. It reads the project file, finds the sources
    and starts talac, talafmt or talalint as separate programs. Targets
    are selected with --vipkg/-p, --executable/-e and --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 a kotlin command that nothing installed.
  • A project file may be named BUILD.kts, BUILD.tzl, BUILD.tazel, BUILD
    or Tazel.build; the first that exists is used.
  • The project DSL changed: compiler.standard = talaStandardOf(26);
    optLevel and the optimization-pass switches sit directly in compiler;
    llvm { args(...) }; workspace { members(); defaultMembers(); exclude() }
    replaces workspaces; localDependency, testDependency and
    localTestDependency; feature = "..." replaces optional;
    localPlugin { path } replaces plugin("local"). Removed: wexperimental,
    wundef, unsafe {}, typeSafeFormat, compiler.version as a setting,
    FAMILY, cfg, eprintln, the bare host constants (WINDOWS, X86_64,
    ...; compare with OperatingSystem.WINDOWS), and framework of a test
    suite. OS, ARCH, panic and eprint remain.
  • LOCK.sqlite3 is lockfile format 4. tazel lock create-dump writes
    LOCK.dump; the separate tadc program is removed.
  • A plugin JAR describes itself in META-INF/tazel-plugin.properties and is
    written against com.progmasoft.api.tazel.dsl.plugin.
  • Tazel refuses, by name, what cannot work yet: library targets, projects
    with dependencies, test suites, vipkg create, update, install and
    viget push|update.
  • talafmt formats in place by default and takes --check and
    --emit=files|stdout|coverage|checkstyle|json; talalint takes --fix.
    -In-Place, -Dry-Run, -Fix and -List-Checks are removed. Both take
    several files, --help/-h and --version/-v.
  • tali takes --help and -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)

Choose a tag to compare

@Leitwolf11 Leitwolf11 released this 12 Oct 04:24
ad930c5

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 (was vxs), the REPL is tali (was vxsi) and
    takes --eval (was -Eval), the formatter is talafmt, the linter is
    talalint, the language server is tala-analyzer, and the build system
    and package manager is Tazel, whose project file is BUILD.kts, whose
    lockfile is LOCK.sqlite3 and whose plugin cache is .tazel/plugins.
  • Directories: Compiler/ is Talac/, ProjectSystem/ is Tazel/, and
    Analyzer/, Formatter/, Linter/ are Ecosystem/tala-analyzer/,
    Ecosystem/talafmt/, Ecosystem/talalint/.
  • C++ headers are included as Progmasoft/Tala/... and the namespace is
    Progmasoft::Tala; the Haskell modules are Progmasoft.Tala.*,
    Progmasoft.Talafmt.*, Progmasoft.Talalint.* and
    Progmasoft.TalaAnalyzer.*; the Cabal packages are tala-syntax,
    tala-frontend, tala-core, tala-compiler, tala-analyzer, talafmt
    and talalint; the Kotlin packages are com.progmasoft.tazel.*,
    com.progmasoft.talafmt, com.progmasoft.talalint and
    com.progmasoft.tala.analyzer; the Go module is
    github.com/Progmasoft/tala/helpers.
  • Binary names: the frontend library is tala-frontend, the runtime library
    is tala-runtime.lib or libtala-runtime.a, exported C symbols begin with
    tala_, and environment variables and macros begin with TALA_.
  • Diagnostic codes begin with TA (TAT0080 was VXT0080), and the magic
    numbers of the wire formats are TACR, TACP, TAPP, TAMM and TADC.
    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 talac still have the -Option form and a
    native executable still ends in .vxse.

Compiler

  • A callable parameter written without a type, as in \x -> x + 1, is
    reported as TAT0082. 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 build and vxs run produce a native executable on Linux and macOS,
    as they did on Windows. The program is linked by the C compiler of the
    system with libvxs-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 by vxs run as 128 and the number of the
    signal that ended it.

Command line

  • -File with a path that is not well-formed UTF-8 is reported as an invalid
    value. On Windows the conversion to a native path threw, and vxs, 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.json states 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-abi reads every entry back from
    the header or source that defines it and fails on a difference in either
    direction; the compiler workflows run it.
  • prebuild and optional-packages support 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-test checks a branch on the platforms a developer is not
    sitting at, before a pull request exists. ci starts 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. run uses 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. prebuild now 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 new c-cpp-traced job 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 analyze runs 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-benchmarks and verify-examples take the checkout as --root;
    their earlier -Root and -Help are rejected. prebuild and
    optional-packages take check or install as a command, in lower case,
    and print their help when no command is given. verify-docs rejects
    arguments it used to ignore. An invocation a command does not understand
    fails before it reads, probes or installs anything.
  • develop fuzz, fuzz-stress and fuzz-thread take --seconds, --jobs,
    --corpus and --target, each beside the environment variable of the same
    meaning; VXS_FUZZ_TARGETS is new. develop fuzz-targets lists the targets
    and their limits. A selection that names an unknown target is refused before
    a build.
  • develop sanitizers lists what each sanitizer kind is on the host, and
    develop sanitize all runs every checker the host has and reports each.
  • develop benchmark takes --output, --filter, --repetitions,
    --native-only and --haskell-only. develop benchmark-report prints a
    result set as a table, and develop benchmark-compare sets one against
    another and fails when a benchmark became slower than a threshold.
  • optional-packages supports the hosts prebuild supports: it now installs
    on Ubuntu 26.04 LTS with apt and on Fedora 43 with dnf as well.

Visual X# 0.5.1

Choose a tag to compare

@Leitwolf11 Leitwolf11 released this 10 Oct 20:04
69993e3

Language

  • match, if used 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 reports VXT0051 or VXT0044.
  • 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
    under not, or and and and written as is == "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

Choose a tag to compare

@Leitwolf11 Leitwolf11 released this 10 Oct 08:48
1b6d85b

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, guard and enum became 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::Method is 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, and VXT0080
    reports a place that selects none. A reference through a value,
    counter::Next, reports VXT0081 until values have members. A selector
    with a dot and no call, Counter.Next, stays rejected with VXT0034.
  • A declaration may be named through the namespace it is declared in:
    inside namespace Demo;, Demo.Program.Run() is Program.Run(),
    Demo.Color.Red is Color.Red and Demo.Program::Run is
    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 in Spec/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 of bool, numeric or
    enum type whose initializer has no effect is computed by its first read
    and not at all when nothing reads it, so int 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.md lists 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 when Choose returns
    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.Print and Console.Println write
    a value, Console.Printf and Console.Printfn a format with its
    conversions applied, Console.Error, Errorln, Errorf and Errorfn do
    the same to standard error, and Console.Format returns the string and
    writes nothing. System is imported implicitly, so Console needs no
    qualification; System.Console is accepted. The example
    Examples/HelloWorld/HelloWorld.vxs compiles 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, %c and %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 an int argument 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, VXT0071 to VXT0079. Examples 69 to 85 of
    Spec/StandardLibrary/IO/ConsoleIO.vxs state what the specification left
    open: which flags each conversion takes, that %b writes a bool, that
    %f rounds 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, a bool as
    true or false, a char as 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 of Spec/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.vxs states 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
    of Spec/Language/Evaluation.vxs states the rule.
  • Added match. The statement match (subject) { pattern -> body, ... } runs
    the first arm whose patterns and guard accept the subject, and does nothing
    when no arm accepts. In operand position match is an expression: every
    arm yields a value of one type, and some arm must accept whatever the
    subject is. Several subjects are written match (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 if as 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, an if with two such blocks and a match are 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; VXP0038 is reported at the arrow after it.
  • Added guard (condition) else { ... }. The block runs when the condition is
    false and must leave the enclosing scope with return, break or
    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.
  • match and guard are now reserved words and can no longer name a local,
    a parameter, a method or a class.
  • Subjects and results of match and results of if expressions are limited
    to bool and numeric types for now. The null pattern, enum case patterns
    such as .Ready, type patterns that name another type than their
    subject's, and a binding in the condition of if, guard or while are
    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 and break and continue target 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
    break in either leaves that loop; a continue in the condition
    evaluates the condition again without running the body or the u...
Read more