frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

A parser for TypeScript types, written in TypeScript types

https://github.com/easrng/tsints
43•todsacerdoti•6h ago

Comments

tmcanada•4h ago
How does it compare to TypeBox?

https://github.com/sinclairzx81/typebox#syntax

cjonas•4h ago
Pretty sure this is a joke/demo for the power of type scripts typing system
johnfn•3h ago
Sometimes at work I can't figure out some TS type and start thinking it's impossible. Then I remember that repos like this exist, and if some guy really managed to parse Typescript types in Typescript, that my problem is peanuts compared to that.

That usually motivates me to solve my problem.

bapak•3h ago
Some things are still impossible. I lost count of the bugs I reported to TS only to be told that "works as intended" or that it's a "design limitation."
Etheryte•2h ago
On the flip side, if you can't find a close enough type definition with reasonable effort, it's often a sign that you're about to enter gibberish type territory and it might be time to reconsider. Even if a type does exist in the end, it might be unparseable to every human on your team, future you included.
Tade0•37m ago
This. I regret every use of `infer`, save for one instance in which it actually helped, but it was a side project anyway.
askonomm•1h ago
There was even a guy who got Doom running entirely in TS types[0].

[0]: https://www.youtube.com/watch?v=0mCsluv5FXA

sorrythanks•1h ago
that's funny, it motivates me to type `any`
dvt•2h ago
(removed)
kuruczgy•2h ago
TypeScript (the types part) absolutely does have ternary operators: https://www.typescriptlang.org/docs/handbook/2/conditional-t...
mpoteat•1h ago
I took a look at the source for the attached repository - the parser is in fact clearly written as a generic type. The presence of ?, :, and ... operators represent conditional types and tuple level destructuring respectively.

This is a very impressive project in my view - it's baffling that you would have the wherewithal to link the discussion you did but not realize the novelty here.

aprilthird2021•1h ago
I once went really deep into fancy, fun generic Typescript types (think the kind of type that can verify whether a string is written in "SpongebobMemecase" like "tHiS" vs "this"), and Typescript types can and do use ternary and rest operators
drej•1h ago
For those not familiar with this kind of computing challenges, I must link this wonderful video about TypeScript types running... DOOM. https://www.youtube.com/watch?v=0mCsluv5FXA
mpoteat•1h ago
If folks are interested in this sort of thing, but want to play around with higher order building blocks, http://hkt.code.lol may be worth checking out.

In addition to type-level analogues of your normal Lodash-esque functions, it includes a suite of type-level parser combinator utilities and is built on higher-kinded type abstractions.

New quantum state of matter found at interface of exotic materials

https://phys.org/news/2025-07-quantum-state-interface-exotic-materials.html
54•janandonly•2d ago•2 comments

Modern Node.js Patterns

https://kashw1n.com/blog/nodejs-2025/
599•eustoria•13h ago•268 comments

So you want to parse a PDF?

https://eliot-jones.com/2025/8/pdf-parsing-xref
228•UglyToad•10h ago•119 comments

Writing a good design document

https://grantslatton.com/how-to-design-document
340•kiyanwang•12h ago•86 comments

Persona vectors: Monitoring and controlling character traits in language models

https://www.anthropic.com/research/persona-vectors
347•itchyjunk•16h ago•116 comments

A parser for TypeScript types, written in TypeScript types

https://github.com/easrng/tsints
43•todsacerdoti•6h ago•14 comments

If you're remote, ramble

https://stephango.com/ramblings
823•lawgimenez•22h ago•406 comments

Life, Work, Death and the Peasant: Family Formation

https://acoup.blog/2025/08/01/collections-life-work-death-and-the-peasant-part-iiia-family-formation/
141•Khaine•2d ago•3 comments

How Python grew from a language to a community

https://thenewstack.io/how-python-grew-from-a-language-to-a-community/
64•lumpa•16h ago•27 comments

Why doctors hate their computers (2018)

https://www.newyorker.com/magazine/2018/11/12/why-doctors-hate-their-computers
53•mitchbob•8h ago•51 comments

Typed languages are better suited for vibecoding

https://solmaz.io/typed-languages-are-better-suited-for-vibecoding
164•hosolmaz•8h ago•139 comments

Rising Young Worker Despair in the United States

https://www.nber.org/papers/w34071
13•johntfella•4h ago•3 comments

C++: "model of the hardware" vs. "model of the compiler" (2018)

http://ithare.com/c-model-of-the-hardware-vs-model-of-the-compiler/
10•oumua_don17•4d ago•7 comments

How to grow almost anything

https://howtogrowalmostanything.notion.site/htgaa25
110•car•10h ago•25 comments

Efficiently Generating a Number in a Range (2018)

https://www.pcg-random.org/posts/bounded-rands.html
20•csense•1d ago•3 comments

2,500-year-old Siberian 'ice mummy' had intricate tattoos, imaging reveals

https://www.bbc.com/news/articles/c4gzx0zm68vo
214•dxs•3d ago•57 comments

Survival at High Altitudes: Wheel-Well Passengers (1996)

https://rosap.ntl.bts.gov/view/dot/57536
4•NaOH•2d ago•0 comments

Welcome to url.town, population 465

https://url.town/
160•plaguna•2d ago•43 comments

Tokens are getting more expensive

https://ethanding.substack.com/p/ai-subscriptions-get-short-squeezed
301•admp•21h ago•201 comments

Poorest US workers hit hardest by slowing wage growth

https://www.ft.com/content/cfb77a53-fef8-4382-b102-c217e0aa4b25
126•hhs•7h ago•165 comments

A dedicated skin-to-brain circuit for cool sensation in mice

https://www.sciencedaily.com/releases/2025/07/250730030354.htm
7•freedomben•2d ago•0 comments

This Old SGI: notes and memoirs on the Silicon Graphics 4D series (1996)

https://archive.irixnet.org/thisoldsgi/
85•exvi•17h ago•13 comments

Twenty Eighth International Obfuscated C Code Contest

https://www.ioccc.org/2024/index.html
335•mdl_principle•1d ago•96 comments

How to make almost anything (2019)

https://fab.cba.mit.edu/classes/863.19/CBA/people/dsculley/index.html
193•teleforce•21h ago•24 comments

Everything to know about UniFi OS Server

https://deluisio.com/networking/unifi/2025/08/03/everything-you-need-to-know-about-unifi-os-server-before-you-waste-time-testing-it/
66•codydeluisio•11h ago•5 comments

The first lunar road trip

https://nautil.us/the-first-lunar-road-trip-1227738/
3•dnetesn•2d ago•0 comments

Show HN: Schematra – Sinatra-inspired minimal web framework for Chicken Scheme

https://github.com/rolandoam/schematra
34•funkaster•2d ago•1 comments

Lina Khan points to Figma IPO as vindication of M&A scrutiny

https://techcrunch.com/2025/08/02/lina-khan-points-to-figma-ipo-as-vindication-for-ma-scrutiny/
405•bingden•1d ago•403 comments

Shrinking freshwater availability increasing land contribution to sea level rise

https://news.asu.edu/20250725-environment-and-sustainability-new-global-study-shows-freshwater-disappearing-alarming
143•ornel•13h ago•51 comments

UN report finds UN reports are not widely read

https://www.reuters.com/world/un-report-finds-united-nations-reports-are-not-widely-read-2025-08-01/
318•anjneymidha•16h ago•115 comments