Skip to content

OctoForth v0.2.0 (preview)

Pre-release
Pre-release

Choose a tag to compare

@j-modernc-org j-modernc-org released this 02 Nov 10:56
· 11 commits to master since this release

A second preview of OctoForth, a Forth for the Parallax Propeller 2 that
compiles every colon definition to P2 machine code the moment it is
defined. It is built with OctoGo v1.0.0-rc.3, as v0.1.0 was.

What is new:

  • OPTIMIZE-SIZE, and OPTIMIZE-SPEED, the default, as -Os and -O2
    are to a C compiler: code compiled under OPTIMIZE-SIZE inlines no
    colon word longer than the call it would take the place of, and runs no
    loop from cog RAM. Fraeman's Stanford suite takes 19,632 bytes of code
    against 22,468, and 20,175 ms against 15,951 at 200 MHz (README.md,
    "Speed or size").
  • The words written in OctoGo, HERE, ,, ALLOT and KEY? among them,
    are cheaper to call from compiled code: in a loop at 160 MHz, HERE
    takes 1,248 clocks against 1,840, KEY? 1,816 against 5,600.
  • Source pasted faster than the REPL takes it is no longer garbled: with
    no pause between its lines, a paste of more than some 800 lines ran
    over the console's ring of 4 KB, saying nothing. Now the lines before
    the gap are interpreted, the rest is dropped, and the line the gap cut
    is an error, input lost: it came too fast. INCLUDE takes a file of any
    length.
  • On the SD card, a directory whose chain of clusters loops, as on a
    damaged card, no longer makes a walk of it go on for ever.

oforth-v0.2.0.zip holds:

  • oforth.binary: the REPL, for a loader to load into the board's RAM;
  • boot.binary: the same REPL for the board's flash (loadp2 -FLASH) or
    for an SD card (as _BOOT_P2.BIX), which first runs a startup file,
    sd:boot.fth or flash:boot.fth;
  • examples/bench.fth, README.txt, LICENSE and LICENSE-flexprop.

The binaries are for a board with a 20 MHz crystal, such as the P2-EDGE,
and run at 160 MHz; the console is at 230400 baud:

loadp2 -t -b 230400 oforth.binary

CHANGELOG.md has the details.

SHA256 (oforth-v0.2.0.zip) = bfa874cac4319f83cd311d20e00effa05e1fbf187b875f9804d2b8266e2424f5