frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Compiling LLMs into a MegaKernel: A path to low-latency inference

https://zhihaojia.medium.com/compiling-llms-into-a-megakernel-a-path-to-low-latency-inference-cf7840913c17
119•matt_d•4h ago•27 comments

Literate programming tool for any language

https://github.com/zyedidia/Literate
15•LorenDB•1h ago•4 comments

Curved-Crease Sculpture

https://erikdemaine.org/curved/
150•wonger_•9h ago•22 comments

Homegrown Closures for Uxn

https://krzysckh.org/b/Homegrown-closures-for-uxn.html
58•todsacerdoti•6h ago•4 comments

Andrej Karpathy: Software in the era of AI [video]

https://www.youtube.com/watch?v=LCEmiRjPEtQ
1070•sandslash•23h ago•594 comments

How OpenElections uses LLMs

https://thescoop.org/archives/2025/06/09/how-openelections-uses-llms/index.html
76•m-hodges•7h ago•24 comments

Show HN: EnrichMCP – A Python ORM for Agents

https://github.com/featureform/enrichmcp
73•bloppe•6h ago•23 comments

Show HN: A DOS-like hobby OS written in Rust and x86 assembly

https://github.com/krustowski/rou2exOS
137•krustowski•9h ago•26 comments

Show HN: RM2000 Tape Recorder, an audio sampler for macOS

https://rm2000.app
17•marcelox86•2d ago•5 comments

Extracting memorized pieces of books from open-weight language models

https://arxiv.org/abs/2505.12546
39•fzliu•3d ago•23 comments

Guess I'm a Rationalist Now

https://scottaaronson.blog/?p=8908
202•nsoonhui•13h ago•587 comments

Star Quakes and Monster Shock Waves

https://www.caltech.edu/about/news/star-quakes-and-monster-shock-waves
31•gmays•2d ago•4 comments

Show HN: Claude Code Usage Monitor – real-time tracker to dodge usage cut-offs

https://github.com/Maciek-roboblog/Claude-Code-Usage-Monitor
184•Maciej-roboblog•13h ago•105 comments

Testing a Robust Netcode with Godot

https://studios.ptilouk.net/little-brats/blog/2024-10-23_netcode.html
25•smig0•2d ago•6 comments

Show HN: Unregistry – “docker push” directly to servers without a registry

https://github.com/psviderski/unregistry
616•psviderski•1d ago•135 comments

What would a Kubernetes 2.0 look like

https://matduggan.com/what-would-a-kubernetes-2-0-look-like/
126•Bogdanp•11h ago•201 comments

DNA floating in the air tracks wildlife, viruses, even drugs

https://www.sciencedaily.com/releases/2025/06/250603114822.htm
60•karlperera•3d ago•54 comments

Flowspace (YC S17) Is Hiring Software Engineers

https://flowspace.applytojob.com/apply/6oDtY2q6E9/Software-Engineer-II
1•mrjasonh•6h ago

Posit floating point numbers: thin triangles and other tricks (2019)

http://marc-b-reynolds.github.io/math/2019/02/06/Posit1.html
45•fanf2•8h ago•30 comments

Visual History of the Latin Alphabet

https://uclab.fh-potsdam.de/arete/en
103•speckx•2d ago•65 comments

Munich from a Hamburger's perspective

https://mertbulan.com/2025/06/14/munich-from-a-hamburgers-perspective/
102•toomuchtodo•4d ago•83 comments

Why do we need DNSSEC?

https://howdnssec.works/why-do-we-need-dnssec/
74•gpi•6h ago•112 comments

String Interpolation in C++ Using Glaze Stencil/Mustache

https://stephenberry.github.io/glaze/stencil-mustache/
7•npalli•3d ago•0 comments

From LLM to AI Agent: What's the Real Journey Behind AI System Development?

https://www.codelink.io/blog/post/ai-system-development-llm-rag-ai-workflow-agent
114•codelink•14h ago•37 comments

Getting Started Strudel

https://strudel.cc/workshop/getting-started/
130•rcarmo•3d ago•48 comments

Elliptic Curves as Art

https://elliptic-curves.art/
198•nill0•19h ago•25 comments

My iPhone 8 Refuses to Die: Now It's a Solar-Powered Vision OCR Server

https://terminalbytes.com/iphone-8-solar-powered-vision-ocr-server/
423•hemant6488•1d ago•178 comments

Juneteenth in Photos

https://texashighways.com/travel-news/the-history-of-juneteenth-in-photos/
178•ohjeez•5h ago•128 comments

Geochronology supports LGM age for human tracks at White Sands, New Mexico

https://www.science.org/doi/10.1126/sciadv.adv4951
33•gametorch•8h ago•15 comments

June 2025 C2PA News

https://www.tbray.org/ongoing/When/202x/2025/06/17/More-C2PA
18•timbray•7h ago•0 comments
Open in hackernews

Public/protected/private is an unnecessary feature

https://catern.com/private.html
44•PaulHoule•2d ago

Comments

Dwedit•5h ago
Locking away backing fields from a property is not an unnecessary feature.
scotty79•5h ago
If somebody needs access to the backing field it's usually for a good reason. And if you restrict it, they'll just fork your code and overwrite whatever they need.

It should at most be a soft annotation to prevent it from getting auto-completed, not a restriction.

tenebrisalietum•5h ago
and then they also own future responsibility for that change.
scotty79•1h ago
It's always app dev responsibility. They can't excuse a bug or lack of functionality with "that's what's in the lib".

I can't imagine somebody monkey patching exposing internals of a lib and blaming lib author for poor effects.

magicalhippo•4h ago
I like Boost's approach[1] of using a separate namespace for these implementation-specific things, rather than visibility modifiers.

Then the internals are accessible if you need it for a temporary workaround or such, but it's also very obvious when you are accessing stuff you really shouldn't. And implementers are still free to rearrange the internals as they see fit.

[1]: Not saying Boost invented it, just where I saw it first.

rerdavies•2h ago
Boost uses both. Implementation-private namespaces are a slightly different feature. They provide a way to share internal methods between classes within boost that must not be used by client code. That's a scoping feature that c++ doesn't have, but c# (for example) does.
derefr•4h ago
You're assuming a very simplistic model of API coupling, where there are only "applications" and "libraries that the application compiles into itself." But:

• There are also runtimes, installed separately from the application. You might be able to fork the JDK, but people want to run your Java application on their JRE, not yours.

• There are proprietary applications that nevertheless expose APIs to code against. A Photoshop plugin author can't fork Photoshop to expose fields of the plugin host.

• There is the OS itself. You can fork the Linux kernel (and gcc/clang) to expose some internal data your application needs as a system call — but unless you get all that code upstreamed, your application is now entirely non-portable, running only on your own servers at best.

• Most commonly of all, there are system libraries. You can certainly fork (and co-distribute / bake in) a library like libicu or libxml — but no major OS will be willing to ship your app or lib as a system package of its own, if it does that. They'll want your app/lib to depend on the existing packaged version of those libs.

None of this matters, of course, if you develop proprietary-service backend software for a living. You can maintain a menagerie of weird lib forks, shove all the build artifacts into a docker image, and it'll work for you. But much (I'd say the majority) of the world's programming is not in proprietary-service backends, and so needs to actually depend on code it doesn't control.

scotty79•1h ago
All very good arguments about not having private and protected.
ctxc•5h ago
Do you really want to create an interface for every possible place where you'd use `private` though?
WorldMaker•5h ago
Right, even if it is just syntactic sugar for a "pure" dual of `interface` as the article posits, syntactic sugar still has advantages/merit in many scenarios.
ctxc•5h ago
Exactly. Ime most classes are not designed to be inherited but want to expose a clean public API.

While true that all classes can be inherited, treating _all_ classes with the assumption that they will be would just lead to a labyrinth of code.

coderjames•3h ago
> most classes are not designed to be inherited but want to expose a clean public API.

> While true that all classes can be inherited

That's what the 'final' keyword in C++ is for: https://en.cppreference.com/w/cpp/language/final.html

"Specifies that a virtual function cannot be overridden in a derived class, or that a class cannot be derived from."

WorldMaker•3h ago
C# and Java both have `sealed` for that, too.
jonathanlydall•5h ago
I primarily work in C# and access modifiers allow me to constrain which types or their members on it are accessible to other types or assemblies.

This is particularly useful when authoring libraries as I know that for anything not public, I can refactor to my hearts content (provided the externally observed behaviour is otherwise unchanged).

It’s a bit of a pity that it was only relatively recently that Visual Studio changed the template for new classes to use internal instead of public.

There are lots of public classes in codebases I work on which are probably only public due to the old default and not used externally so could be refactored, but it’s hard to be sure.

Whereas with internal classes I can be sure (unless someone has used reflection, but then that’s their problem).

kevingadd•4h ago
I also wish 'sealed' was the default for classes in templates. Usually you're not thinking about what will happen if someone shows up 5 years later to derive from a random class you created, and it has performance benefits to seal a type. You can always remove the sealed qualifier later on purpose.
nick_•2h ago
Same here. I recently came across a real use for the newer `private protected` (`FamANDAssembly`) modifier combo. Only derived types that are internal to my assembly can access this member. Beautiful. It re-confirmed my long standing belief that OOP is an incredibly powerful and valid pattern.
xyst•5h ago
They are also optional in some languages :)

A long time ago in Java corp world, teams would create their own integration libraries with suspicious/horrible contracts. Ended up just using Java’s reflection api to update access modifiers to get their shitty library to work until they fix it (months later…).

deepsun•5h ago
Or introduce a corporate rule to make everything public, if restricting didn't work anyways.
jimbob45•4h ago
I wish private was a suggestion and not strictly enforced in the same way that types aren't strictly enforced in C. Microsoft loves to make public variables private years during upgrades and it can be impossible to rewrite your application to avoid using that now-inaccessible variable. Looking at you, ASP.NET to .NET Core upgrade...
kevingadd•4h ago
Have you heard of Unsafe Accessors? https://learn.microsoft.com/en-us/dotnet/api/system.runtime.... They help solve this problem.
ziml77•4h ago
Oh that's awesome that they added that. Ending up needing to access private members already sucks, but reflection makes it even worse due to the performance hit you take.
baobun•4h ago
In case one is not familiar with the author, they are commonly arguing that inheritance is an antipattern that should not be used in OOP languages. The OP is in that context: private and protected are not useful if you don't have inheritence.
IshKebab•3h ago
I don't think that's really true either.
alganet•4h ago
> Use composition instead. Inheritance was a hack in the first place.

Composition is great. It's the preferred way.

However, if you take it to the extreme (composition only, never inheritance) you sometimes end up with really weird meaningless objects that have only a single method and a one-to-one relationship with another object.

Private methods are ideal for making those abstractions easier to understand. A private method, therefore, is equivalent to an object that has a one-to-one relationship with another object (it's only composed there) and a single method.

A protected method is similar, but allows whoever subclasses it to replace that single one-to-one "mini object" inside with another one-to-one "mini object".

When used within this mindset, it greatly simplifies code. It lets you simplify a branch that has only a single leaf into something easier to read.

Together with classical refactorings (extract method, move method, extract class), they're a precious tool.

Of course, typing is a consideration as well, but I'm talking exclusively about their role in granularity control.

It is unecessary, but convenient. It can be misused. Composition can also be misused.

tadfisher•3h ago
> However, if you take it to the extreme (composition only, never inheritance) you sometimes end up with really weird meaningless objects that have only a single method and a one-to-one relationship with another object.

We can take a cue from the functional languages and make this less code-smelly by using anonymous function types (e.g. lambdas). This removes the one issue with single-purpose/single-method objects, which is naming them.

alganet•2h ago
It's an extra tool, for sure.

There is no silver bullet. No one likes huge inheritance chains, no one likes only tiny lego pieces, no one likes callback hell.

cosmicgadget•4h ago
"Because you can limit visibility with interfaces, limiting visibility without using an interface is unnecessary."

No thanks. And I'll continue using inheritance and composition correctly too.

ysofunny•4h ago
now say it in a sociology or economics conference
cherryteastain•3h ago
I agree that it's unnecessary, and Python's success despite not having private members/fields is testament to that. But public/private fields/methods, like pretty much everything in OOP, is a 'social' rather than engineering innovation. Just as a class tells you certain operations and data are inter-related, private methods or fields signal to a class's users that you probably will break things if you interfere with certain parts.

Otherwise, at least in C++, you can often bypass the private specifier without much difficulty. Perhaps the laziest and easiest way to do so is

    #define private public
    #include "foo.hpp"
    #undef private
n2d4•3h ago
Python absolutely does have private members. If a member starts with two underscores, its class name (and an underscore) is prefixed to the member name, essentially resulting in the same behavior as a private modifier. (Although there are ways to circumvent this in Python, there are also ways to access private fields in most other languages.)

But even if that were true, that wouldn't mean that accessibility modifiers are unnecessary in other languages. Python is a certain language with certain idioms, and other languages are more or less OOP and hence some constructs that might not make sense in Python definitely make sense elsewhere.

NeutralForest•2h ago
I see what you mean what I wouldn't really qualify name mangling as private members, you're discouraged to access them but you can access them all the same.
jjice•2h ago
I'd consider it the same, personally. It's a social contract that you can absolutely break if you want, just with a bit of work.

Less work in Python than it is Java, but there are ways to get to them in Java, or hell, just modify the source and change it directly. By doing that, you're doing something the developer didn't intend and you shouldn't be surprised if it doesn't work at some point in the future. Same as I'd expect in the Python case.

NeutralForest•2h ago
Sure, I think the bar to modify is higher in Java for example but I can't really find fault in what you're saying because I'd never unknowingly modify a member with double underscores in Python.
jjmarr•2h ago
You should safely shoot yourself in the foot with `friend`, which is a core language feature for accessing private members/functions/etc.

https://www.cppreference.com/w/cpp/language/friend.html

Redefining public as private can violate the ODR rule and triggers undefined behaviour because private members are ordered in memory in an undefined way, while public members are ordered in a standard way.

leni536•2h ago
Don't do that in C++. Maybe unless if you are debugging. This can blow up in your face in unexpected ways.
PaulDavisThe1st•3h ago
I'd like them extended slightly, in fact. I'd like a friend declaration after an access specifier to apply only until the next access specifier. Eg.

     class Foo {
       public:
          void method_A();
 
       protected:
          friend class Bar;
          void method_B();

       protected:
          friend class Baz;
          void method_C();

       private:
          void method_D();
     };
anyone can call method_A(), only Bar can call method_B(), only Baz can call method_C() and nobody can call method_D().

You can do this by inheriting from 2 different pure abstract classes, but that feels much kludgier to me.

leni536•2h ago
Look up the passkey idiom.
PaulDavisThe1st•1h ago
Nice, but cumbersome with > 1 friend.
aurumque•3h ago
Access modifiers don't give you unlimited protection, they help you reason about the code and how it is used. If I change a public method and break something downstream, that's on me and my team. If I change a private method and break someone else's code which was bypassing using reflection or other mechanisms, that's on them.

Languages like Python don't have keywords but enforce using conventions like underscore and 'dunder', the latter of which is actually enforced using obfuscation. It is extremely helpful to signal to users that they should not be using certain methods or fields. When there are no access modifiers available, we still see teams writing methods like "xyx_UNSAFE" or "abc_DO_NOT_USE". It's ridiculous to me to encode this kind of information like this instead of having first class support in the language.

Access modifiers also tell the compiler or JIT what is safe or unsafe to manipulate. It has implications beyond users, and can be a determining factor when inlining or making other optimizations.

This article is so opinionated (edgy?) that it ends with "Inheritance was a hack in the first place." I think, like all things, we need to consider the broader landscape for object oriented programming instead of just saying these things are irrelevant and absurd and useless.

lowbloodsugar•2h ago
Also the static members of a “class” are another interface: a distinct interface that also enforces a singleton.
cyberax•2h ago
IMO, the Go model of package-private and public entities is the best compromise. Simply because it reduces the global namespace pollution.
rerdavies•2h ago
Package-private is a nice feature.
julik•2h ago
For most modern languages, something like an @internal annotation would work better. With compiled languages that need to conform to an ABI or export RPC definitions, there is merit to specifying what exactly must be exported (or must never be inlined), but even that could be tackled by an @internal or @nodoc or @private annotation - not a language construct.

See also https://steve-yegge.blogspot.com/2010/07/wikileaks-to-leak-5...

rerdavies•1h ago
That would be fine if the annotations were standardized. But if the annotations are standardized, then they might as well be a direct language feature.
wewewedxfgdf•2h ago
All private does is make it hard for developers further down the track to make changes that they want to make.

And if you don't need private then why have public?

rerdavies•1h ago
What private does is make it easier for developers further down the track to fix bugs, and prevent consumers of a class from making horrible mistakes by introducing dependencies on implementation details of a class that are not guaranteed to exist in future versions.
khalic•2h ago
Ah the good old “xxx considered harmful”
rerdavies•2h ago
Pretty much all language features save for a shockingly small set are "unnecessary". The proper question is "are they useful?"

The usefulness of public/protected/private is that it provides a way to narrow the surface area through which derived classes can interact with their superclasses. Which is enormously useful from a maintenance perspective.

The place where inheritance is better than composition is where base classes provide partial implementations that are used by derived classes.