Skip to main content

rustygo/
lib.rs

1//! Runtime for Go packages compiled to Rust by the rustygo compiler.
2//!
3//! Generated code is safe Rust and calls into this crate for everything Go
4//! has and Rust does not. The `unsafe` in the project lives here, the same way
5//! Rust's own `std` confines it.
6//!
7//! This crate is at the M0 spike stage (see `docs/ROADMAP.md`). What exists:
8//!
9//! * [`ops`]: Go integer semantics that differ from Rust's (shifts,
10//!   division).
11//! * [`print`]: the builtin `print` / `println`.
12//! * [`panic`](mod@panic): Go panics carried on Rust unwinding.
13//! * `rt`: the process entry point for a Go `main` (`std` only).
14//!
15//! Still to come, by milestone: the collector, `Gc<T>` / `Ptr<T>`, strings,
16//! slices, maps and interfaces (M1); goroutines, channels and timers (M2);
17//! the `syscall` layer and netpoller (M3).
18//!
19//! # Features
20//!
21//! * `std` (default): hosted targets. Without it the crate is `no_std` +
22//!   `alloc`.
23//! * `gc-torture`: debug collector that collects at every safe point.
24
25#![no_std]
26
27extern crate alloc;
28#[cfg(feature = "std")]
29extern crate std;
30
31pub mod ops;
32pub mod panic;
33pub mod print;
34#[cfg(feature = "std")]
35pub mod rt;