Skip to content

Releases: gwf/x2c

v0.15.1

Choose a tag to compare

@github-actions github-actions released this 18 Oct 03:09

Install or upgrade:

curl -fsSL https://x2c-lang.dev/install.sh | sh

A patch release of 0.15.0. Existing installations upgrade in place; no
packages need rebuilding.

  • An uncaught error prints one line naming the error, the raising function
    and location, and its details, then aborts with the same status. The
    full logger event remains available with X2C_DEBUG or a <log> policy.
    See Handlers and policy.
  • $auto on a local that is already managed is a compile-time error
    instead of a crash at scope exit.
  • The REPL continues a list literal across lines, and code it loads
    boxes classes, expands its own meta functions, and calls protocol
    defaults as an ordinary build does.
  • REPL input and compiled prompt functions can call C's printf and
    puts. See the REPL guide.
  • The book gains this release notes page, and the repository gains a
    security policy, a pull request template, and a bug report template.

Full notes: https://x2c-lang.dev/docs/reference/release-notes.html


Source aa2b9b2; candidate candidate-aa2b9b2575297711e5978acc53f87bd7f645f3c7-39090113132-1.

v0.15.0

Choose a tag to compare

@github-actions github-actions released this 17 Oct 03:06

Install or upgrade:

curl -fsSL https://x2c-lang.dev/install.sh | sh

Releases ship for macOS arm64 and x86_64 and Linux aarch64 and x86_64, with
the book as a PDF beside the archives. Read
Upgrading from 0.14.0
before replacing an existing prefix.

Language

  • meta functions run ordinary x2c during translation. A macro body calls
    one with $helper(...), passes constants or captured syntax, and inserts
    the code it returns. meta.x supplies the Code and Type operations
    for inspecting and building code. See
    Meta Functions and
    Generating Code.
  • Macro values: a macro can select, apply, and collect cases as values,
    and typed quotations with expression holes build code with its type.
  • Stmt macros accept an expression body, and a macro call may begin with
    a dotted name.
  • Module blocks split one translation unit across a directory. The new
    module storage class is visible in every member file; static stays
    private to its file.
  • Indentation syntax: a .xp file, or #pragma indent in a .x file,
    groups statements by indentation without braces or semicolons. See
    Indentation Syntax.
  • raise is a statement head, catch accepts patterns as codes, and a
    variable may supply a raise code.
  • Optional reference parameters, GNU statement expressions, threaded
    thread-local storage, and the contextual in membership operator.
  • class types gain alloc and a refusing init, and init takes
    constructor arguments.
  • Twelve language features moved out of the compiler kernel into
    components under src/components/; their behavior is unchanged.

Library

  • lib/regex.x adds regular expressions over the bytes of a String, and
    every x2c script can use them.
  • lib/diff.x computes line differences between two texts.
  • The runtime's canonical pool operations moved from List to Pool.
  • Var.truth replaces Var.truthy; List.reduce, Array.reduce, and
    Iter.reduce are removed in favor of Iter.foldl.
  • Compile-time Lisp gains tail calls and a bounded call depth.

Commands and packages

  • x2c new creates a starter project that builds and runs.
  • x2c repl is a shipped command with line editing, grammar-aware and
    semantic completion, and named inspection of session values. It
    evaluates a supported subset of the language. See
    Experimental REPL.
  • Package management, the editor adapter, and project creation are
    external commands under libexec/x2c/. x2c lint and x2c graph are
    shipped as experimental.
  • Packages record native arguments in <name>.native.rsp instead of
    <name>.link. Rebuild source packages and replace native bundles.
  • Automatic differentiation moved from the runtime to the optional
    autodiff package; import "autodiff" supplies its types and macros.
  • The SQLite package renames Statement to Prepared and
    Var.statement to Var.prepared.
  • Every package manages its handles with $auto, so connections, loops,
    images, documents, and terminals release at scope exit.
  • The C* verification package is removed.

Documentation

  • The book adds the x2c Syntax Map for C
    readers, the syntax specifications with a source
    grammar and lexical rules, The Region Model, and
    chapters for meta functions, generating code, the REPL, and indentation.
  • The language reference was corrected against the implementation and
    its repeated rules removed.
  • The public site at x2c-lang.dev carries the
    book under /docs/.

Fixed defects

  • A return inside a defer or finally body leaves its exception frame
    before transferring, so a later raise in the caller is caught.
  • Macro bindings retained across package builds, nested empty unit
    macros, quotation members and splices, and template members in
    anonymous aggregates expand correctly.
  • Parameter redeclaration inside callable bodies and the author-binding
    extern regression are fixed.
  • Constructed raw string segments, nested string literals inside list
    literals, and negative percent literals in every radix are read as
    written.
  • Pointer arithmetic over pointer typedefs and casts to template typedefs
    type correctly.
  • Project meta payloads, include handling, the failure cache, and host
    flags are repaired for package builds.

Source 3149948; candidate candidate-314994819f7fad4f4d97c6df9cf622aa7edec575-38995554323-1.

x2c 0.14.0

Choose a tag to compare

@github-actions github-actions released this 17 Sep 00:49
155e847

Install or upgrade:

curl -fsSL https://x2c-lang.dev/install.sh | sh

x2c 0.13.0

Choose a tag to compare

@github-actions github-actions released this 15 Sep 23:41
3930cf8

Install or upgrade:

curl -fsSL https://x2c-lang.dev/install.sh | sh

x2c 0.12.1

Choose a tag to compare

@github-actions github-actions released this 15 Sep 18:21

Install or upgrade:

curl -fsSL https://x2c-lang.dev/install.sh | sh

x2c 0.12.0 - First public preview

Pre-release

Choose a tag to compare

@gwf gwf released this 06 Sep 16:21
c88a56b

x2c 0.12.0 - First public preview

x2c extends C with dynamic values, collections, pattern matching, scoped allocation, exceptions, threads, and Lisp. The compiler and runtime are written in x2c and compile to C.

Recommended: the full repository

Start with the website and installation instructions, book, and full repository. The repository includes runnable examples, documentation, and all seven optional C-library packages: pcre2, yyjson, libcurl, termbox2, blis, libuv, and raylib. GitHub's source archives below contain the tagged repository.

For fun only: Cosmopolitan bootstrap experiment

The optional x2c.com download is an experiment for fun only, not a substitute for the full repository and not the recommended installation. It bundles enough source and headers to bootstrap a minimal native compiler and runtime using a local C toolchain. It does not include examples, the book, or optional packages.

SHA256SUMS contains the SHA-256 checksum for the executable. After checking it, you can try:

chmod +x x2c.com
./x2c.com bootstrap --prefix "$HOME/.local/x2c"

This requires a GCC- or Clang-compatible C compiler and an archiver. Mac and Linux native installation have been tested. Windows native installation remains unfinished. The raylib package's tested profile is software-image rendering, not a desktop window.

This is the first public preview; language and library compatibility may evolve.