Skip to content

Conversation

@AugusDogus
Copy link

I noticed hyperimport wasn't working on Windows and made as minimal changes possible to get it running:

  • Use llvm-nm instead of nm (not available on Windows)
  • Drop lib prefix from DLLs (math.dll not libmath.dll)
  • Added platform checks with process.platform === "win32"
  • Added docs about needing LLVM installed.

- Use llvm-nm instead of nm on Windows for symbol extraction
- Remove lib prefix from DLL names on Windows (math.dll vs libmath.so)
- Add platform detection using process.platform === "win32"
- Fix Zig loader build command to use correct library naming on Windows
- Add .dll extension support to library loader
- Document Windows requirements and LLVM installation in README
@AugusDogus
Copy link
Author

After further investigation, I realized that the llvm-nm change doesn't fully solve symbol extraction on Windows DLLs - llvm-nm returns empty results for Windows DLLs due to how they store symbols differently than ELF binaries.

However, the library naming fixes (libPrefix changes for Rust/Zig loaders and .dll support) are still needed.

The "real" solution for symbol extraction is probably automatic type generation using source code parsing (like PR #5).

- Implement Tree-sitter WASM-based parsing for Rust and Zig source files
- Auto-generate function signatures with argument and return types from source code
- Add parseRustTypes() for parsing #[no_mangle] extern "C" functions
- Add parseZigTypes() for parsing pub export fn functions
- Remove nm dependency for source-based loaders (Rust/Zig)
- Add comprehensive test suite with 16 tests covering:
  - Primitive types (u32, i32, f32, bool)
  - I/O streams (stdout/stderr for both languages)
  - Pointer parameters (C strings)
  - Function pointer callbacks
- Auto-detect test mode (NODE_ENV=test) to skip configuration prompts
- Add web-tree-sitter@0.25.10 dependency
- Add package.json exports field for local module resolution
- Simplify test structure with bunfig.toml test configuration

BREAKING CHANGE: Rust and Zig loaders now automatically infer types.
Manual configuration in @types/<file>/config.ts is still supported.
@AugusDogus AugusDogus force-pushed the main branch 3 times, most recently from 1beef28 to 643da02 Compare November 23, 2025 04:35
Add @see JSDoc comments to generated .d.ts files that link to the exact
line in the original Rust/Zig source file where each function is defined.
This improves IDE navigation by allowing developers to jump directly to
the source implementation from TypeScript definitions.

- Capture line numbers during Tree-sitter parsing
- Generate JSDoc @see tags with file:// URLs pointing to source:line
- Update FunctionType interface to include optional line number
- Works with both Rust and Zig loaders
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