Expand description
Runtime for Go packages compiled to Rust by the rustygo compiler.
Generated code is safe Rust and calls into this crate for everything Go
has and Rust does not. The unsafe in the project lives here, the same way
Rust’s own std confines it.
This crate is at the M0 spike stage (see docs/ROADMAP.md). What exists:
valueandplace: Go values, addressable storage and pointers.string: Go strings.ops: Go integer semantics that differ from Rust’s (shifts, division) and bounds checks.print: the builtinprint/println.panic: Go panics carried on Rust unwinding.rt: the process entry point for a Gomain(stdonly).prelude: what generated code imports.gcandheap: GC roots and the collector.trace: how the collector walks a value’s references.
Still to come, by milestone: slices, maps, closures and interfaces (M1); goroutines, channels and timers (M2);
the syscall layer and netpoller (M3).
§Features
std(default): hosted targets. Without it the crate isno_std+alloc.gc-torture: debug collector that collects at every safe point.
Modules§
- complex
- Go’s
complex64andcomplex128. - defers
defer.- func
- Go function values and closures.
- gc
- Garbage-collection roots: the shadow stack.
- heap
- The heap and its collector.
- iface
- Interface values.
- intrinsics
- Bodies for functions gc implements in assembly or inside its own runtime, which the emitter maps here by name (internal/emit/intrinsics.go).
- map
- Go maps.
- ops
- Go integer semantics that Rust spells differently.
- panic
- Go panics, carried on Rust unwinding.
- place
- Places: addressable Go storage, and pointers to it.
- prelude
- Everything generated code uses unqualified:
use rustygo::prelude::*;. - The builtin
printandprintln. - rt
- Process entry point for a compiled Go
mainpackage. - slice
- Go slices: a view of a run of places in a backing array.
- string
- Go strings: immutable byte sequences, not necessarily UTF-8.
- trace
- Tracing: how the collector walks a value’s references.
- unsafe_
ptr - Go’s
unsafe.Pointerand theunsafebuiltins. - value
- Go values: every Go type maps to a
CopyRust type with a zero value.