Documentation
¶
Overview ¶
Command freeze-prelude regenerates internal/vm/prelude_frozen_gen.go: it compiles the embedded-Ruby prelude (internal/vm/prelude.rb) and writes its bytecode out as a Go literal (embeddedPrelude), so a closed-world binary can load the standard library without linking the front-end.
It finds the module root itself, so both spellings work:
go run ./cmd/freeze-prelude # from the module root go generate ./internal/vm # which runs it FROM internal/vm
That matters because the second is what TestEmbeddedPreludeMatchesSource tells you to run, and with paths taken relative to the working directory it could not work at all: go:generate runs a command in the directory of the file carrying the directive.
TestEmbeddedPreludeMatchesSource fails if the committed file drifts from the prelude source, prompting a regeneration.