mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-01 15:51:12 +00:00
disable caching of builtin modules for now
This commit is contained in:
parent
39c156b970
commit
8a361bb68a
2 changed files with 28 additions and 28 deletions
|
@ -5,16 +5,16 @@ use roc_load_internal::file::Threading;
|
||||||
use roc_module::symbol::ModuleId;
|
use roc_module::symbol::ModuleId;
|
||||||
|
|
||||||
const MODULES: &[(ModuleId, &str)] = &[
|
const MODULES: &[(ModuleId, &str)] = &[
|
||||||
(ModuleId::BOOL, "Bool.roc"),
|
// (ModuleId::BOOL, "Bool.roc"),
|
||||||
(ModuleId::RESULT, "Result.roc"),
|
// (ModuleId::RESULT, "Result.roc"),
|
||||||
(ModuleId::NUM, "Num.roc"),
|
// (ModuleId::NUM, "Num.roc"),
|
||||||
(ModuleId::LIST, "List.roc"),
|
// (ModuleId::LIST, "List.roc"),
|
||||||
(ModuleId::STR, "Str.roc"),
|
// (ModuleId::STR, "Str.roc"),
|
||||||
(ModuleId::DICT, "Dict.roc"),
|
// (ModuleId::DICT, "Dict.roc"),
|
||||||
(ModuleId::SET, "Set.roc"),
|
// (ModuleId::SET, "Set.roc"),
|
||||||
(ModuleId::BOX, "Box.roc"),
|
// (ModuleId::BOX, "Box.roc"),
|
||||||
(ModuleId::ENCODE, "Encode.roc"),
|
// (ModuleId::ENCODE, "Encode.roc"),
|
||||||
(ModuleId::JSON, "Json.roc"),
|
// (ModuleId::JSON, "Json.roc"),
|
||||||
];
|
];
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
|
|
@ -180,14 +180,14 @@ pub fn load_and_typecheck_str<'a>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const BOOL: &[u8] = include_bytes!(concat!(env!("OUT_DIR"), "/Bool.dat")) as &[_];
|
// const BOOL: &[u8] = include_bytes!(concat!(env!("OUT_DIR"), "/Bool.dat")) as &[_];
|
||||||
const RESULT: &[u8] = include_bytes!(concat!(env!("OUT_DIR"), "/Result.dat")) as &[_];
|
// const RESULT: &[u8] = include_bytes!(concat!(env!("OUT_DIR"), "/Result.dat")) as &[_];
|
||||||
const LIST: &[u8] = include_bytes!(concat!(env!("OUT_DIR"), "/List.dat")) as &[_];
|
// const LIST: &[u8] = include_bytes!(concat!(env!("OUT_DIR"), "/List.dat")) as &[_];
|
||||||
const STR: &[u8] = include_bytes!(concat!(env!("OUT_DIR"), "/Str.dat")) as &[_];
|
// const STR: &[u8] = include_bytes!(concat!(env!("OUT_DIR"), "/Str.dat")) as &[_];
|
||||||
const DICT: &[u8] = include_bytes!(concat!(env!("OUT_DIR"), "/Dict.dat")) as &[_];
|
// const DICT: &[u8] = include_bytes!(concat!(env!("OUT_DIR"), "/Dict.dat")) as &[_];
|
||||||
const SET: &[u8] = include_bytes!(concat!(env!("OUT_DIR"), "/Set.dat")) as &[_];
|
// const SET: &[u8] = include_bytes!(concat!(env!("OUT_DIR"), "/Set.dat")) as &[_];
|
||||||
const BOX: &[u8] = include_bytes!(concat!(env!("OUT_DIR"), "/Box.dat")) as &[_];
|
// const BOX: &[u8] = include_bytes!(concat!(env!("OUT_DIR"), "/Box.dat")) as &[_];
|
||||||
const NUM: &[u8] = include_bytes!(concat!(env!("OUT_DIR"), "/Num.dat")) as &[_];
|
// const NUM: &[u8] = include_bytes!(concat!(env!("OUT_DIR"), "/Num.dat")) as &[_];
|
||||||
|
|
||||||
fn deserialize_help(bytes: &[u8]) -> (Subs, Vec<(Symbol, Variable)>) {
|
fn deserialize_help(bytes: &[u8]) -> (Subs, Vec<(Symbol, Variable)>) {
|
||||||
let (subs, slice) = Subs::deserialize(bytes);
|
let (subs, slice) = Subs::deserialize(bytes);
|
||||||
|
@ -201,16 +201,16 @@ fn read_cached_subs() -> MutMap<ModuleId, (Subs, Vec<(Symbol, Variable)>)> {
|
||||||
// Wasm seems to re-order definitions between build time and runtime, but only in release mode.
|
// Wasm seems to re-order definitions between build time and runtime, but only in release mode.
|
||||||
// That is very strange, but we can solve it separately
|
// That is very strange, but we can solve it separately
|
||||||
if !cfg!(target_family = "wasm") {
|
if !cfg!(target_family = "wasm") {
|
||||||
output.insert(ModuleId::BOOL, deserialize_help(BOOL));
|
// output.insert(ModuleId::BOOL, deserialize_help(BOOL));
|
||||||
output.insert(ModuleId::RESULT, deserialize_help(RESULT));
|
// output.insert(ModuleId::RESULT, deserialize_help(RESULT));
|
||||||
output.insert(ModuleId::NUM, deserialize_help(NUM));
|
// output.insert(ModuleId::NUM, deserialize_help(NUM));
|
||||||
|
//
|
||||||
output.insert(ModuleId::LIST, deserialize_help(LIST));
|
// output.insert(ModuleId::LIST, deserialize_help(LIST));
|
||||||
output.insert(ModuleId::STR, deserialize_help(STR));
|
// output.insert(ModuleId::STR, deserialize_help(STR));
|
||||||
output.insert(ModuleId::DICT, deserialize_help(DICT));
|
// output.insert(ModuleId::DICT, deserialize_help(DICT));
|
||||||
|
//
|
||||||
output.insert(ModuleId::SET, deserialize_help(SET));
|
// output.insert(ModuleId::SET, deserialize_help(SET));
|
||||||
output.insert(ModuleId::BOX, deserialize_help(BOX));
|
// output.insert(ModuleId::BOX, deserialize_help(BOX));
|
||||||
}
|
}
|
||||||
|
|
||||||
output
|
output
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue