frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

I Love OCaml

https://mccd.space/posts/ocaml-the-worlds-best/
131•art-w•3h ago•62 comments

Leaving Meta and PyTorch

https://soumith.ch/blog/2025-11-06-leaving-meta-and-pytorch.md.html
572•saikatsg•11h ago•133 comments

My Experience of building Bytebeat player in Zig

https://blog.karanjanthe.me/posts/zig-beat/
32•KMJ-007•3d ago•1 comments

A Fond Farewell

https://www.farmersalmanac.com/fond-farewell-from-farmers-almanac
467•erhuve•14h ago•162 comments

PyTorch Helion

https://pytorch.org/blog/helion/
92•jarbus•5d ago•20 comments

Denmark's government aims to ban access to social media for children under 15

https://apnews.com/article/denmark-social-media-ban-children-7862d2a8cc590b4969c8931a01adc7f4
38•c420•1h ago•12 comments

OpenMW 0.50.0 Released – open-source Morrowind reimplementation

https://openmw.org/2025/openmw-0-50-0-released/
166•agluszak•4h ago•57 comments

Meta projected 10% of 2024 revenue came from scams

https://sherwood.news/tech/meta-projected-10-of-2024-revenue-came-from-scams-and-banned-goods-reu...
420•donohoe•5h ago•322 comments

We chose OCaml to write Stategraph

https://stategraph.dev/blog/why-we-chose-ocaml
104•lawnchair•4h ago•88 comments

Comparison Traits – Understanding Equality and Ordering in Rust

https://itsfoxstudio.substack.com/p/comparison-traits-understanding-equality
28•rpunkfu•5d ago•5 comments

You should write an agent

https://fly.io/blog/everyone-write-an-agent/
912•tabletcorry•21h ago•361 comments

Toxic Salton Sea dust triggers changes in lung microbiome after just one week

https://phys.org/news/2025-10-toxic-salton-sea-triggers-lung.html
16•PaulHoule•55m ago•1 comments

1973 Implementation of Wordle was Published by DEC (2022)

https://troypress.com/1973-implementation-of-wordle-was-published-by-dec/
48•msephton•6d ago•22 comments

From Memorization to Reasoning in the Spectrum of Loss Curvature

https://arxiv.org/abs/2510.24256
34•andy12_•5h ago•13 comments

Two billion email addresses were exposed

https://www.troyhunt.com/2-billion-email-addresses-were-exposed-and-we-indexed-them-all-in-have-i...
565•esnard•21h ago•393 comments

Revisiting Interface Segregation in Go

https://rednafi.com/go/interface-segregation/
21•ingve•5d ago•17 comments

A.I. and Social Media Contribute to 'Brain Rot'

https://www.nytimes.com/2025/11/06/technology/personaltech/ai-social-media-brain-rot.html
76•pretext•2h ago•70 comments

Sweep (YC S23) is hiring to build autocomplete for JetBrains

https://www.ycombinator.com/companies/sweep/jobs/8dUn406-founding-engineer-intern
1•williamzeng0•5h ago

Text case changes the size of QR codes

https://www.johndcook.com/blog/2025/10/31/smaller-qr-codes/
122•ibobev•5d ago•36 comments

3I/ATLAS shows perihelion burst and radial-only non-gravitational acceleration

https://old.reddit.com/r/dataisbeautiful/comments/1oqfau8/3iatlas_shows_perihelion_burst_and_radi...
19•hnthrowaway0315•58m ago•6 comments

Show HN: I scraped 3B Goodreads reviews to train a better recommendation model

https://book.sv
521•costco•1d ago•210 comments

How to Keep Winning

https://amasad.me/keep-winning
5•daviducolo•4d ago•2 comments

Game design is simple

https://www.raphkoster.com/2025/11/03/game-design-is-simple-actually/
437•vrnvu•19h ago•138 comments

The Silent Scientist: When Software Research Fails to Reach Its Audience

https://cacm.acm.org/opinion/the-silent-scientist-when-software-research-fails-to-reach-its-audie...
62•mschnell•6d ago•36 comments

I'm Making a Small RPG and I Need Feeback Regarding Performance

https://jslegenddev.substack.com/p/im-making-a-small-rpg-and-i-need
41•ibobev•3h ago•35 comments

Is Software the UFOlogy of Engineering Disciplines?

https://codemanship.wordpress.com/2025/11/07/is-software-the-ufology-of-engineering-disciplines/
75•flail•4h ago•134 comments

Nasdaq 100 set for worst week since April meltdown

https://fortune.com/2025/11/07/nasdaq-100-worst-week-since-april-bear-market-correction/
15•pera•47m ago•3 comments

Analysis indicates that the universe’s expansion is not accelerating

https://ras.ac.uk/news-and-press/research-highlights/universes-expansion-now-slowing-not-speeding
225•chrka•21h ago•181 comments

From web developer to database developer in 10 years

https://notes.eatonphil.com/2025-02-15-from-web-developer-to-database-developer-in-10-years.html
145•pmbanugo•3d ago•55 comments

Kimi K2 Thinking, a SOTA open-source trillion-parameter reasoning model

https://moonshotai.github.io/Kimi-K2/thinking.html
846•nekofneko•1d ago•381 comments
Open in hackernews

Revisiting Interface Segregation in Go

https://rednafi.com/go/interface-segregation/
21•ingve•5d ago

Comments

et1337•2h ago
At $WORK we have taken interface segregation to the extreme. For example, say we have a data access object that gets consumed by many different packages. Rather than defining a single interface and mock on the producer side that can be reused by all these packages, each package defines its own minimal interface containing only the methods it needs, and a corresponding mock. This makes it extremely difficult to trace the execution flow, and turns a simple function signature change into an hour-long ordeal of regenerating mocks.
leetrout•2h ago
> a single interface and mock on the producer side

I still believe in Go it is better to _start_ with interfaces on the consumer and focus on "what you need" with interfaces instead of "what you provide" since there's no "implements" concept.

I get the mock argument all the time for having producer interfaces and I don't deny at a certain scale it makes sense but I don't understand why so many people reach for it out of the gate.

I'm genuinely curious if you have felt the pain from interfaces on the producer that would go away if there were just (multiple?) concrete types in use or if you happen to have a notion of OO in Go that is hard to let go of?

wizhi•1h ago
Maybe your actual issue is needing to mock stuff for tests to begin with. Break them down further so they can actually be tested in isolation instead.
the_gipsy•1h ago
Yes, this is exactly the problem with go's recipe.

Either you copypaste the same interface over and over and over, with the maintenance nightmare that is, or you always have these struct-and-interface pairs, where it's unclear why there is an interface to begin with. If the answer is testing, maybe that's the wrong question ti begin with.

So, I would rather have duck typing (the structural kind, not just interfaces) for easy testing. I wonder if it would technically be possible to only compile with duck typing in test, in a hypothetical language.

Xeoncross•53m ago
What is the alternative though? In strongly typed languages like Go, Rust, etc.. you must define the contract. So you either focus on what you need, or you just make a kitchen-sink interface.

I don't even want to think about the global or runtime rewriting that is possible (common) in Java and JavaScript as a reasonable solution to this DI problem.

jerf•38m ago
I'm still fiddling with this so I haven't seen it at scale yet, but in some code I'm writing now, I have a centralized repository for services that register themselves. There is a struct that will provide the union of all possible subservices that they may require (logging, caching, db, etc.). The service registers a function with the central repository that can take that object, but can also take an interface that it defines with just a subset of the values.

This uses reflect and is nominally checked at run time, but over time more and more I am distinguishing between a runtime check that runs arbitrarily often over the execution of a program, and one that runs in an init phase. I have a command-line option on the main executable that runs the initialization without actually starting any services up, so even though it's a run-time panic if a service misregisters itself, it's caught at commit time in my pre-commit hook. (I am also moving towards worrying less about what is necessarily caught at "compile time" and what is caught at commit time, which opens up some possibilities in any language.)

The central service module also defines some convenient one-method interfaces that the services can use, so one service may look like:

    type myDependencies interface {
        services.UsesDB
        services.UsesLogging
    }

    func init() {
        services.Register(func(in myDependencies) error {
             // init here
        }
    }
and another may have

    type myDependencies interface {
        services.UsesLogging
        services.UsesCaching
        services.UsesWebCrawler
    }

    // func init() { etc. }
and in this way, each services declaring its own dependencies means each service's test cases only need to worry about what it actually uses, and the interfaces don't pollute anything else. This fully decouples "the set of services I'm providing from my modules" from "the services each module requires", and while I don't get compile-time checking that a module's service requirements are satisfied, I can easily get commit-time checking.

I also have some default fakes that things can use, but they're not necessary. They're just one convenient implementation for testing if you need them.

sirsinsalot•1h ago
Follow the trail of the blog post and you end up with Python and duck typing, and all the foot guns there too.
zbentley•32m ago
How so? Genuine question. Duck typing is “try it and see if it supports an action”, where interface declaration is the opposite: declare what methods must be supported by what you interact with.

In Python, that would be a Protocol (https://typing.python.org/en/latest/spec/protocol.html), which is a newer and leas commonly used feature than full, un-annotated duck typing.

Sure, type checking in Python (Protocols or not) is done very differently and less strongly than in Go, but the semantic pattern of interface segregation seems to be equivalently possible in both languages—and very different from duck typing.

cube2222•9m ago
Duck typing is often equated with structural typing. You’re right that officially (at least according to Wikipedia) duck typing is dynamic, while structural is the same idea, but static.

Either way, the thing folks are contrasting with here is nominal typing of interfaces, where a type explicitly declares which interfaces it implements. In Go it’s “if it quacks like a duck, it’s a duck”, just statically checked.

mayoff•1h ago
See also https://news.ycombinator.com/item?id=36908369 (“The bigger the interface, the weaker the abstraction")
Joker_vD•1h ago
> However, there’s still one issue: Backup only calls Save, yet the Storage interface includes both Save and Load. If Storage later gains more methods, every fake must grow too, even if those methods aren’t used.

First, why would you ever add methods to a public interface? Second, the next version of the Backup's implementation might very well want to call Load as well (e.g. for deduplication purposes) and then you suddenly need to add more methods to your fakes anyhow.

In the end, it really depends on who owns FileStorage and Backup: if it's the same team/person, the ISP is immaterial. If they are different, then yes, the owner of Backup() would be better served by declaring a Storage interface of their own and delegate the job of writing adapters that make e.g. FileStorage to conform to it to the users of Backup() method.

brodouevencode•1h ago
>First, why would you ever add methods to a public interface?

In the go world, it's a little more acceptable to do that versus something like Java because you're really not going to break anything

jimbobimbo•1h ago
"But accepting the full S3Client here ties UploadReport to an interface that’s too broad. A fake must implement all the methods just to satisfy it."

In NET, one would simply mock one or two methods required by the implementation under the test. If I'm using Moq, then one would set it up in strict mode, to avoid surprises if unit under test starts calling something it didn't before.

spenczar5•53m ago
"But accepting the full S3Client here ties UploadReport to an interface that’s too broad. A fake must implement all the methods just to satisfy it."

This isn't really true. Your mock inplementation can embed the interface, but only implement the one required method. Calling the unimplemented methods will panic, but that's not unreasonable for mocks.

That is:

    type mockS3 struct {
        S3Client
    }

    func (m mockS3) PutObject(...) {
        ...
    }
You don't have to implement all the other methods.

Defining a zillion interfaces, all the permutations of methods in use, makes it hard to cone up with good names, and thus hard to read.

the_gipsy•25m ago
Is this pattern commonly used? Any drawbacks?

Sounds much better than the interface boilerplate if it's just for the sake of testing.

piazz•32m ago
You’re decreasing coupling at the cost of introducing more entities, and a different sort of complexity, into your system.

Sometimes it’s absolutely worth it. Sometimes not.

hyperpape•32m ago
> Object-oriented (OO) patterns get a lot of flak in the Go community, and often for good reason.

This isn't really an OO pattern, as the rest of the post demonstrates. It's just a pattern that applies across most any language where you can make a distinction between an interface/typeclass or whatever, and a concrete type.