frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Micro-Front Ends in 2026: Architecture Win or Enterprise Tax?

https://iocombats.com/blogs/micro-frontends-in-2026
1•ghazikhan205•1m ago•0 comments

Japanese rice is the most expensive in the world

https://www.cnn.com/2026/02/07/travel/this-is-the-worlds-most-expensive-rice-but-what-does-it-tas...
1•mooreds•1m ago•0 comments

These White-Collar Workers Actually Made the Switch to a Trade

https://www.wsj.com/lifestyle/careers/white-collar-mid-career-trades-caca4b5f
1•impish9208•1m ago•1 comments

The Wonder Drug That's Plaguing Sports

https://www.nytimes.com/2026/02/02/us/ostarine-olympics-doping.html
1•mooreds•2m ago•0 comments

Show HN: Which chef knife steels are good? Data from 540 Reddit tread

https://new.knife.day/blog/reddit-steel-sentiment-analysis
1•p-s-v•2m ago•0 comments

Federated Credential Management (FedCM)

https://ciamweekly.substack.com/p/federated-credential-management-fedcm
1•mooreds•2m ago•0 comments

Token-to-Credit Conversion: Avoiding Floating-Point Errors in AI Billing Systems

https://app.writtte.com/read/kZ8Kj6R
1•lasgawe•2m ago•1 comments

The Story of Heroku (2022)

https://leerob.com/heroku
1•tosh•3m ago•0 comments

Obey the Testing Goat

https://www.obeythetestinggoat.com/
1•mkl95•3m ago•0 comments

Claude Opus 4.6 extends LLM pareto frontier

https://michaelshi.me/pareto/
1•mikeshi42•4m ago•0 comments

Brute Force Colors (2022)

https://arnaud-carre.github.io/2022-12-30-amiga-ham/
1•erickhill•7m ago•0 comments

Google Translate apparently vulnerable to prompt injection

https://www.lesswrong.com/posts/tAh2keDNEEHMXvLvz/prompt-injection-in-google-translate-reveals-ba...
1•julkali•7m ago•0 comments

(Bsky thread) "This turns the maintainer into an unwitting vibe coder"

https://bsky.app/profile/fullmoon.id/post/3meadfaulhk2s
1•todsacerdoti•8m ago•0 comments

Software development is undergoing a Renaissance in front of our eyes

https://twitter.com/gdb/status/2019566641491963946
1•tosh•8m ago•0 comments

Can you beat ensloppification? I made a quiz for Wikipedia's Signs of AI Writing

https://tryward.app/aiquiz
1•bennydog224•9m ago•1 comments

Spec-Driven Design with Kiro: Lessons from Seddle

https://medium.com/@dustin_44710/spec-driven-design-with-kiro-lessons-from-seddle-9320ef18a61f
1•nslog•10m ago•0 comments

Agents need good developer experience too

https://modal.com/blog/agents-devex
1•birdculture•11m ago•0 comments

The Dark Factory

https://twitter.com/i/status/2020161285376082326
1•Ozzie_osman•11m ago•0 comments

Free data transfer out to internet when moving out of AWS (2024)

https://aws.amazon.com/blogs/aws/free-data-transfer-out-to-internet-when-moving-out-of-aws/
1•tosh•12m ago•0 comments

Interop 2025: A Year of Convergence

https://webkit.org/blog/17808/interop-2025-review/
1•alwillis•13m ago•0 comments

Prejudice Against Leprosy

https://text.npr.org/g-s1-108321
1•hi41•14m ago•0 comments

Slint: Cross Platform UI Library

https://slint.dev/
1•Palmik•18m ago•0 comments

AI and Education: Generative AI and the Future of Critical Thinking

https://www.youtube.com/watch?v=k7PvscqGD24
1•nyc111•18m ago•0 comments

Maple Mono: Smooth your coding flow

https://font.subf.dev/en/
1•signa11•19m ago•0 comments

Moltbook isn't real but it can still hurt you

https://12gramsofcarbon.com/p/tech-things-moltbook-isnt-real-but
1•theahura•23m ago•0 comments

Take Back the Em Dash–and Your Voice

https://spin.atomicobject.com/take-back-em-dash/
1•ingve•23m ago•0 comments

Show HN: 289x speedup over MLP using Spectral Graphs

https://zenodo.org/login/?next=%2Fme%2Fuploads%3Fq%3D%26f%3Dshared_with_me%25253Afalse%26l%3Dlist...
1•andrespi•24m ago•0 comments

Teaching Mathematics

https://www.karlin.mff.cuni.cz/~spurny/doc/articles/arnold.htm
2•samuel246•27m ago•0 comments

3D Printed Microfluidic Multiplexing [video]

https://www.youtube.com/watch?v=VZ2ZcOzLnGg
2•downboots•27m ago•0 comments

Abstractions Are in the Eye of the Beholder

https://software.rajivprab.com/2019/08/29/abstractions-are-in-the-eye-of-the-beholder/
2•whack•27m ago•0 comments
Open in hackernews

Callbacks in C++ using template functors (1994)

http://www.tutok.sk/fastgl/callback.html
49•zengid•4mo ago

Comments

zengid•4mo ago
Heard about this watching Casey Muratori's "The Big OOPs" talk [0]. Thought it couldn't be _that_ Hickey, but turns out it was!

[0] https://youtu.be/wo84LFzx5nI?si=SBv1UqgtKJ1BH3Cw&t=5159

drnick1•4mo ago
C++ was so much cleaner in the 90s, when it was still essentially "C with classes," which is how I like to use the language. Modern standards have turned it into an ugly mess.
drob518•4mo ago
Amen. The syntax just kept getting more and more complicated. I gave up in the late 1990s. Ironically for this post, I now prefer to write everything in Clojure. It seems like my own journey has paralleled Rich’s journey. Maybe that’s why I appreciate so many of the design choices in Clojure. It’s not perfect, but it’s really, really good.
lbalazscs•4mo ago
A sentence from the article: "Given the extreme undesirability of any new language features I'd hardly propose bound-pointers now."

It shows that C++ was considered too complex already in the 90s.

codr7•4mo ago
And then they introduced coke at committee meetings, the crazy shit they've been coming up with lately shows absolutely zero understanding of the complexity issue.
jcelerier•4mo ago
and yet client code can be incredibly simpler nowadays thanks to all these features.

I can write this simple struct:

    struct Person {
      std::string name;
      my_complicated_date_type date_of_birth;
    };
and get serialization, network interop, logging, automated UI generation, hashing, type-safe IDs, etc. without having to write an additional line of code. Twenty years ago you had to write 2000 lines of additional boilerplate for each data type to get to the same place.
jstimpfle•4mo ago
You would have added some codegen, should be possible to write a codegen framework from scratch in 2000 lines even.

Arguably the result would have been easier to read and maintain and not as slow to compile.

jeffrallen•4mo ago
Or you might have used table based data structures, like TeX and the lunar lander did.

You do the best you can, today, with what you have, and then you ship it and get on to the next challenge. Same now as it always was.

jcelerier•4mo ago
> Arguably the result would have been easier to read and maintain and not as slow to compile.

having been through I don't know how many codegen frameworks I thoroughly disagree, those are a complete pain to maintain as soon as you want to support mac / windows (esp. MSVC) / linux / wasm and various brands of cross-compiling. Everything that can be done in the target language, should.

jstimpfle•4mo ago
What is the issue with codegen for multiple platforms? Why not just emit regular C or C++ code (and data) -- preferably well abstracted from the underlying OS?

Or is your concern about integration into the build system of any prebuild-events or similar logic that need to be run in addition to compiling and linking? This integration may require separate efforts for each platform. But such support is very useful for a bunch of different things in most non-trivial projects, such that it's better to pay for that effort early, rather than develop workarounds to avoid it in my experience.

jcelerier•4mo ago
> preferably well abstracted from the underlying OS?

you can't do that as soon as you start thinking about embedding non-code resources in your binaries, etc. #embed / std::embed is finally solving this though. You also usually have to think a lot about linking, symbol visibility & various other compiler-specific attributes in such files if you're doing non-trivial work.

> Or is your concern about integration into the build system of any prebuild-events or similar logic that need to be run in addition to compiling and linking? This integration may require separate efforts for each platform.

Exactly, and my experience is that it is always not worth it. For example I ported all my Qt code so that it doesn't use moc (external code generator) and uses instead verdigris (same thing with slightly more complex macros but no need for anything else than a c++ compiler for building my code) and that instantly solved so many problems it's not even funny - something that required maintenance multiple times a year (pretty much every time you want to use some new C++ feature and the code generator does not know yet how to parse a source file that contains this feature - I have issues open on the Qt bug tracker that are now well into their first decade) had its operational cost fall to 0. And moc is by far one of the most well-developed code generators I've had to use, so many others just fail on anything other than the "happiest path".

The only vaguely tolerable experience I had was using CMake as a code generator as cmake works portably-enough on the platforms it supports (though there are oddities to take care of between MSYS2 CMake and MinGW CMake and MSVC CMake) but then there's a lot of people who will absolutely never ever want to touch this (https://github.com/ossia/score/blob/master/cmake/GenerateLic...) or this (https://github.com/ossia/score/blob/master/cmake/ScoreFuncti...) with a ten foot pole. If I could replace all this today with normal C++ code I absolutely would in a heartbeat, it would be an undebatable improvement even if it took three times as many LoC / tokens / cyclomatic complexity / whatever measure you want to use.

jstimpfle•4mo ago
What does codegen have to do with Qt or CMake (I don't use either)? I was only thinking about generating .[ch]{,pp} files with very simple code in them, and compiling them.

I'd recommend checking out e.g. https://github.com/EpicGamesExt/raddebugger . They are doing a lot of codegen. The codebase is very self-sufficient. Currently works only on Windows x64 but coming to Linux soon it sounds like. (And the reason why not yet isn't codegen)

About embedding non-code resources, yes there are platform dependent solutions to file embedding that you'd have to support separately, but you can also ship an executable with separate asset files. With bigger assets that's probably the way to go. You can of course also opt to encode a file as C code (char data) but it's not very efficient.

billfruit•4mo ago
As some not into modern c++, how would you get all functionality? Is there any guide or documentation yout could point to?. It is fascinating if all that could be done with just the struct defenition.
jcelerier•4mo ago
The actual feature comes in C++26 (static reflection) but there are polyfills that allow to do it today (boost.pfr, https://github.com/qlibs/reflect) ; concepts are also a great help: https://cnrs.hal.science/hal-04090584/file/icmc2022template....
ux266478•4mo ago
Now instead you have 25,000 lines of code that you literally cannot debug.
codr7•4mo ago
Simpler to write maybe, reading it and following all the threads to figure out what the code is doing, not so much.

The problem with C++ is that you end up having to take most of its features into account, one way or the other, and it quickly gets complicated; at least that's my experience and the experience of many others.

pton_xd•4mo ago
I also use C++ as "C with classes," however I will concede that many of the modern C++ additions, particularly around templating, are extremely convenient. If you haven't had a chance to use requires, concepts, "using" aliases, etc I'd recommend giving them a try. I don't reach for those tools often, but when I do, they're way nicer than whatever this article is demonstrating from 1994! Oh yeah, also lambdas, those are awesome.
MomsAVoxell•4mo ago
>ugly mess

That may be the case, but there are plenty of examples of elegant implementations.

JUCE, for instance:

    #include <juce_core/juce_core.h>

    class MyComponent {
    public:
        void doAsyncOperation(std::function<void(int)> callback) {
            // Simulate async work
            juce::MessageManager::callAsync([callback]() {
                callback(42); // Call the functor with result
            });
        }
    };

    // Usage
    MyComponent comp;
    comp.doAsyncOperation([](int result) {
        juce::Logger::writeToLog("Callback received with: " + juce::String(result));
    });
.. I think that's kind of clean and readable, but ymmv, I guess?
tialaramex•4mo ago
Well, that definitely doesn't look "clean and readable" to me for whatever that's worth.
MomsAVoxell•4mo ago
Too many []’s and ::’s for your eyes?
tialaramex•4mo ago
The first thing it seems to do is arbitrary textual inclusion, so that's already a big mess with unknowable consequences.

Then we've got a "member function" where magically if we specify a function while midway through specifying a data structure the function is somehow treated as though it were part of that data structure - but of course it is actually just sugar. I know this confuses real learners.

And sure, the lambda syntax is awful but that's sort of par for the course by the time you reach it.

MomsAVoxell•4mo ago
>The first thing it seems to do is arbitrary textual inclusion, so that's already a big mess with unknowable consequences.

I'm not seeing this - can you clarify?

>Then we've got a "member function" where magically if we specify a function while midway through specifying a data structure the function is somehow treated as though it were part of that data structure - but of course it is actually just sugar. I know this confuses real learners.

Humor me, show me where this "member function" is?

I honestly feel like we're not reading the same code .. but maybe that's your point.

tialaramex•4mo ago
> I'm not seeing this - can you clarify?

#include is a C pre-processor feature which just pastes in whatever the contents of the specified file are. Did you not know that's what it does ?

> Humor me, show me where this "member function" is?

That doAsyncOperation is a member function. Unlike member variables, which are part of the actual data structure we're defining, the member functions are the peculiar syntax for methods in C++, the function won't actually live inside the data structure, we're not making any sort of function pointer or reference - it's just written here because presumably Bjarne couldn't think of anywhere better to put it.

I guess it's possible you didn't understand that, it does seem like a fair number of undergrads think this will be how it works when shown C++ which isn't great news.

> I honestly feel like we're not reading the same code .. but maybe that's your point.

I'm reading the code you wrote in https://news.ycombinator.com/item?id=45484503 and frankly the response just makes me think C++ programmers don't understand C++ either.

MomsAVoxell•4mo ago
>#include is a C pre-processor feature which just pastes in whatever the contents of the specified file are. Did you not know that's what it does ?

LOL, I’ve been writing professional C and C++ code for 40 years, so yes indeed I know perfectly well what it does, I just couldn’t fathom your description as being a valid complaint. I mean, seriously?

“Data structure”. No, it’s a class.

Since this class is about encapsulating behavior, managing state, or providing an interface it’s better described as a code module.

Since you cannot make this distinction and seem more inclined to argue from the position of someone who can’t/won’t write C++ code, I’ll just leave you to your misery and state that I disagree with your whining, completely. Please don’t ever write any C++.

tialaramex•4mo ago
> “Data structure”. No, it’s a class.

Although it inherits from C several kinds of user defined type, C++ chooses to neuter all of them so that in practice any real user defined type "is a class". One of the many cringey Herb Sutter (IIRC) stunts at CppCon was singing "all you need is class" to the tune of the Beatles' "All you need is love".

But crucially here what we're talking about is the choice to define the concrete data structure inline with the definition of a class as "member variables" and to also mix in these "member functions" which aren't part of that data structure. That's an unnecessarily confusing way to do this.

Unlike "member function", your "code module" is not in fact part of C++ nomenclature. You're of course welcome to invent your own terminology to explain what's going on but it does obviously undercut the claim that this is "clean and readable" if you had to invent your own terms to even talk about it.

I do agree with you that writing C++ is a bad idea.

MomsAVoxell•4mo ago
“Code module” is a generic phrase used in many programming languages, not just C++.

Your pedantry over what is an extremely useful and highly productive language, for which there is ample evidence of actual utility, belies a feeble attempt to justify what I believe is your fundamental failure to have actually shipped products in any language, whatsoever. Not just C++. I doubt you ship anything at all, given your proclivity for tripping over your lack of understanding.

Which languages have you used to ship real products to your users?

tialaramex•3mo ago
I've been paid to write software in C, Java, Python, C#, Perl, PHP, Bourne shell, and doubtless many more I've forgotten over decades.

If you consider "People who use Free Software" to be users you can doubtless add a dozen more languages, including (which was a surprise to me 25+ years later) Scheme apparently, but most recently only Rust because that's what I'd prefer to write. If you've used Rust's compiler, a tiny portion of that was written by me.

asveikau•4mo ago
I dunno, I skimmed the article's 31 year old code examples and immediately thought they would be shorter and simpler in c++11 or later.

But it's important to see the 1994 (and 1998) view of the world to understand how modern c++ features work. Because they start from that worldview and start adding convenient stuff. If you don't understand how c++ used to work, you may be confused with why c++ lambdas look so weird.

adzm•4mo ago
You can just use the parts you want though; that's part of its appeal.
eschaton•4mo ago
This is a thing C++ advocates say that tells me they’ve never really tried to do it and share that codebase with others or integrate with other codebases.

You generally don’t get to pick what parts other people want to use, which means that in the end you still have to deal with the entirety of the language.

codr7•4mo ago
Exactly, it doesn't work very well in practice.

Even when working alone, the complexity gradually creeps up on you.

Because it's all made to work together, start pulling anywhere and before you know it you're using another feature, and another, and so on.

And many features interact in exotic and hard to predict ways, so hard that entire careers have been spent on trying and failing to master the language.

jeffrallen•4mo ago
I didn't want to use the functional part of C++, then one day my colleague with a twisted sense of humour checked in fun.hpp with his own implementation of FP.

Boom.

Now you are not only using the functional part of C++, but also in a nonstandard way! Merci Gilles. :)

spacechild1•4mo ago
No member function templates, no variadic templates, no std::function, no lambdas, etc. That's certainly not the kind of C++ I would want to write...
mwkaufma•4mo ago
Red flags for me when I see nonstandard functors in a c++ codebase (esp if the "glue" is in a setup function independent of the objects):

(i) Have they thought about the relative lifetimes of the sender and receiver?

(ii) Is the callback a "critical section" where certain side-effects have undefined behavior?

(iii) Does the functors store debugging info that .natvis can use?

(iv) Is it reeeeeeeally that bad to just implement an interface?

tcbawo•4mo ago
Can you elaborate on your third point? What would a class need to do to affect debugging info?

Regarding your fourth point, sometimes an architecture can be vastly simplified if the source of information can abstracted away. For example, invoking a callback from a TCP client, batch replay service, unit test, etc. Sometimes object oriented design gets in the way.

To your first point, I think RAII and architecture primarily address this. I'm not sure that I see callback implementation driving this. Although I have seen cancellable callbacks, allowing the receiver to safely cancel a callback when it goes away.

mwkaufma•4mo ago
>> Can you elaborate on your third point? What would a class need to do to affect debugging info?

Common implementations are a function pointer + void* pair, which in most debuggers just show you two opaque addresses. Better to include a info block -- at least in debug builds -- with polymorphic type pointers that can actually deduce the type and show you all the fields of the receiver.

>> sometimes an architecture can be vastly simplified if the source of information can abstracted away.

"sometimes" is doing a lot of heavy lifting here. That's my whole point -- more often than not I see some type of homespun functor used in cases that are _not_ simplified, but actually complicated by the unnecessary "plumbing."

>> RAII and architecture primarily address this

If the receiver uses RAII to clean up the callback, then you've reintroduced the "type-intrusiveness" that functors are meant to avoid...?

tcbawo•4mo ago
> most debuggers just show you two opaque addresses

This has not been my experience. But I haven't needed to deal with RTTI disabled.

By RAII, I mean using destructors to unregister a callback. This covers 99.9% of use cases. Generally callback registration is not where you really want type erasure anyways.

mwkaufma•4mo ago
>> By RAII, I mean using destructors to unregister a callback.

_Whose_ destructor, if not the receiving-type? Is there a third "binding" object, because then you have three potentially-unrelated lifetimes.

>> Generally callback registration is not where you really want type erasure anyways.

I'm responding to the article: "Some mechanisms for doing callbacks require a modification to, or derivation of, the caller or callee types. The fact that an object is connected to another object in a particular application often has nothing to do with its type. As we'll see below, mechanisms that are type intrusive can reduce the flexibility and increase the complexity of application code. "

tcbawo•4mo ago
> Whose_ destructor, if not the receiving-type

The receiving type should control the lifetime of any callbacks to itself that it gives away. The destructor is the best place to ensure this gets properly cleaned up.

Like anything, custom callbacks can be used well or misused. Design is a matter of expertise and taste bordering on an art form. Connecting framework implementation and business logic can be done cleanly or clumsily. I am skeptical of an argument that callbacks have a code smell prima facie.

mwkaufma•4mo ago
I don't disagree, but the article does. RH describes an architecture where setup functions create callbacks, independent of the receiving type. If I were to steelman him, it would be something like this: "in a pedantic MVC system, model objects don't depend on view objects by design, and therefore should not be aware that their methods are used as 'click callbacks'"
kazinator•4mo ago
> Red flags for me when I see nonstandard functors in a c++ codebase

Even if it's 1994???

mwkaufma•4mo ago
Yes in 1994 I had these exact judgements, at age 11 :P
NL807•4mo ago
Clever kid
pjmlp•4mo ago
The only "standard" in 1994 was the C++ARM book (filled a similar role to the K&R C book) that served as basis for the ongoing standardization process, to be done in 1998.
mwkaufma•4mo ago
Apologies, I didn't mean "standard" as in the C++ language standard, but standard as in provided-by-your-app-framework's-foundation-library.
dang•4mo ago
Related. Others?

Callbacks in C++ using template functors (1994) - https://news.ycombinator.com/item?id=18650902 - Dec 2018 (50 comments)

Callbacks in C++ using template functors – Rich Hickey (1994) - https://news.ycombinator.com/item?id=12401400 - Aug 2016 (1 comment)

Callbacks in C++ using template functors (1994) - https://news.ycombinator.com/item?id=10410864 - Oct 2015 (2 comments)

zengid•4mo ago
not sure why the title was renamed, but i thought this was interesting primarily because it's the early work of Rich Hickey, famous for making the Clojure language.
sour-taste•4mo ago
Doing this today I'd just have a std::function parameter and have callers pass in a lambda. I may use a third party std::function that doesn't have the weird copy semantics though
vitus•4mo ago
> I may use a third party std::function that doesn't have the weird copy semantics though

Note that C++23 brings std::move_only_function if you're storing a callback for later use, as well as std::function_ref if you don't need lifetime extension.

https://en.cppreference.com/w/cpp/utility/functional/move_on...

plorkyeran•4mo ago
This paper is about the idea that eventually became std::function.