git.delta.rocks / jrsonnet / refs/commits / 4f26f96ee098

difftreelog

perf remove AST (de)serialization

Yaroslav Bolyukin2024-05-19parent: #0ae36ba.patch.diff
in: master

12 files changed

modifiedCargo.lockdiffbeforeafterboth
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -543,8 +543,6 @@
  "hashbrown 0.14.5",
  "jrsonnet-gcmodule",
  "rustc-hash",
- "serde",
- "structdump",
 ]
 
 [[package]]
@@ -563,9 +561,7 @@
  "jrsonnet-gcmodule",
  "jrsonnet-interner",
  "peg",
- "serde",
  "static_assertions",
- "structdump",
 ]
 
 [[package]]
@@ -586,7 +582,6 @@
 version = "0.5.0-pre96"
 dependencies = [
  "base64",
- "bincode",
  "jrsonnet-evaluator",
  "jrsonnet-gcmodule",
  "jrsonnet-macros",
@@ -602,7 +597,6 @@
  "sha1",
  "sha2",
  "sha3",
- "structdump",
 ]
 
 [[package]]
@@ -1102,28 +1096,6 @@
 version = "0.11.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
-
-[[package]]
-name = "structdump"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b0570327507bf281d8a6e6b0d4c082b12cb6bcee27efce755aa5efacd44076c1"
-dependencies = [
- "proc-macro2",
- "quote",
- "structdump-derive",
-]
-
-[[package]]
-name = "structdump-derive"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "29cc0b59cfa11f1bceda09a9a7e37e6a6c3138575fd24ade8aa9af6d09aedf28"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 1.0.109",
-]
 
 [[package]]
 name = "syn"
modifiedCargo.tomldiffbeforeafterboth
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -79,7 +79,6 @@
 num-bigint = "0.4.5"
 derivative = "2.2.0"
 strsim = "0.11.0"
-structdump = "0.2.0"
 proc-macro2 = "1.0"
 quote = "1.0"
 syn = "2.0"
modifiedcrates/jrsonnet-interner/Cargo.tomldiffbeforeafterboth
--- a/crates/jrsonnet-interner/Cargo.toml
+++ b/crates/jrsonnet-interner/Cargo.toml
@@ -10,20 +10,8 @@
 [lints]
 workspace = true
 
-[features]
-default = []
-# Implement value serialization using structdump
-structdump = ["dep:structdump"]
-# Implement value serialization using serde
-#
-# Warning: serialized values won't be deduplicated
-serde = ["dep:serde"]
-
 [dependencies]
 jrsonnet-gcmodule.workspace = true
-
-serde = { workspace = true, optional = true }
-structdump = { workspace = true, optional = true }
 
 rustc-hash.workspace = true
 hashbrown = { workspace = true, features = ["inline-more"] }
modifiedcrates/jrsonnet-interner/src/lib.rsdiffbeforeafterboth
--- a/crates/jrsonnet-interner/src/lib.rs
+++ b/crates/jrsonnet-interner/src/lib.rs
@@ -219,45 +219,6 @@
 	}
 }
 
-#[cfg(feature = "serde")]
-impl serde::Serialize for IStr {
-	fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
-	where
-		S: serde::Serializer,
-	{
-		self.as_str().serialize(serializer)
-	}
-}
-
-#[cfg(feature = "serde")]
-impl<'de> serde::Deserialize<'de> for IStr {
-	fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
-	where
-		D: serde::Deserializer<'de>,
-	{
-		let str = <&str>::deserialize(deserializer)?;
-		Ok(intern_str(str))
-	}
-}
-
-#[cfg(feature = "structdump")]
-impl structdump::Codegen for IStr {
-	fn gen_code(
-		&self,
-		res: &mut structdump::CodegenResult,
-		_unique: bool,
-	) -> structdump::TokenStream {
-		let s: &str = self;
-		res.add_code(
-			structdump::quote! {
-				structdump_import::IStr::from(#s)
-			},
-			Some(structdump::quote![structdump_import::IStr]),
-			false,
-		)
-	}
-}
-
 thread_local! {
 	static POOL: RefCell<HashMap<Inner, (), BuildHasherDefault<FxHasher>>> = RefCell::new(HashMap::with_capacity_and_hasher(200, BuildHasherDefault::default()));
 }
modifiedcrates/jrsonnet-parser/Cargo.tomldiffbeforeafterboth
--- a/crates/jrsonnet-parser/Cargo.toml
+++ b/crates/jrsonnet-parser/Cargo.toml
@@ -11,21 +11,6 @@
 default = []
 exp-destruct = []
 exp-null-coaelse = []
-# Implement serialization of AST using structdump
-#
-# Structdump generates code, which exactly replicated passed AST
-# Contrary to serde, has no code bloat problem, and is recommended
-#
-# The only limitation is serialized form is only useable if built from build script
-structdump = ["dep:structdump", "jrsonnet-interner/structdump"]
-# Implement serialization of AST using serde
-#
-# Warning: as serde doesn't deduplicate strings, `Source` struct will bloat
-# output binary with repeating source code. To resolve this issue, you should either
-# override serialization of this struct using custom `Serializer`/`Deserializer`,
-# not rely on Source, and fill its `source_code` with empty value, or use `structdump`
-# instead
-serde = ["dep:serde"]
 
 [dependencies]
 jrsonnet-interner.workspace = true
@@ -34,6 +19,3 @@
 static_assertions.workspace = true
 
 peg.workspace = true
-
-serde = { workspace = true, features = ["derive", "rc"], optional = true }
-structdump = { workspace = true, features = ["derive"], optional = true }
modifiedcrates/jrsonnet-parser/src/expr.rsdiffbeforeafterboth
66
7use jrsonnet_gcmodule::Trace;7use jrsonnet_gcmodule::Trace;
8use jrsonnet_interner::IStr;8use jrsonnet_interner::IStr;
9#[cfg(feature = "serde")]
10use serde::{Deserialize, Serialize};
11#[cfg(feature = "structdump")]
12use structdump::Codegen;
139
14use crate::source::Source;10use crate::source::Source;
1511
16#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17#[cfg_attr(feature = "structdump", derive(Codegen))]
18#[derive(Debug, PartialEq, Trace)]12#[derive(Debug, PartialEq, Trace)]
19pub enum FieldName {13pub enum FieldName {
20 /// {fixed: 2}14 /// {fixed: 2}
23 Dyn(LocExpr),17 Dyn(LocExpr),
24}18}
2519
26#[cfg_attr(feature = "structdump", derive(Codegen))]
27#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28#[derive(Debug, Clone, Copy, PartialEq, Eq, Trace)]20#[derive(Debug, Clone, Copy, PartialEq, Eq, Trace)]
29#[repr(u8)]21#[repr(u8)]
30pub enum Visibility {22pub enum Visibility {
42 }34 }
43}35}
4436
45#[cfg_attr(feature = "structdump", derive(Codegen))]
46#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
47#[derive(Clone, Debug, PartialEq, Trace)]37#[derive(Clone, Debug, PartialEq, Trace)]
48pub struct AssertStmt(pub LocExpr, pub Option<LocExpr>);38pub struct AssertStmt(pub LocExpr, pub Option<LocExpr>);
4939
50#[cfg_attr(feature = "structdump", derive(Codegen))]
51#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
52#[derive(Debug, PartialEq, Trace)]40#[derive(Debug, PartialEq, Trace)]
53pub struct FieldMember {41pub struct FieldMember {
54 pub name: FieldName,42 pub name: FieldName,
58 pub value: LocExpr,46 pub value: LocExpr,
59}47}
6048
61#[cfg_attr(feature = "structdump", derive(Codegen))]
62#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
63#[derive(Debug, PartialEq, Trace)]49#[derive(Debug, PartialEq, Trace)]
64pub enum Member {50pub enum Member {
65 Field(FieldMember),51 Field(FieldMember),
66 BindStmt(BindSpec),52 BindStmt(BindSpec),
67 AssertStmt(AssertStmt),53 AssertStmt(AssertStmt),
68}54}
6955
70#[cfg_attr(feature = "structdump", derive(Codegen))]
71#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
72#[derive(Debug, Clone, Copy, PartialEq, Eq, Trace)]56#[derive(Debug, Clone, Copy, PartialEq, Eq, Trace)]
73pub enum UnaryOpType {57pub enum UnaryOpType {
74 Plus,58 Plus,
93 }77 }
94}78}
9579
96#[cfg_attr(feature = "structdump", derive(Codegen))]
97#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
98#[derive(Debug, Clone, Copy, PartialEq, Eq, Trace)]80#[derive(Debug, Clone, Copy, PartialEq, Eq, Trace)]
99pub enum BinaryOpType {81pub enum BinaryOpType {
100 Mul,82 Mul,
164}146}
165147
166/// name, default value148/// name, default value
167#[cfg_attr(feature = "structdump", derive(Codegen))]
168#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
169#[derive(Debug, PartialEq, Trace)]149#[derive(Debug, PartialEq, Trace)]
170pub struct Param(pub Destruct, pub Option<LocExpr>);150pub struct Param(pub Destruct, pub Option<LocExpr>);
171151
172/// Defined function parameters152/// Defined function parameters
173#[cfg_attr(feature = "structdump", derive(Codegen))]
174#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
175#[derive(Debug, Clone, PartialEq, Trace)]153#[derive(Debug, Clone, PartialEq, Trace)]
176pub struct ParamsDesc(pub Rc<Vec<Param>>);154pub struct ParamsDesc(pub Rc<Vec<Param>>);
177155
182 }160 }
183}161}
184162
185#[cfg_attr(feature = "structdump", derive(Codegen))]
186#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
187#[derive(Debug, PartialEq, Trace)]163#[derive(Debug, PartialEq, Trace)]
188pub struct ArgsDesc {164pub struct ArgsDesc {
189 pub unnamed: Vec<LocExpr>,165 pub unnamed: Vec<LocExpr>,
195 }171 }
196}172}
197173
198#[cfg_attr(feature = "structdump", derive(Codegen))]
199#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
200#[derive(Debug, Clone, PartialEq, Eq, Trace)]174#[derive(Debug, Clone, PartialEq, Eq, Trace)]
201pub enum DestructRest {175pub enum DestructRest {
202 /// ...rest176 /// ...rest
205 Drop,179 Drop,
206}180}
207181
208#[cfg_attr(feature = "structdump", derive(Codegen))]
209#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
210#[derive(Debug, Clone, PartialEq, Trace)]182#[derive(Debug, Clone, PartialEq, Trace)]
211pub enum Destruct {183pub enum Destruct {
212 Full(IStr),184 Full(IStr),
268 }240 }
269}241}
270242
271#[cfg_attr(feature = "structdump", derive(Codegen))]
272#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
273#[derive(Debug, Clone, PartialEq, Trace)]243#[derive(Debug, Clone, PartialEq, Trace)]
274pub enum BindSpec {244pub enum BindSpec {
275 Field {245 Field {
291 }261 }
292}262}
293263
294#[cfg_attr(feature = "structdump", derive(Codegen))]
295#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
296#[derive(Debug, PartialEq, Trace)]264#[derive(Debug, PartialEq, Trace)]
297pub struct IfSpecData(pub LocExpr);265pub struct IfSpecData(pub LocExpr);
298266
299#[cfg_attr(feature = "structdump", derive(Codegen))]
300#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
301#[derive(Debug, PartialEq, Trace)]267#[derive(Debug, PartialEq, Trace)]
302pub struct ForSpecData(pub Destruct, pub LocExpr);268pub struct ForSpecData(pub Destruct, pub LocExpr);
303269
304#[cfg_attr(feature = "structdump", derive(Codegen))]
305#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
306#[derive(Debug, PartialEq, Trace)]270#[derive(Debug, PartialEq, Trace)]
307pub enum CompSpec {271pub enum CompSpec {
308 IfSpec(IfSpecData),272 IfSpec(IfSpecData),
309 ForSpec(ForSpecData),273 ForSpec(ForSpecData),
310}274}
311275
312#[cfg_attr(feature = "structdump", derive(Codegen))]
313#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
314#[derive(Debug, PartialEq, Trace)]276#[derive(Debug, PartialEq, Trace)]
315pub struct ObjComp {277pub struct ObjComp {
316 pub pre_locals: Vec<BindSpec>,278 pub pre_locals: Vec<BindSpec>,
319 pub compspecs: Vec<CompSpec>,281 pub compspecs: Vec<CompSpec>,
320}282}
321283
322#[cfg_attr(feature = "structdump", derive(Codegen))]
323#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
324#[derive(Debug, PartialEq, Trace)]284#[derive(Debug, PartialEq, Trace)]
325pub enum ObjBody {285pub enum ObjBody {
326 MemberList(Vec<Member>),286 MemberList(Vec<Member>),
327 ObjComp(ObjComp),287 ObjComp(ObjComp),
328}288}
329289
330#[cfg_attr(feature = "structdump", derive(Codegen))]
331#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
332#[derive(Debug, PartialEq, Eq, Clone, Copy, Trace)]290#[derive(Debug, PartialEq, Eq, Clone, Copy, Trace)]
333pub enum LiteralType {291pub enum LiteralType {
334 This,292 This,
339 False,297 False,
340}298}
341299
342#[cfg_attr(feature = "structdump", derive(Codegen))]
343#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
344#[derive(Debug, PartialEq, Trace)]300#[derive(Debug, PartialEq, Trace)]
345pub struct SliceDesc {301pub struct SliceDesc {
346 pub start: Option<LocExpr>,302 pub start: Option<LocExpr>,
349}305}
350306
351/// Syntax base307/// Syntax base
352#[cfg_attr(feature = "structdump", derive(Codegen))]
353#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
354#[derive(Debug, PartialEq, Trace)]308#[derive(Debug, PartialEq, Trace)]
355pub enum Expr {309pub enum Expr {
356 Literal(LiteralType),310 Literal(LiteralType),
420 Slice(LocExpr, SliceDesc),374 Slice(LocExpr, SliceDesc),
421}375}
422376
423#[cfg_attr(feature = "structdump", derive(Codegen))]
424#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
425#[derive(Debug, PartialEq, Trace)]377#[derive(Debug, PartialEq, Trace)]
426pub struct IndexPart {378pub struct IndexPart {
427 pub value: LocExpr,379 pub value: LocExpr,
430}382}
431383
432/// file, begin offset, end offset384/// file, begin offset, end offset
433#[cfg_attr(feature = "structdump", derive(Codegen))]
434#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
435#[derive(Clone, PartialEq, Eq, Trace)]385#[derive(Clone, PartialEq, Eq, Trace)]
436#[trace(skip)]386#[trace(skip)]
437#[repr(C)]387#[repr(C)]
452}402}
453403
454/// Holds AST expression and its location in source file404/// Holds AST expression and its location in source file
455#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
456#[cfg_attr(feature = "structdump", derive(Codegen))]
457#[derive(Clone, PartialEq, Trace)]405#[derive(Clone, PartialEq, Trace)]
458pub struct LocExpr(pub Rc<Expr>, pub ExprLocation);406pub struct LocExpr(pub Rc<Expr>, pub ExprLocation);
459407
modifiedcrates/jrsonnet-parser/src/source.rsdiffbeforeafterboth
--- a/crates/jrsonnet-parser/src/source.rs
+++ b/crates/jrsonnet-parser/src/source.rs
@@ -8,10 +8,6 @@
 
 use jrsonnet_gcmodule::{Trace, Tracer};
 use jrsonnet_interner::{IBytes, IStr};
-#[cfg(feature = "serde")]
-use serde::{Deserialize, Serialize};
-#[cfg(feature = "structdump")]
-use structdump::Codegen;
 
 use crate::location::{location_to_offset, offset_to_location, CodeLocation};
 
@@ -130,31 +126,6 @@
 impl Default for SourcePath {
 	fn default() -> Self {
 		Self(Rc::new(SourceDefault))
-	}
-}
-
-#[cfg(feature = "structdump")]
-impl Codegen for SourcePath {
-	fn gen_code(
-		&self,
-		res: &mut structdump::CodegenResult,
-		unique: bool,
-	) -> structdump::TokenStream {
-		let source_virtual = self
-			.0
-			.as_any()
-			.downcast_ref::<SourceVirtual>()
-			.expect("can only codegen for virtual source paths!")
-			.0
-			.clone();
-		let val = res.add_value(source_virtual, false);
-		res.add_code(
-			structdump::quote! {
-				structdump_import::SourcePath::new(structdump_import::SourceVirtual(#val))
-			},
-			Some(structdump::quote!(SourcePath)),
-			unique,
-		)
 	}
 }
 
@@ -237,7 +208,6 @@
 ///
 /// It is used for --ext-code=.../--tla-code=.../standard library source code by default,
 /// and user can construct arbitrary values by hand, without asking import resolver
-#[cfg_attr(feature = "structdump", derive(Codegen))]
 #[derive(Trace, Hash, PartialEq, Eq, Debug, Clone)]
 pub struct SourceVirtual(pub IStr);
 impl Display for SourceVirtual {
@@ -288,8 +258,6 @@
 
 /// Either real file, or virtual
 /// Hash of FileName always have same value as raw Path, to make it possible to use with raw_entry_mut
-#[cfg_attr(feature = "structdump", derive(Codegen))]
-#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
 #[derive(Clone, PartialEq, Eq, Debug)]
 pub struct Source(pub Rc<(SourcePath, IStr)>);
 
modifiedcrates/jrsonnet-stdlib/Cargo.tomldiffbeforeafterboth
--- a/crates/jrsonnet-stdlib/Cargo.toml
+++ b/crates/jrsonnet-stdlib/Cargo.toml
@@ -11,14 +11,6 @@
 workspace = true
 
 [features]
-default = ["codegenerated-stdlib"]
-# Speed-up initialization by generating code for parsed stdlib,
-# instead of invoking parser for it.
-# This is mutually exclusive with `serialized-stdlib`.
-codegenerated-stdlib = ["jrsonnet-parser/structdump"]
-# Use the embedded serialized stdlib.
-# This is mutually exclusive with `codegenerated-stdlib`.
-serialized-stdlib = []
 # Enables legacy `std.thisFile` support, at the cost of worse caching
 legacy-this-file = []
 # Add order preservation flag to some functions
@@ -36,9 +28,7 @@
 jrsonnet-parser.workspace = true
 jrsonnet-gcmodule.workspace = true
 
-# Used for stdlib AST serialization
-bincode = { workspace = true, optional = true }
-# Used both for stdlib AST serialization and std.parseJson/std.parseYaml
+# Used for std.parseJson/std.parseYaml
 serde.workspace = true
 
 # std.md5
@@ -65,4 +55,3 @@
 
 [build-dependencies]
 jrsonnet-parser.workspace = true
-structdump = { workspace = true, features = ["derive"] }
deletedcrates/jrsonnet-stdlib/build.rsdiffbeforeafterboth
--- a/crates/jrsonnet-stdlib/build.rs
+++ /dev/null
@@ -1,36 +0,0 @@
-fn main() {
-	#[cfg(feature = "codegenerated-stdlib")]
-	{
-		use std::{env, fs::File, io::Write, path::Path};
-
-		use jrsonnet_parser::{parse, ParserSettings, Source};
-		use structdump::CodegenResult;
-
-		let parsed = parse(
-			include_str!("./src/std.jsonnet"),
-			&ParserSettings {
-				source: Source::new_virtual(
-					"<std>".into(),
-					include_str!("./src/std.jsonnet").into(),
-				),
-			},
-		)
-		.expect("parse");
-
-		let mut out = CodegenResult::default();
-
-		let v = out.codegen(&parsed, true);
-
-		{
-			let out_dir = env::var("OUT_DIR").unwrap();
-			let dest_path = Path::new(&out_dir).join("stdlib.rs");
-			let mut f = File::create(dest_path).unwrap();
-			f.write_all(
-				("#[allow(clippy::redundant_clone, clippy::similar_names)]".to_owned()
-					+ &v.to_string())
-					.as_bytes(),
-			)
-			.unwrap();
-		}
-	}
-}
deletedcrates/jrsonnet-stdlib/src/expr.rsdiffbeforeafterboth
--- a/crates/jrsonnet-stdlib/src/expr.rs
+++ /dev/null
@@ -1,109 +0,0 @@
-use jrsonnet_parser::LocExpr;
-
-pub fn stdlib_expr() -> LocExpr {
-	#[cfg(all(feature = "serialized-stdlib", feature = "codegenerated-stdlib"))]
-	compile_error!(
-		"features `serialized-stdlib` and `codegenerated-stdlib` are mutually exclusive"
-	);
-	#[cfg(all(feature = "serialized-stdlib", not(feature = "codegenerated-stdlib")))]
-	{
-		use bincode::{BincodeRead, DefaultOptions, Options};
-		use serde::{Deserialize, Deserializer};
-
-		struct LocDeserializer<R, O: Options> {
-			source: Source,
-			wrapped: bincode::Deserializer<R, O>,
-		}
-		macro_rules! delegate {
-			($(fn $name:ident($($arg:ident: $ty:ty),*))+) => {$(
-				fn $name<V>(mut self $(, $arg: $ty)*, visitor: V) -> Result<V::Value, Self::Error>
-				where V: serde::de::Visitor<'de>,
-				{
-					self.wrapped.$name($($arg,)* visitor)
-				}
-			)+};
-		}
-		impl<'de, R, O> Deserializer<'de> for LocDeserializer<R, O>
-		where
-			R: BincodeRead<'de>,
-			O: Options,
-		{
-			type Error = <&'de mut bincode::Deserializer<R, O> as Deserializer<'de>>::Error;
-
-			delegate! {
-				fn deserialize_any()
-				fn deserialize_bool()
-				fn deserialize_u16()
-				fn deserialize_u32()
-				fn deserialize_u64()
-				fn deserialize_i16()
-				fn deserialize_i32()
-				fn deserialize_i64()
-				fn deserialize_f32()
-				fn deserialize_f64()
-				fn deserialize_u128()
-				fn deserialize_i128()
-				fn deserialize_u8()
-				fn deserialize_i8()
-				fn deserialize_unit()
-				fn deserialize_char()
-				fn deserialize_str()
-				fn deserialize_string()
-				fn deserialize_bytes()
-				fn deserialize_byte_buf()
-				fn deserialize_enum(name: &'static str, variants: &'static [&'static str])
-				fn deserialize_tuple(len: usize)
-				fn deserialize_option()
-				fn deserialize_seq()
-				fn deserialize_map()
-				fn deserialize_struct(name: &'static str, fields: &'static [&'static str])
-				fn deserialize_identifier()
-				fn deserialize_newtype_struct(name: &'static str)
-				fn deserialize_unit_struct(name: &'static str)
-				fn deserialize_tuple_struct(name: &'static str, len: usize)
-				fn deserialize_ignored_any()
-			}
-
-			fn is_human_readable(&self) -> bool {
-				false
-			}
-		}
-
-		// In build.rs, Source object is populated with empty values, deserializer wrapper loads correct values on deserialize
-		let mut deserializer = bincode::Deserializer::from_slice(
-			include_bytes!(concat!(env!("OUT_DIR"), "/stdlib.bincode")),
-			DefaultOptions::new()
-				.with_fixint_encoding()
-				.allow_trailing_bytes(),
-		);
-
-		// Should not panic, stdlib.bincode is generated in build.rs
-		LocExpr::deserialize(&mut deserializer).unwrap()
-	}
-
-	#[cfg(all(feature = "codegenerated-stdlib", not(feature = "serialized-stdlib")))]
-	{
-		mod structdump_import {
-			pub(super) use std::{option::Option, rc::Rc, vec};
-
-			pub(super) use jrsonnet_parser::*;
-		}
-
-		include!(concat!(env!("OUT_DIR"), "/stdlib.rs"))
-	}
-
-	#[cfg(not(any(feature = "serialized-stdlib", feature = "codegenerated-stdlib")))]
-	{
-		use jrsonnet_parser::Source;
-
-		const STDLIB_STR: &str = include_str!("./std.jsonnet");
-
-		jrsonnet_parser::parse(
-			STDLIB_STR,
-			&jrsonnet_parser::ParserSettings {
-				source: Source::new_virtual("<std>".into(), STDLIB_STR.into()),
-			},
-		)
-		.unwrap()
-	}
-}
modifiedcrates/jrsonnet-stdlib/src/lib.rsdiffbeforeafterboth
--- a/crates/jrsonnet-stdlib/src/lib.rs
+++ b/crates/jrsonnet-stdlib/src/lib.rs
@@ -36,7 +36,6 @@
 mod arrays;
 mod compat;
 mod encoding;
-mod expr;
 mod hash;
 mod manifest;
 mod math;
@@ -54,14 +53,6 @@
 #[allow(clippy::too_many_lines)]
 pub fn stdlib_uncached(settings: Rc<RefCell<Settings>>) -> ObjValue {
 	let mut builder = ObjValueBuilder::new();
-
-	let expr = expr::stdlib_expr();
-	let eval = jrsonnet_evaluator::evaluate(ContextBuilder::dangerous_empty_state().build(), &expr)
-		.expect("stdlib.jsonnet should have no errors")
-		.as_obj()
-		.expect("stdlib.jsonnet should evaluate to object");
-
-	builder.with_super(eval);
 
 	// FIXME: Use PHF
 	for (name, builtin) in [
deletedcrates/jrsonnet-stdlib/src/std.jsonnetdiffbeforeafterboth
--- a/crates/jrsonnet-stdlib/src/std.jsonnet
+++ /dev/null
@@ -1,5 +0,0 @@
-{
-  local std = self,
-
-  thisFile:: error 'std.thisFile is deprecated, to enable its support in jrsonnet - recompile it with "legacy-this-file" support.\nThis will slow down stdlib caching a bit, though',
-}