Skip to content

OctoBeam v0.1.2 (preview)

Pre-release
Pre-release

Choose a tag to compare

@j-modernc-org j-modernc-org released this 18 Oct 18:33
· 3 commits to master since this release

OctoBeam v0.1.2 (preview) - the first release: prebuilt obeam binaries for linux (amd64, arm64), windows/amd64 and macOS (arm64, amd64). Unzip and put obeam on PATH; the VM, checked and unchecked, the shims of OTP's and Elixir's libraries and the board loader are embedded, so there is nothing else to install. With a P2 board on a USB port, obeam run examples/hello.beam starts you off, and Ctrl-] or Ctrl-Z leaves its terminal; the README has the guide, and every entry is in CHANGELOG.md.

v0.1.0 and v0.1.1 were tagged but withdrawn before they were published. On a Mac eight of v0.1.0's loads in ten failed with "Error writing port": the loader runs inside obeam, and the Go runtime's preemption signal cut its writes to the serial port short, so it runs with asynchronous preemption off now. In v0.1.1 a Ctrl-Z pressed during a load, before the terminal is up, suspended obeam, which kept the board's port; obeam ignores it now, and Ctrl-Z in the terminal leaves it as before.

What it is

  • A BEAM for the Parallax Propeller 2, written in OctoGo: modules compiled by Erlang's erlc (OTP 27) and Elixir's elixirc (1.18) run on the board, a scheduler on each of seven of its eight cogs.
  • Processes, messages and receive with timeouts, links, monitors, exit signals and registered names, exceptions, 32-bit floats, binaries made and matched, maps, Elixir's structs and ranges, io:format and io_lib:format, and the pins through the module p2.
  • OTP's library as shims: gen_server, supervisor, lists, maps, string, timer, queue, proplists, rand, the process dictionary, erlang's timers and clock, the floats' conversions; Elixir's Enum and Map.
  • Without a computer: obeam -sd writes a file the P2 boots from an SD card, and obeam flash writes the board's flash.

What it is not

A subset: no bignums, no ETS tables, no distribution, floats of 32 bits, and of OTP's and Elixir's libraries only what the shims carry. obeam names what a program uses that the VM does not have, by module, function and line, before anything runs. The README says which subset it is and lists the differences.

Verification

  • The host suite passes: the VM run under Go against erl and elixir, thirty-five Erlang and seven Elixir modules printing the same bytes, with and without the fast handlers.
  • On a P2-EDGE on a Mac, this release's darwin/arm64 zip loaded hello three times and darwin/amd64, under Rosetta, twice, from an interactive shell with a Ctrl-Z pressed during every load, none failing or left suspended; builds of the same code before it was tagged loaded it five and three times so. v0.1.1's darwin zips, whose VMs this release keeps unchanged, loaded hello fifteen times without a failure and ran the demo, twenty-six modules of Erlang and Elixir, printing what it prints on Linux.
  • On a P2-EDGE on a Raspberry Pi 5, this release's linux/arm64 zip loaded hello ten times of ten, finding the board's port by itself, five of them from an interactive shell with a Ctrl-Z pressed during every load, none left suspended; it ran the demo, printing what it prints on linux/amd64, and hello on the unchecked VM.
  • On a P2-EDGE on linux/amd64, this release's linux/amd64 zip loaded hello ten times of ten in the same way, finding the board's port by itself, ran the demo, printing what erl and elixir print, and hello on the unchecked VM.
  • On a P2-EDGE on Windows 11, this release's windows/amd64 zip loaded hello ten times of ten, ran the demo, printing what it prints on Linux, ran hello on the unchecked VM, and found the board's COM port by itself without -p. It was driven over ssh, with the keys piped in; typing at a cmd.exe or PowerShell window has not been tried.
  • The VMs are built by OctoGo v0.57.0.

The five zips are cross-compiled from one host; see SHA256SUMS.