Tags give the ability to mark specific points in history as being important
-
-
-
-
-
v0.7.0
a7dfe268 · ·ogo v0.7.0 Floating point, and a lot of language surface. Highlights since v0.6.0: Types and values: - Floating point: float32 and float64, literals, arithmetic, comparison, and conversion to and from the integers. NB the P2 toolchain's double is 32-bit, so float64 has float32 precision (~7 digits) -- documented, not a surprise. - int64 and uint64. - Rune literals ('A', '\n', 'é'), emitted as code points. - Type-elided composite literals: []P{{1}, {2}}, Outer{{5}}. - Empty struct types. Statements and expressions: - Labels and labeled break/continue. - Unnamed method receivers, func (T) m(). - Call and selector chains in expressions (mk().sum(), a[i].get()), and a void method call at the end of a chain (xs[i].update(), the range-mutate idiom). - Pointer-to-local inference: p := &x; *p = 9. - String ordering comparisons, comparisons inside &&/|| chains, and range-over-string yielding runes. String building without a heap: - copy(dst []byte, src string). - A predeclared Builder over a caller-owned []byte -- the allocation-free strings.Builder: NewBuilder(back[:]), WriteString/WriteByte/WriteRune/Write, Len/Reset, and a zero-copy String() view. Intended to become strings.Builder once packages land. Hardware: - The p2 intrinsic set expanded (9 -> 20 functions). Diagnostics: a float literal, a string "+=", and a string conversion are each refused with a clear message instead of an opaque backend error. Every feature is verified on the host shim and on a real P2-EDGE. -
v0.6.0
304f7d3a · ·ogo v0.6.0 Add the linux/arm64 backend -- the fifth supported target. `ogo build` now runs on linux/arm64 via the same native transpile path as linux/amd64 (`ccgo -exec make`, no supplement -- libc is complete for arm64). Verified on a Raspberry Pi 5: `go build ./...` clean, flexcc golden + octogo emit suites pass, and `ogo build` emits a P2 binary byte-identical (same sha256) to the linux/amd64, windows/amd64 and both darwin backends. Loading and running on a real P2 over the Pi's PropPlug is confirmed end-to-end. Supported platforms are now linux/amd64, linux/arm64, windows/amd64, darwin/arm64 and darwin/amd64. undup folds five targets (~1.14x).
-
v0.5.0
d8c34e74 · ·ogo v0.5.0 Headline: ogo now targets macOS. Platforms - Add darwin/arm64 and darwin/amd64 backends: `ogo build` compiles to a P2 binary on a Mac (Apple Silicon natively, Intel/Rosetta), each byte-identical to the linux flexcc output. Supported platforms are now linux/amd64, windows/amd64, darwin/arm64 and darwin/amd64. - Upgrade the loadp2 loader to v0.3.1 (adds darwin loading). ogo run / the board - `ogo run` sets a precise P2 clock (200 MHz) and matching 230400 baud by default, so println output is readable out of the box -- loadp2's own defaults leave the chip on its imprecise oscillator and garble serial at every baud. Documented in README, the run/loadp2 help and the godocs so the raw `ogo loadp2` passthrough case is clear too. Compiler / emit - String equality and string switches (`s == "x"`, `switch s { case "a": }`). - Constant-expression array bounds (`[2+1]int`, `[W*H]int`, `const N = W*H`). - Indexed array and slice composite literals (`[]int{2: 5}`, mixed forms). - Fix a shadowing self-referential initializer miscompile (`var x = x + 5`), found by the new fuzzer; covers scalar, struct, array and slice forms. - `break` inside a switch, bare block statements, and `panic(string)`. - Register the built-in functions in the Universe scope. Tooling - smith is now a seed-reproducible oracle fuzzer with a committed regression corpus; it found the shadowing miscompile above. -
-
-
v0.3.0
8f20e0ec · ·OctoGo v0.3.0 The compiler gains the logical operators and four builtins, and closes several emit gaps. The backend and `ogo fmt` are unchanged from v0.2.3. Every runnable program in the test suite was verified on a real Propeller 2. Language: - && and || are now supported. They parsed all along but the checker rejected them; they now type-check -- boolean operands, a boolean result -- and emit with the right precedence, so a condition like `x > 0 && x < 10` compiles for the first time. Short-circuiting is C's. Builtins: - copy(dst, src) copies min(len(dst), len(src)) elements between two slices, overlap-safe (memmove), and returns the count. - min and max, variadic over integer arguments. - clear(s) zeroes a slice's elements, its length unchanged. - Every builtin the emitter does not implement -- close, panic, delete, recover, complex, real, imag -- is now refused by name. Before, one was emitted as a call to a C function that does not exist, surfacing as a broken C compile if at all; copy was such a case until this release. Types and emission: - A named array type, `type Row [3]int`, is modelled, and behaves as its array wherever one is expected -- a variable, a struct field, a parameter, an index. - `var a, b = f()` at package scope distributes a multi-result call, deferred to the synthesized package initializer. - Printing a slice or array renders any scalar element -- a bool as true or false, a string as its bytes, every integer width -- not only int. Diagnostics: - Returning a fixed array by value, which the target cannot do, is refused with an actionable message rather than a nameless "unsupported type". - A slice printed only without a trailing newline no longer defines an unused print helper. The checker's coverage is still partial and the language still small; this is steady progress on early-stage work, not a feature-complete compiler. -
v0.2.3
7283d1ca · ·OctoGo v0.2.3 `ogo fmt` only. The compiler, checker, and backend are unchanged from v0.2.2. The formatter had eight token-spacing bugs, several of which rewrote already correct code into something gofmt would never emit -- running `ogo fmt` could make a file worse. All eight are fixed, each now gofmt-faithful and pinned by a regression test: - a struct or interface brace is spaced only for a multi-line body; an empty or one-line body binds tight ("struct{}", "struct{ v int }"); - "*" binds tight as a pointer in a type or parameter ("[]*int", "func() *int"), where it had been read as multiplication; - a unary operator at the start of a statement binds to its operand ("*p = x"), and there is always a space after an assignment operator ("x = *p"); - a call binds tight after an index or slice suffix ("h[0]()"); - "func" is spaced off a method receiver ("func (r T) m()") but tight for a type or literal ("func()"); - binary operators inside an index or slice subscript render tight ("xs[a+b*c]", "xs[a&b]"); - a dot-import spaces its "." on both sides (import . "p2"); - a slice colon is spaced when a bound is a binary expression ("xs[i+1 : j-1]"). Anyone who ran `ogo fmt` on correct code and saw it disturbed is affected. One cosmetic gap remains: a run of trailing comments on consecutive statements is not aligned to a common column the way struct fields are. The comments are correct, one space out; only the alignment is missing. -
v0.2.2
f4acd901 · ·OctoGo v0.2.2 A livelock in the channel rendezvous is fixed. Programs with a few channels and a few goroutines could hang on hardware at a rendezvous, with both sides live and neither progressing: the polling loops asked for the hub lock every turn, which re-takes it faster than the cog on the other side can win it. Anyone writing concurrent code on v0.2.1 or earlier is affected, so this is worth taking. Each poll now reads the volatile flag it is waiting on before asking for the lock, and asks only when there is plausibly something to do. The check inside the lock is still the authoritative one. Builds no longer pass --fcache=0. The flag had been there since the hang was first seen, on the belief that flexspin's FCACHE was miscompiling the rendezvous. It was not: FCACHE only made the loop fast enough to expose the livelock, and disabling it turned off loop caching for every program to hide a bug in three loops. Both halves of that are now undone, so compiled programs get loop caching back. What settles the diagnosis is that varying only the backoff moves the hang -- one cycle stops after two exchanges of four, eight after three, sixty-four completes -- which a stale read could not do. Thanks are owed to Wuerfel_21 on the Parallax forum for saying it was a bug in the logic exposed by faster timings. doc/rendezvous-livelock.c, which used to claim this was a compiler bug, now demonstrates the fix and reproduces the hang under -DLIVELOCK. Verified on a P2-EDGE: all 37 test programs built with the real backend, loaded onto the board and checked against their serial output, with FCACHE on. A new case covers sustained traffic -- three pipelines, seven cogs polling at once -- and hangs outright without the fix.
-
v0.2.1
f1d91e4e · ·OctoGo v0.2.1 Documentation only; the compiler is unchanged from v0.2.0. The specification's header and TODO list were checked against the implementation rather than against memory, which found the list claiming work that was done and work that had in fact been decided against. Package-level channels work, and both the specification and the README said they did not. The initialization pass they were waiting for exists; two package-level channels rendezvous with two goroutines on real hardware. Maps and floating point are no longer listed as pending. The specification's own body omits both deliberately and the README lists them as not planned, so a TODO entry for each read as work owed rather than as a decision taken. Gaps confirmed by trying them are now written down: the indexed form of an array literal, an array as a function result, slicing a multi-dimensional array, and importing your own packages.
-
v0.2.0
e07a57d6 · ·OctoGo v0.2.0 Composite literals grew up. A struct's fields may now be given by name -- "P{y: 2}", any subset in any order, the rest zeroed -- and arrays and slices have literals of their own: "[4]int{10, 20}", "[]int{1, 2, 3}". Both are a variable's initializer and nothing else, since C cannot assign an array and a slice literal's backing storage belongs beside the declaration it initializes. Several miscompiles were found and fixed underneath them. A struct holding an array was emitted in forms the target's C compiler cannot lower: it is initialized as an aggregate now and copied with memcpy, and the two cases no lowering can reach -- passing or returning one by value -- are refused where the signature is written rather than left to fail as backend noise. A field of a package-scope struct had no type at all, which printed strings as integers and refused len() on a slice field. Those were found because the emitted test programs are now compiled with the real backend on every run, not only when a board happens to be attached. The host C compiler and the target's disagree about what they accept, and that gap was invisible until it was tested. The C backend moves to flexprop v7.7.0. It fixes nothing this compiler works around: every one of those bugs was re-measured against it on real hardware and reproduces identically, so the workarounds stay. ogo fmt no longer mangles what it formats -- composite literals came out as "P { Q { 1 } }" and increments as "i ++". Still preview quality, and the README's status section is still the honest inventory. Everything in it is verified on real hardware: all 36 test programs are built with the real backend, loaded onto a P2, and checked against their serial output. linux/amd64 only for now. -
v0.1.0
672403d7 · ·OctoGo v0.1.0 -- first public preview A Go-like language for the Parallax Propeller 2, compiled to C and on to a P2 binary by an embedded copy of the flexspin backend. Goroutines are Cogs and channels are Hub cells guarded by hardware locks: no scheduler, no allocator, no garbage collector. Preview quality. The language is a subset and the checker is partial; the README's status section is the honest inventory of what works and what does not. linux/amd64 only for now. Everything in that inventory is verified on real hardware -- each test program is built with the real backend, loaded onto a P2, and checked against its serial output.