frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Show HN: minfern – Type inference for JavaScript without transpilation

https://github.com/sinelaw/minfern
2•_sinelaw_•2h ago
I wrote a type checker (minfern - https://github.com/sinelaw/minfern) for a subset of javascript with no transpilation. It accepts valid JS as input and allows a subset of JS code to pass the checking. There’s no transpilation or compilation needed. The input code can be run directly.

Try it online at: https://sinelaw.github.io/minfern/

It could be used for checking code targeting normal JS runtimes, or runtimes like mquickjs (though minfern is more strict but also allows things like ‘const’ which mquickjs doesn’t). minfern is based on the type system for Infernu, which I wrote back in 2015, but is less hacky and has a cleaner implementation.

Very simple example:

  function calculateTotal(product, quantity) {
    return product.price * quantity;
  }
  var item = {
    name: "Wireless Mouse",
    cost: 25 // Note the property name is 'cost', not 'price'
  };
  console.log(calculateTotal(item, 2));
Output:

  Error: Property 'price' not found in type {cost: Number, name: String}
      ╭─[ tests/example_error.js:11:13 ]
      │
   11 │ console.log(calculateTotal(item, 2));
      │             ───────────┬───────────  
      │                        ╰───────────── Property 'price' not found in type {cost: Number, name: String}
  ────╯
Type system features:

- Full type inference with principle typing, support for type annotations

- Parameteric polymorphism (aka “generic functions”)

- Structural typing with row-type polymorphism

- Object method typing with equi-recursive types (for self/“this”)

- Polymorphic object methods (still considered rank-1)

- Basic constraints “Plus a” and “Indexable a” to allow + and [] to apply to different types like numbers, strings, arrays.

This allows a subset of JS expressions to be checked.

Some JS idioms are not allowed by this system:

- No union types (design choice) - return values, variables, arrays, etc must have a single type. Currently it doesn’t support returning null/undefined either, this can be fixed in the future by adding Optional as a type, but makes principle typing harder.

- No sum types (yet) - this explains why I haven’t added Optional<T>, I think sum types will fit in the type system and are doable. Once added also enums could be expressed.

- Value restriction forbids reassigning to polymorphic variables after declaration (ML-style).

- As a result of the above - can’t use && / || operators like some people do in JS. The operators are required to have the same type on both sides (no allowing “undefined” on one side)

- No type coercion, converting a number to a string (for example) requires using String() constructor.

- And probably other limitations that people might see as a limitation rather than a feature of the type system.

Disclaimer: this type checker comes with NO WARRANTY. I am not a language expert. I didn’t prove soundness, and would love someone who’s an expert to look at it. That being said - it looks correct on all the tests I’ve tried. It’s based on HMF and other published type systems but combines things in a different way.

GitHub: https://github.com/sinelaw/minfern

Does the Nvidia "Revenue Sharing Agreement" Tie the US Gov't Hands?

1•DivingForGold•1m ago•0 comments

Drawing Truchet Tiles in SVG

https://alexwlchan.net/2025/truchet-tiles/
1•eustoria•5m ago•0 comments

Show HN: Monopipe (Alpha), read blogs from terminal using piping-server

https://monopipe.exe.xyz/
1•Imustaskforhelp•9m ago•0 comments

Netdata: Monitoring and Troubleshooting Transformed

https://www.netdata.cloud/
1•eustoria•10m ago•0 comments

Designing Predictable LLM-Verifier Systems for Formal Method Guarantee

https://arxiv.org/abs/2512.02080
1•PaulHoule•13m ago•0 comments

Terence Tao: AI contributions to Erdős problems

https://github.com/teorth/erdosproblems/wiki/AI-contributions-to-Erd%C5%91s-problems
1•frozenseven•13m ago•0 comments

Parsing Advances

https://matklad.github.io/2025/12/28/parsing-advances.html
1•mfrw•15m ago•0 comments

Ask HN: Best Podcasts of 2025?

3•adriancooney•17m ago•1 comments

Jensen Huang meets with former hostage and Nvidia employee Avinatan Or

https://www.ynetnews.com/business/article/skw4qsomwl
1•thenaturalist•18m ago•0 comments

Git and Markdown are all you need

https://www.galiglobal.com/blog/2025/20251221-git-and-markdown-are-all-you-need.html
1•antonmry•19m ago•1 comments

The Optimal Architecture for Small Language Models

https://huggingface.co/blog/codelion/optimal-model-architecture
1•simonpure•19m ago•0 comments

Nvidia deal a big win for Groq employees

https://www.axios.com/2025/12/28/nvidia-groq-shareholders
2•seanlinehan•20m ago•0 comments

Show HN: Meter – Web scraping that syncs only what changed

https://www.meter.sh/
1•mckinnonr•20m ago•0 comments

Beyond Vector Search: Building an Adaptive Retrieval Router for Agentic AI

https://medium.com/@sumoaps/beyond-vector-search-building-an-adaptive-retrieval-router-for-agenti...
1•sumoaps•21m ago•1 comments

Show HN: FlowCode – Visual Flowcharts That Generate and Execute Python

https://southernadd-cmyk.github.io/flowCode/
1•adamclement•22m ago•0 comments

Microsoft Open Specifications

https://learn.microsoft.com/en-us/openspecs/main/ms-openspeclp/3589baea-5b22-48f2-9d43-f5bea4960ddb
1•vitorsr•22m ago•0 comments

Laid Off After 25 Years in Tech:The Anxiety,Sacrifice,Reality No One Talks About [video]

https://www.youtube.com/watch?v=VeMA9WGKxOg
2•jcsoft•23m ago•0 comments

Bluetooth Headphone Jacking: A Key to Your Phone [video]

https://media.ccc.de/v/39c3-bluetooth-headphone-jacking-a-key-to-your-phone
3•willnix•24m ago•1 comments

Mitra 15 (French minicomputer from the 1970)

https://en.wikipedia.org/wiki/Mitra_15
1•JPLeRouzic•26m ago•0 comments

People Who Drink Bottled Water Daily Get 90k More Microplastic Particles a Year

https://www.wired.com/story/people-who-drink-bottled-water-on-a-daily-basis-ingest-90000-more-mic...
4•beardyw•27m ago•0 comments

Radioscope: A device that turns Wi-Fi activity into sound

https://github.com/simg/radioscope
1•simg•27m ago•1 comments

Playing Factorio from 1k floppy disks

https://www.youtube.com/watch?v=cTPBGZcTRqo
1•kllrnohj•28m ago•0 comments

Secret code break that 'solved' the Zodiac killer case

https://papalinc.com/secret-code-break-that-solved-the-zodiac-killer-case-expert-who-unmasked-sin...
1•goloroden•29m ago•0 comments

Show HN: Better Git for KiCad

https://www.paplix.io/
1•Mechse•33m ago•0 comments

Show HN: Codenhack – An interactive terminal and live editor for beginners

https://codenhack.com/
1•codenhack•34m ago•0 comments

Toward Training Superintelligent Software Agents Through Self-Play SWE-RL

https://arxiv.org/abs/2512.18552
1•pama•35m ago•0 comments

Do You Remember ISDN?

https://www.youtube.com/watch?v=rQfy8T-VOs4
1•linsomniac•36m ago•2 comments

Zero-days in GPG out in the wild [video]

https://media.ccc.de/v/39c3-to-sign-or-not-to-sign-practical-vulnerabilities-i
1•l1am0•36m ago•0 comments

Country makes call to cancel all visas for Americans

https://www.thestreet.com/travel/country-makes-call-to-cancel-all-visas-for-americans
4•sipofwater•41m ago•1 comments

Show HN: mdfocus – A distraction free Markdown reader for your localhost

https://github.com/tzador/mdfocus
2•timz•41m ago•0 comments