Documentation
¶
Index ¶
Constants ¶
const HighsVersion = "1.15.2"
HighsVersion is the npm `highs` release highs.wasm and these names came from.
const HighsWASMImportModule = "a"
HighsWASMImportModule is the single module name every highs.wasm import is namespaced under. emscripten minifies it along with the import names themselves.
const HighsWASMMemoryExport = "u"
HighsWASMMemoryExport is the minified name of highs.wasm's exported linear memory.
Variables ¶
var HighsWASM []byte
HighsWASM is the HiGHS WebAssembly module from the npm `highs` package, the same binary the frontend reforge worker fetches. highs.wasm is a generated copy of node_modules/highs/build/highs.wasm rather than a hand-maintained file: run `make update-highs` to resync it (along with highs_names_gen.go) after changing the pinned version in package.json. It is committed so `go build` works without npm.
var HighsWASMExports = map[string]string{
"_Highs_call": "H",
"_Highs_create": "w",
"_Highs_destroy": "x",
"_Highs_getModelStatus": "G",
"_Highs_readModel": "z",
"_Highs_run": "y",
"_Highs_setBoolOptionValue": "C",
"_Highs_setDoubleOptionValue": "E",
"_Highs_setIntOptionValue": "D",
"_Highs_setStringOptionValue": "F",
"_Highs_writeSolution": "A",
"_Highs_writeSolutionPretty": "B",
"__emscripten_stack_alloc": "K",
"__emscripten_stack_restore": "J",
"__emscripten_timeout": "I",
"__wasm_call_ctors": "v",
"_emscripten_stack_get_current": "L",
}
HighsWASMExports maps each emscripten export symbol to the minified name highs.wasm exports it under.
var HighsWASMImports = []HighsWASMImport{ {Symbol: "___cxa_throw", Minified: "a", Params: []byte{0x7f, 0x7f, 0x7f}, Results: nil}, {Symbol: "___syscall_fcntl64", Minified: "d", Params: []byte{0x7f, 0x7f, 0x7f}, Results: []byte{0x7f}}, {Symbol: "___syscall_ioctl", Minified: "r", Params: []byte{0x7f, 0x7f, 0x7f}, Results: []byte{0x7f}}, {Symbol: "___syscall_openat", Minified: "f", Params: []byte{0x7f, 0x7f, 0x7f, 0x7f}, Results: []byte{0x7f}}, {Symbol: "__abort_js", Minified: "s", Params: nil, Results: nil}, {Symbol: "__emscripten_runtime_keepalive_clear", Minified: "h", Params: nil, Results: nil}, {Symbol: "__setitimer_js", Minified: "j", Params: []byte{0x7f, 0x7c}, Results: []byte{0x7f}}, {Symbol: "__tzset_js", Minified: "l", Params: []byte{0x7f, 0x7f, 0x7f, 0x7f}, Results: nil}, {Symbol: "_clock_time_get", Minified: "o", Params: []byte{0x7f, 0x7e, 0x7f}, Results: []byte{0x7f}}, {Symbol: "_emscripten_date_now", Minified: "k", Params: nil, Results: []byte{0x7c}}, {Symbol: "_emscripten_get_now", Minified: "c", Params: nil, Results: []byte{0x7c}}, {Symbol: "_emscripten_resize_heap", Minified: "t", Params: []byte{0x7f}, Results: []byte{0x7f}}, {Symbol: "_environ_get", Minified: "m", Params: []byte{0x7f, 0x7f}, Results: []byte{0x7f}}, {Symbol: "_environ_sizes_get", Minified: "n", Params: []byte{0x7f, 0x7f}, Results: []byte{0x7f}}, {Symbol: "_exit", Minified: "b", Params: []byte{0x7f}, Results: nil}, {Symbol: "_fd_close", Minified: "e", Params: []byte{0x7f}, Results: []byte{0x7f}}, {Symbol: "_fd_read", Minified: "q", Params: []byte{0x7f, 0x7f, 0x7f, 0x7f}, Results: []byte{0x7f}}, {Symbol: "_fd_seek", Minified: "p", Params: []byte{0x7f, 0x7e, 0x7f, 0x7f}, Results: []byte{0x7f}}, {Symbol: "_fd_write", Minified: "i", Params: []byte{0x7f, 0x7f, 0x7f, 0x7f}, Results: []byte{0x7f}}, {Symbol: "_proc_exit", Minified: "g", Params: []byte{0x7f}, Results: nil}, }
HighsWASMImports lists every function highs.wasm imports, keyed by symbol so callers never have to know the minified names.
Functions ¶
This section is empty.
Types ¶
type HighsWASMImport ¶
type HighsWASMImport struct {
// Symbol is emscripten's stable name for the import, e.g. "_fd_read".
Symbol string
// Minified is the name highs.wasm actually imports, e.g. "q".
Minified string
Params []byte
Results []byte
}
HighsWASMImport is one host function highs.wasm expects to be given, with the signature read out of the wasm binary's type section. Params and Results hold raw wasm value-type bytes, which are exactly wazero's api.ValueType values.