Skip to main content

Crate nub_flat

Crate nub_flat 

Source
Expand description

The flat personality: nub’s reference Personality / GuestPersonality pair.

nub is personality-generic, and until now the only personality was JAVM — 2,700 lines of capability semantics, which makes it a poor answer to “what does a personality actually have to provide?”. Flat is that answer: one program, one frame, no capability graph, no sub-VM calls, no yields. A program is published by content hash and invoked by content hash, and that is the whole object model.

It exists for two reasons:

  1. It is the executable documentation. The README’s “Building a personality” section used to point at another repository.
  2. It makes nub’s own JIT measurable. Executing recompiled code needs the ring-0 substrate in nub-arch-x86, which needs a GuestPersonality. Without one, nub could measure how fast it compiles and never how fast the result runs.

§Layout

  • hash — content addressing. no_std, shared by both halves.
  • the host half (Flat, FlatLocal) — behind the std feature, which the guest build turns off.
  • the guest half — nub-flat-guest-x86, which links this crate with default-features = false for hash.

Modules§

hash
Content-addressing for the flat personality.

Structs§

Flat
The flat personality.
FlatLocal
Host-side store: published programs, keyed by content hash.