示例

CI 用登记好的参数运行每个入口,逐字节核对 stdout 与 stderr;多模块项目以目录为入口。

  • CI 逐字节核对

入门3

  • fib

    Fibonacci two ways: naive recursion, and a tail call that becomes a loop.

  • fizzbuzz

    FizzBuzz: match guards, string interpolation and a for over a range.

  • lambdas

    Function values: lambdas, captures, higher-order functions, effect variables.

数据建模4

  • generics

    Generics: type parameters, Option and Result, and the list builtins.

  • narrow

    Narrow floats: bfloat16 and binary16 as values that round the way the hardware rounds.

  • records

    Records: literals, field shorthand, functional update, and record patterns.

  • shapes

    Sum types and pattern matching: a Shape ADT, guards, pipes and test blocks.

文本与字符1

  • chars

    Characters and code points: making a slug, and the two renderings of a Char.

trait2

  • eqhash

    Eq and Hash: the prelude traits behind == and hashing.

  • traits

    Traits: a default method, impls for a record and for Int, bounded generics.

效果5

  • cells

    Handler state: a var declared in the arm table, and the block below the handler reading what the arms left there.

  • files

    The file system as a named effect: one reader, two handlers.

  • handlers

    Effect handlers: an interpreter that carries no environment parameter.

  • resumption

    One-shot resumption: an answer that arrives turns later, read as the value of a let.

  • tracking

    Effect tracking: !io in a signature, and the compiler holding you to it.

失败处理1

  • barriers

    Failure in three tiers: Result with ?, catch_fault, and bracket.

Java 互操作1

  • interop

    Java interop, worked: the JDK's own static factories, laying out a build.

完整程序8

  • calc

    A four-function calculator: a lexer, a precedence-climbing parser, an eval.

  • gpu_fake

    A GPU program on a machine with no GPU: nine kernels, two sides, one handler that is a table in host memory.

  • hello_mod

    A multi-module project: one directory, three modules, no manifest.

  • json

    A pure-Dawn JSON validator, run against JSONTestSuite's 318 fixtures.

  • qualified_effects

    Qualification changes lookup, not the evidence supplied by a handler.

  • tea_dom_counter

    The whole application: a model, three messages, update and view, plus the text form of the model the wire carries between turns. No io and no host; main.dawn is the one call that connects it to one.

  • tea_dom_todo_keyed

    The pure half of the demo: model, messages, update and view. No io, no wire format, no host, so every assertion below is == on a value.

  • tea_todo

    The pure half of the todo app: model, messages, update, view, and the line parser. Everything here is a value-in, value-out function, which is what the test blocks below lean on -- an interaction is asserted as data, no terminal in sight. The io shell around it is main.dawn.