Skip to content

Docs overhaul, compiler fixes, and new codegen features#63

Merged
cs01 merged 16 commits intomainfrom
hn-updates
Feb 26, 2026
Merged

Docs overhaul, compiler fixes, and new codegen features#63
cs01 merged 16 commits intomainfrom
hn-updates

Conversation

@cs01
Copy link
Owner

@cs01 cs01 commented Feb 26, 2026

various fixes

Docs overhaul, compiler fixes, and new codegen features

New Features

  • String.fromCharCode — codegen support for the static string method
  • JSON.stringify for object arrays — handles arrays of typed objects via yyjson bridge
  • \x and \u hex escapes — native parser now correctly handles hex/unicode escape sequences in string literals
  • -g flag for native compiler — pass debug flag through to llc for debug info builds
  • Strip binaries by default — output binaries are stripped unless -g is set

Bug Fixes

  • .opt.bc not cleaned up — intermediate optimizer bitcode file was silently leaking after every build; fixed in both compiler.ts and native-compiler-lib.ts
  • Copy-as-markdown button — rewrote to lazily load raw .md via import.meta.glob on click instead of pre-loading all pages through transformPageData; also fixed z-index stacking so the button renders above content
  • Env access in native CLI — fixed process.env access when running the compiler as a native binary
  • Diagnostic color propagation — color/TTY setting now propagates correctly to the native compiler's diagnostic engine
  • Help command grouping — CLI help output groups commands by category

Docs

  • Architecture page expanded — new sections covering LLVM IR with a live example, types and semantics (integer vs float, null safety), and why the TypeScript subset works well for LLMs
  • Pipeline description corrected — was "llc (assembler) and clang (linker)"; now correctly describes the full opt → llc → clang pipeline with accurate tool descriptions
  • Homepage — removed LLVM IR animation, replaced watch mode feature callout with single-binary deploy
  • Installation page — clarified prerequisites
  • Examples page — consolidated and refreshed
  • Platform support — removed stale musl reference
  • CLI reference — updated cross-compilation and flag docs

Examples

  • HackerNews example updated with improved frontend (JS, HTML) and cleaner server code
  • HTTP server and websocket examples cleaned up

@cs01 cs01 merged commit a037e7a into main Feb 26, 2026
12 checks passed
@cs01 cs01 deleted the hn-updates branch February 26, 2026 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant