Skip to content

Demo backlog: more v0 demos (no dialect upgrade required) #1

Description

@softwarewrighter

Tracking issue for additional demos that fit the current Tinytalk v0
dialect (24-bit tagged SmallInteger refs, 14 bytecodes, hand-assembled
drivers via POKE / DATA-loader image init). All work without new
bytecodes, strings, blocks, or collections — result is one integer in
stdout, matching D1..D7.

Backlog

  • fibonacciSmallInteger>>fib. Two recursive calls per
    frame; validates frame stack on a different recursion shape than
    D6 fact. 7 fib → 13.
  • gcdInteger>>gcd: Euclidean. Two-arg recursion.
    12 gcd: 18 → 6.
  • powerInteger>>raisedTo:, tail-recursive accumulator
    with early exit at e=0. 2 raisedTo: 7 → 128.
  • primeSmallInteger>>isPrime, trial division. Returns
    1 or 0 (or reuse the D3 True/False objects).
  • ackermann — A(m,n). Frame-stack stress test.
    ackermann: 2 with: 3 → 9.
  • hanoi — Move count to solve N disks (no strings, so just
    print the count: `5 hanoi → 31`).
  • linked-list — `Cell` class (head, tail), `Cell>>sum`
    walks the chain. First demo with a heap of cooperating user
    objects beyond Counter.
  • stack / queue — push/pop/peek on a Cell chain. Identity
    • mutable state.
  • state-machine — `TrafficLight` cycling 0→1→2→0 via a
    polymorphic `next` method.
  • compare-mixin — `Comparable` superclass: subclasses
    override `<`, inherit `<=` / `>` / `between:and:` from
    super. Exercises the D7 inheritance walk across multiple
    selectors.

Driver-authoring cost

Each demo costs ~30-60 lines of fragile hand-assembly in BASIC
(POKE bytecodes + class-table init + DATA loaders). Worth weighing
against deferring some of these until a v1+ Smalltalk-source
compiler exists (see the dialect roadmap issue) so future demos
become `.st` files instead of bootloaders.

Web demo coverage

`web-sw-cor24-smalltalk`'s
`build.rs` auto-picks up `examples/dN_*.bas` + `src/image_dN.bas`,
so each demo lands in CLI and browser together.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions