Skip to content

v0.7.0

Choose a tag to compare

@github-actions github-actions released this 16 Jun 13:28
· 1057 commits to main since this release

Added

  • Call chaining recv.name(args). A . attached to a form, then a name and
    an attached (, rewrites the receiver into the call's first argument:
    1.increment() reads as (increment, 1), and
    foo(1 2 3).bar(4 5 6).baz(7 8 9) as
    (baz, (bar, (foo, 1, 2, 3), 4, 5, 6), 7, 8, 9). Chains fold left-to-right.
    This is pure reader rewriting, not method dispatch — 1.increment() is
    exactly increment(1). Like the attachment rule it is whitespace-sensitive:
    the ., name, and ( must each abut the token before them. (1.5 is still a
    decimal — a . is only a chain dot when no digit follows.)

Changed

  • TitleCase macro sugar no longer spreads internal capitals. A TitleCase
    head is now lower-cased whole before gaining its -MACRO suffix, instead of
    inserting a hyphen at each interior capital: DefMacro ↦ defmacro-MACRO and
    DefType ↦ deftype-MACRO (previously def-macro-MACRO / def-type-MACRO),
    while single-word heads like If ↦ if-MACRO are unchanged. A multi-word
    user macro must now be defined under the single lower-case word it is invoked
    as — e.g. define DefMacro trylet … and invoke it as TryLet … (previously
    DefMacro try-let …). Detection is unchanged: a token is a macro head when it
    starts with a capital and contains at least one lower-case letter.
  • Function calls are now WAVE tuples with the head first. foo(1 "baz")
    reads and prints as (foo, 1, "baz") (previously the variant case foo
    carrying a payload). Special forms and macros share the shape: If c t e is
    (if-MACRO, c, t, e), and If(c t e) reads identically. Evaluating any
    parenthesized form is a call — its head is resolved and applied to the bundled
    arguments (0 ⇒ the empty tuple, 1 ⇒ that value, ≥2 ⇒ a tuple) — so a literal
    tuple value now comes only from Quote or a builtin. (foo) is a
    zero-argument call (parenthesized grouping is gone), and () is the empty
    tuple (an error if evaluated). form-kind reports tup for a quoted call;
    call is now only a runtime variant carrying a payload (ok(1)).
  • wavelet read now defaults to stdin when given no file argument. echo '...' | wavelet read reads the program from standard input; passing a path
    still reads that file. Previously stdin required an explicit /dev/stdin.

Removed

  • List and record call sugar foo[a b] and foo{k: v}. Write foo([a b])
    and foo({k: v}) instead. Only ( attaches to a name now; attaching [ or
    { to a name is a read error that points at the new spelling. (Free-standing
    […] list and {…} record/flag values are unaffected.)
  • /// doc comments. A /// line is now an ordinary // comment: its text
    is discarded by the reader instead of attaching to the following form, and it
    no longer appears as a WIT doc comment in wavelet wit output or on LSP hover.

What's Changed

  • Collect small wins into dev-notes/blueberries.md by @logaan in #4
  • Plan: switch canonical call form from variants to tuples by @logaan in #3
  • Make wavelet read default to stdin by @logaan in #6
  • Investigation: dropping the interpreter for the compiler by @logaan in #2
  • docs: plan for running macros defined in other components by @logaan in #1
  • Calls are tuples, not variants by @logaan in #8
  • docs: dedicated, numbered Reader sugar page by @logaan in #7
  • docs+refactor: scripts/README.md and a scripts/ci/ split by @logaan in #5
  • Drop /// doc comments from the language by @logaan in #11
  • feat(reader): call-chaining sugar recv.name(args) by @logaan in #10
  • Drop internal-capital spreading from TitleCase macro sugar by @logaan in #9

New Contributors

  • @logaan made their first contribution in #4

Full Changelog: v0.6.0...v0.7.0