Conversation
48a4ee8 to
155319f
Compare
…writer animations
…ler compatibility
Merged
cs01
added a commit
that referenced
this pull request
Apr 19, 2026
…ields closes dapweb NOTES #8 'Blocker': JSON.parse<T> with arrays emitted broken IR and, when that was fixed, produced wrong values at runtime. two bugs really, both rooted in a single architectural choice: 1. tryHandleGlobalJSONParse tagged the typed result with SymbolKind_JSON. downstream member access treated the variable as a yyjson lazy handle and emitted csyyjson_obj_get(%T* as i8*, "field") — bogus pointer reads for any field except primitives. the 'two truths' problem: the struct was populated correctly at parse time but ignored. 2. the parser itself emitted @parse_json_number[] for nested T[] fields — unmangled TS type tokens leaking into LLVM IR as function names. fix (direction A, drop lazy metadata on typed parse): - tryHandleGlobalJSONParse now tags with SymbolKind_Object. member access uses struct-GEP exclusively. the yyjson-lazy path is scoped to bare JSON.parse(s) — which is already a compile error in ChadScript, so the lazy path is effectively unreachable from user code now. - generateJsonParser for number[] / string[] fields materializes the %Array* / %StringArray* inline via csyyjson_arr_* into the struct slot, matching the runtime layout expected by .length and for-of. - T[] for user-defined T rejects with a clear 'not yet supported' error (no more broken @parse_json_T[] call). unblocks typed parsing of realistic DAP responses (stackTrace, scopes, variables, setBreakpoints, evaluate, stopped events — all have nested arrays). dapweb can drop its homegrown extractField walker.
4 tasks
cs01
added a commit
that referenced
this pull request
Apr 19, 2026
…ields (#554) closes dapweb NOTES #8 'Blocker': JSON.parse<T> with arrays emitted broken IR and, when that was fixed, produced wrong values at runtime. two bugs really, both rooted in a single architectural choice: 1. tryHandleGlobalJSONParse tagged the typed result with SymbolKind_JSON. downstream member access treated the variable as a yyjson lazy handle and emitted csyyjson_obj_get(%T* as i8*, "field") — bogus pointer reads for any field except primitives. the 'two truths' problem: the struct was populated correctly at parse time but ignored. 2. the parser itself emitted @parse_json_number[] for nested T[] fields — unmangled TS type tokens leaking into LLVM IR as function names. fix (direction A, drop lazy metadata on typed parse): - tryHandleGlobalJSONParse now tags with SymbolKind_Object. member access uses struct-GEP exclusively. the yyjson-lazy path is scoped to bare JSON.parse(s) — which is already a compile error in ChadScript, so the lazy path is effectively unreachable from user code now. - generateJsonParser for number[] / string[] fields materializes the %Array* / %StringArray* inline via csyyjson_arr_* into the struct slot, matching the runtime layout expected by .length and for-of. - T[] for user-defined T rejects with a clear 'not yet supported' error (no more broken @parse_json_T[] call). unblocks typed parsing of realistic DAP responses (stackTrace, scopes, variables, setBreakpoints, evaluate, stopped events — all have nested arrays). dapweb can drop its homegrown extractField walker. Co-authored-by: cs01 <cs01@users.noreply.github.com>
This was referenced Apr 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Language & API improvements
sqlite.get()andsqlite.all()now return all columns pipe-separated (e.g.,"1|Alice") with a new__sqlite_row_to_stringhelperisFileandisDirectoryare now methods (.isFile()) for Node.js compatibility; fixedpath.join()behaviorChadScript.embedFile(),embedDir(), andgetEmbeddedFile()for bundling static assets into binariesBuild & tooling
chad-native.tsto use it.css,.js,.json,.html,.svg,.png,.jpg,.woff2,.wasm)--target-cpuflag; default to x86-64 in CI to fix SIGILL on runnersExamples & other
queryandparallelexample programsAll tests pass; self-hosting verified.