Settings

Theme

Show HN: TypeNix – full typing for Nix language by mapping to the TS AST

github.com

5 points by ryanrasti 2 months ago · 2 comments

Reader

mehackernewsacc 2 months ago

Whoa. This is very, very cool. I love TypeScript and its type system, and started using Nix in the past few years and wished it could have something similar.

ryanrastiOP 2 months ago

I'm the author, you may find interesting:

1. Instead of building a new checker, TypeNix maps Nix's AST directly to TypeScript's AST. The standard TS binder, type checker and LSP work almost unchanged – they never know they’re looking at Nix

2. TypeNix on all 42K nixpkgs files in 13 seconds locally. Fixed-point patterns (makeExtensible, finalAttrs) typed via class transform with `this` binding.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection