frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Roadmap for Improving the Type Checker

https://forums.swift.org/t/roadmap-for-improving-the-type-checker/82952
45•glhaynes•7h ago

Comments

SurceBeats•5h ago
About time! Nothing kills productivity like waiting 30s for the compiler to tell you it can't infer a type on line 27437 (who needs to refactor?). The diagnostic improvements alone will be worth it really but...
bestouff•1h ago
Going from 10s down to 6s is not nearly near sufficient to me. This should be instant.
an0malous•4h ago
Wow that `let url` example taking 10 seconds and only down to 6 seconds now is shockingly bad. As someone who recently started getting into iOS/macOS development and has noticed these wildly slow type checking times on my M2 Air, this is enough to make me reconsider if I want to invest in this platform...
foobazgt•2h ago
No joke, that's just wild. I'd expect an expression like that to type-check literally a million times faster - at the least. Even after reading the article, it's not clear why that particular expression is so egregiously poor.
alain_gilbert•1h ago
> Even after reading the article, it's not clear why that particular expression is so egregiously poor.

I'm glad I'm not the only one wondering why this is not instant to type check.

saagarjha•1h ago
Plus is heavily overloaded
recursivecaveat•1m ago
From the post they link to:

> The Swift standard library has 17 overloads of + and 9 types adopting the ExpressibleByStringLiteral Protocol. This leads to an exponential combination of types and operators for the constraint solver to try.

I think the ExpressibleBy thing means that a string literal can be interpreted to mean any of those 9 types. Personally I agree with you; I would actually suggest that the compiler error out if there are anywhere near this many interpretations of an expression. Apparently the corrected expression compiles in 0.19s, which is unacceptable to me. I would much rather pay the cost once of adding a few type annotations or intermediate expressions than pay that fifth of a second over and over and over again for every recompile of that file. Since the types a pretty global constraint system, the expression is a landmine as well: you could fiddle with some distant overload which causes it to attempt the permutations in a different order and suddenly start timing out again.

boxed•33m ago
That Chris Lattner is taking a very different approach to the type checker in Mojo is afaik due to this kind of thing.
foobazgt•2h ago
Slava mentions both bidirectional inferencing and overloading as two of the big culprits.

I've been doing some language work recently, and I'm quite sympathetic to bidirectional inferencing. I think, though, that modern PLs need better solutions for adhoc overloading. It's notorious for its complexity, blowing up algorithmically, and confusing users with surprising results (why oh why did the compiler select this function over the one I intended). That said, I haven't discovered a good alternative (for my purposes) yet.

indemnity•1h ago
As someone who started doing SwiftUI recently, it absolutely boggles my mind that (1) this is even a thing and (2) Apple seem ok to treat it as an unsolvable problem. When you finally solve it is some stupid wrong type passed in somewhere. I agree with the other poster. This is so pathetic it makes me question the competence of the engineers working on Swift.

Smells like “we made a poor architectural / design choice and ain’t walking it back”.

saagarjha•1h ago
That is exactly what happened and the competence of the engineers working on the language is not really relevant.
fingerlocks•5m ago
[delayed]
fainpul•21m ago
I love the clean syntax of Swift, which allows you to omit a lot of syntactic noise. It's so much nicer to write and read than for example Rust with it's ugly wordiness. But the type checker performance really is inacceptable.
tailrecursion•10m ago
I too appreciate detail-free programs, and I wonder at the value of including all the typedecls and pointer markings, and lifetime markings, and mutability markings interleaved with the logic. Some people I guess believe that the details are "part of the program" and they aid understanding. Do you buy that?

I find that sometimes typedecls aid understanding, but they get in the way if they're the least bit complicated. I'm better off reading the program. I never had problems understanding Lisp programs for some reason.

AMD Could Enter ARM Market with Sound Wave APU Built on TSMC 3nm Process

https://www.guru3d.com/story/amd-enters-arm-market-with-sound-wave-apu-built-on-tsmc-3nm-process/
101•walterbell•5h ago•45 comments

Affinity Studio now free

https://www.affinity.studio/get-affinity
970•dagmx•16h ago•641 comments

Pornhub says UK visitors down 77% since age checks came in

https://www.bbc.com/news/articles/cgkz3m3re1zo
23•vinni2•2h ago•22 comments

Rouille – Rust Programming, in French

https://github.com/bnjbvr/rouille
90•mihau•1w ago•33 comments

Kimi Linear: An Expressive, Efficient Attention Architecture

https://github.com/MoonshotAI/Kimi-Linear
125•blackcat201•8h ago•3 comments

How the cochlea computes (2024)

https://www.dissonances.blog/p/the-ear-does-not-do-a-fourier-transform
421•izhak•15h ago•132 comments

Phone numbers for use in TV shows, films and creative works

https://www.acma.gov.au/phone-numbers-use-tv-shows-films-and-creative-works
164•nomilk•10h ago•67 comments

John Carmack on mutable variables

https://twitter.com/id_aa_carmack/status/1983593511703474196
83•azhenley•5h ago•99 comments

Free software scares normal people

https://danieldelaney.net/normal/
638•cryptophreak•17h ago•390 comments

Modifying a radiation meter for (radioactive) rock collecting

https://maurycyz.com/projects/ludlum3/
28•8organicbits•6d ago•0 comments

987654321 / 123456789

https://www.johndcook.com/blog/2025/10/26/987654321/
555•ColinWright•4d ago•92 comments

Show HN: Quibbler – A critic for your coding agent that learns what you want

https://github.com/fulcrumresearch/quibbler
46•etherio•7h ago•11 comments

Springs and bounces in native CSS

https://www.joshwcomeau.com/animation/linear-timing-function/
186•feross•2d ago•27 comments

NPM flooded with malicious packages downloaded more than 86k times

https://arstechnica.com/security/2025/10/npm-flooded-with-malicious-packages-downloaded-more-than...
244•jnord•1d ago•177 comments

A Classic Graphic Reveals Nature's Most Efficient Traveler

https://www.scientificamerican.com/article/a-human-on-a-bicycle-is-among-the-most-efficient-forms...
5•ako•1w ago•1 comments

Jack Kerouac, Malcolm Cowley, and the difficult birth of On the Road

https://theamericanscholar.org/scrolling-through/
46•samclemens•2d ago•23 comments

Exceptional Measurement of Chirality

https://www.rsc.org/news/2019/july/exceptional-measurement-of-chirality
16•bryanrasmussen•5d ago•2 comments

Florian Schneider Collection: Instruments and equipment up for auction

https://www.juliensauctions.com/en/articles/the-florian-schneider-collection-rare-instruments-and...
22•cainxinth•3d ago•3 comments

Minecraft HDL, an HDL for Redstone

https://github.com/itsfrank/MinecraftHDL
151•sleepingreset•13h ago•17 comments

Zig's New Async I/O

https://andrewkelley.me/post/zig-new-async-io-text-version.html
295•todsacerdoti•1d ago•111 comments

Show HN: I made a heatmap diff viewer for code reviews

https://0github.com
213•lawrencechen•18h ago•62 comments

Denmark reportedly withdraws Chat Control proposal following controversy

https://therecord.media/demark-reportedly-withdraws-chat-control-proposal
324•layer8•10h ago•100 comments

Roadmap for Improving the Type Checker

https://forums.swift.org/t/roadmap-for-improving-the-type-checker/82952
45•glhaynes•7h ago•13 comments

Lenses in Julia

https://juliaobjects.github.io/Accessors.jl/stable/lenses/
97•samuel2•4d ago•31 comments

A Closer Look at Piezoelectric Crystal

https://www.samaterials.com/content/a-closer-look-at-stressed-piezo-crystals.html
5•pillars•1w ago•3 comments

Show HN: Front End Fuzzy and Substring and Prefix Search

https://github.com/m31coding/fuzzy-search
29•kmschaal•2d ago•2 comments

Launch HN: Propolis (YC X25) – Browser agents that QA your web app autonomously

https://app.propolis.tech/#/launch
95•mpapazian•15h ago•27 comments

The Psychology of Portnoy: On the Making of Philip Roth's Groundbreaking Novel

https://lithub.com/the-psychology-of-portnoy-on-the-making-of-philip-roths-groundbreaking-novel/
33•lermontov•1w ago•0 comments

ICE and the Smartphone Panopticon

https://www.newyorker.com/culture/infinite-scroll/ice-and-the-smartphone-panopticon
167•fortran77•7h ago•74 comments

Show HN: Status of my favorite bike share stations

https://blog.alexboden.ca/toronto-bike-share-status/
35•alexboden•5d ago•8 comments