frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Claude Memory

https://www.anthropic.com/news/memory
219•doppp•3h ago•137 comments

Trump pardons convicted Binance founder

https://www.wsj.com/finance/currencies/trump-pardons-convicted-binance-founder-7509bd63
297•cowboyscott•5h ago•185 comments

What happened to Apple's legendary attention to detail?

https://blog.johnozbay.com/what-happened-to-apples-attention-to-detail.html
331•Bogdanp•1h ago•183 comments

New updates and more access to Google Earth AI

https://blog.google/technology/research/new-updates-and-more-access-to-google-earth-ai/
81•diogenico•3h ago•24 comments

Reasoning Is Not Model Improvement

https://manidoraisamy.com/reasoning-not-ai.html
47•QueensGambit•5h ago•38 comments

Make Any TypeScript Function Durable

https://useworkflow.dev/
56•tilt•3h ago•36 comments

Kaitai Struct: declarative binary format parsing language

https://kaitai.io/
27•djoldman•1w ago•7 comments

I spent a year making an ASN.1 compiler in D

https://bradley.chatha.dev/blog/dlang-propaganda/asn1-compiler-in-d/
220•BradleyChatha•7h ago•108 comments

Show HN: OpenSnowcat – A fork of Snowplow to keep open analytics alive

https://opensnowcat.io/
19•joaocorreia•1h ago•3 comments

Show HN: Tommy – Turn ESP32 devices into through-wall motion sensors

https://www.tommysense.com
39•mike2872•3h ago•30 comments

PyTorch Monarch

https://pytorch.org/blog/introducing-pytorch-monarch/
283•jarbus•10h ago•38 comments

VST3 audio plugin format is now MIT

https://forums.steinberg.net/t/vst-3-8-0-sdk-released/1011988
604•rock_artist•14h ago•144 comments

Armed police swarm student after AI mistakes bag of Doritos for a weapon

https://www.dexerto.com/entertainment/armed-police-swarm-student-after-ai-mistakes-bag-of-doritos...
213•antongribok•2h ago•143 comments

Pyscripter – open-source Python IDE written in Delphi

https://github.com/pyscripter/pyscripter
8•peter_d_sherman•3d ago•0 comments

How count-min sketches work – frequencies, but without the actual data

https://www.instantdb.com/essays/count_min_sketch
25•stopachka•1d ago•2 comments

Show HN: Git for LLMs – a context management interface

https://twigg.ai
21•jborland•5h ago•6 comments

Summary of the Amazon DynamoDB Service Disruption in US-East-1 Region

https://aws.amazon.com/message/101925/
303•meetpateltech•19h ago•51 comments

Show HN: I built a tech news aggregator that works the way my brain does

https://deadstack.net/recent
92•dreadsword•2h ago•55 comments

OpenAI acquires Sky.app

https://openai.com/index/openai-acquires-software-applications-incorporated
48•meetpateltech•3h ago•23 comments

OpenMaxIO: Forked UI for MinIO Object Storage

https://github.com/OpenMaxIO/openmaxio-object-browser
144•nimbius•2h ago•37 comments

The OS/2 Display Driver Zoo

https://www.os2museum.com/wp/the-os-2-display-driver-zoo/
30•kencausey•1w ago•2 comments

Can "second life" EV batteries work as grid-scale energy storage?

https://www.volts.wtf/p/can-second-life-ev-batteries-work
51•davidw•2h ago•48 comments

The Muscular Compassion of "Paper Girl"

https://www.newyorker.com/books/page-turner/the-muscular-compassion-of-paper-girl
9•mitchbob•1h ago•2 comments

Nango (YC W23) is hiring staff back-end engineers (remote)

https://www.nango.dev/careers
1•bastienbeurier•8h ago

Antislop: A framework for eliminating repetitive patterns in language models

https://arxiv.org/abs/2510.15061
70•Der_Einzige•4h ago•66 comments

Unconventional Ways to Cast in TypeScript

https://wolfgirl.dev/blog/2025-10-22-4-unconventional-ways-to-cast-in-typescript/
57•Bogdanp•7h ago•24 comments

VectorWare – from creators of `rust-GPU` and `rust-CUDA`

https://www.vectorware.com/blog/announcing-vectorware/
54•ashvardanian•5h ago•18 comments

Programming with Less Than Nothing

https://joshmoody.org/blog/programming-with-less-than-nothing/
390•signa11•15h ago•137 comments

CRDTs: Convergence without coordination

https://read.thecoder.cafe/p/crdt
67•0xKelsey•1w ago•27 comments

Upgrading Our Way Through OpenGL 1.x

https://bumbershootsoft.wordpress.com/2025/09/27/upgrading-our-way-through-opengl-1-x/
36•PaulHoule•1w ago•0 comments
Open in hackernews

Unconventional Ways to Cast in TypeScript

https://wolfgirl.dev/blog/2025-10-22-4-unconventional-ways-to-cast-in-typescript/
57•Bogdanp•7h ago

Comments

Octoth0rpe•3h ago
Sigh, the abuse of void was particularly eye-opening for me. If one really must do this - and I can think of a couple of cases where one might mostly around progressively porting old codebases to typescript - I'd strongly prefer the simple `a as unknown as B;` as one can easily grep for ` as unknown as ` to find your crimes.
fenomas•2h ago
Funny, just yesterday I found myself casting in a way I'd never seen before:

    const arr = ['foo'] as ['foo']
This wound up being useful in a situation that boiled down to:

    type SomeObj = { foo: string, bar: string }
    export const someFn = (props: (keyof SomeObj)[]) => {}

    // elsewhere
    const props = ['foo'] as ['foo']
    someFn(props)
In a case like that `as const` doesn't work, since the function doesn't expect a readonly argument. Of course there are several other ways to do it, but in my case the call site didn't currently import the SomeObj type, so casting "X as X" seemed like the simplest fix.
c-hendricks•2h ago
I generally put lint rules to prevent casting, why cast here instead of declaring `props: (keyof SomeObj)[]` or `props: Parameters<typeof someFn>[0]`?
fenomas•2h ago
Er, my justification was that the code in question was meant to be minimally demonstrating someFn, and adding an import or a verbose type seemed to distract from that a little.

But mostly it just gave me a chuckle. I tried it because it seemed logical, but I didn't really think it was going to work until it did..

pverheggen•2h ago
Why not use annotation instead?

  const props: ['foo'] = ['foo']
halflife•2h ago
Or: cons foo = [‘foo’] as const;
wk_end•1h ago
> In a case like that `as const` doesn't work, since the function doesn't expect a readonly argument.
cat-whisperer•57m ago
I don’t get this? why do I need to say as const?
afdbcreid•52m ago
`as const` is a special annotation that lets the TypeScript compiler infers the more specific type `["foo"]` instead of `string[]`.
fenomas•1h ago
Didn't occur to me, that's certainly more defensible! Though maybe less humorous.
NathanaelRea•58m ago
You could also do

    const arr = ["foo" as const]
metadaemon•1h ago
Surprised the `satisfies` operator wasn't called out
worik•1h ago
This why I find Typescript frustrating.

It really should be called "vaguely typed script"

culi•1h ago
it's gradually and structurally typed and I think that's what makes it great. I also disagree that it's vague. Nowadays you can even have typesafe regex
shepherdjerred•7m ago
TypeScript is incredibly safe if you use strict tsc settings and ts-eslint strict presets.

If it were this strict out-of-the-box, it probably would have been hated since most devs don't really want to deal with static typing.

https://typescript-eslint.io/getting-started/typed-linting

culi•1h ago
This post is trying to solve a problem you should never have to solve. The function in the post:

  const cast = <A, B,>(a: A): B => a as unknown as B;
should never be used in a professional codebase. The post even admits (though, in my opinion, understates) as much:

> If you're holding it right, these things don't come up, and your code genuinely is much much safer than if you used raw Javascript.

Just wanted to highlight this point I feel needs to be underscored

mpeg•1h ago
Eh it's ok to use `as unknown as X` sometimes

If you have complex types, it's sometimes the easiest way to do what you want, and it's perfectly safe as long as you are 100% sure that the types are compatible.

For example, where you have a fluent-style API where each method modifies the types it's unavoidable to end up using that kind of cast

aniviacat•1h ago
> it's perfectly safe as long as you are 100% sure

That was funny to read

mpeg•58m ago
If you disagree, you're welcome to prove me wrong!

To give you an example from a popular open source ts-heavy project:

https://github.com/elysiajs/elysia/blob/94abb3c95e53e2a77078...

The `return this as any` there, which effectively casts it to the same type this had, but with the added get route is perfectly safe, it works, and will never be a problem by itself.

lovich•55m ago
It’s funny because the reason you used a language like typescript is because you want the compiler to be 100% sure that it’s compatible, not relying on human reasoning.

If you were going to rely on that anyway, why not just use JavaScript as is and avoid the boilerplate from typescript

mpeg•52m ago
The code I linked for example results in a web router that is fully type safe.

It's not like using js at all, not that I think there's anything wrong with it, if that's your jam.

eyelidlessness•1h ago
It’s not even safe if you’re 100% sure the types are compatible, unless you’re also 100% sure nothing will change that fact. The reason it’s unsafe is because it suppresses the type error permanently, even if whatever factors led to your certainty now change anywhere upstream ever.

There are certainly ways to guard against that, but most of them involve some amount of accepting that the type checker produces errors for a reason.

mpeg•54m ago
Yes of course the types could change in the future, and the forced cast might cause issues. I wish there was a better way, but this is an acceptable tradeoff.

Bear in mind, most changes that could cause issues will still be caught by the type checker in whatever object you're casting to. Obviously it should not be overused where not needed, but it's almost always used in fluent apis because there's no better way (that I know of, at least)

beezlewax•31m ago
Can't you change settings in ts to make it more 'strict' than this ?