Recent submissions

Comment · 4 years ago
"White diaspora" is blowing my mind a bit. I think I would have been slapped by my social studies teachers if I ever used that phrase to describe colonialism. (I'm white, US)
Comment · 9 years ago
Careful, that pseudocode has a famous error in it. Finding it is an illuminating exercise.
Comment · 14 years ago
JavaScript for Node? Isn't that a bit like saying "Java for Minecraft"? I can think of at least one popular use of JavaScrip that predates Node.
Comment · 14 years ago
Boost.Intrusive does this, without the casting or offsetof'ing.

http://www.boost.org/doc/libs/1_47_0/doc/html/intrusive.html

Not that most of what you said isn't true. Just picking the nit that 'the container owns the data' holds only for the STL, not C++ in general.

Comment · 14 years ago
You have a strange definition of "excel".
Comment · 14 years ago
Totally agree, but I just have to pick one nit on your final point re GHC and unpacking: If you do this you forfeit all generic programming because a 'lifted' polymorphic type has to be represented by pointer to a heap object. This is where C++'s unique take on generic programming still wins big.
Comment · 14 years ago
Have you looked at the Haskell Ix class? http://www.haskell.org/onlinereport/ix.html

It generalizes the choice of 0 or 1 to an arbitrary starting index. So when you create an array you specify not just where it ends but also where it begins. This lets you do neat things (consider a filter kernel with range [-s,+s]^n instead of [1,2s]^n) and the extra complexity it adds can be hidden when not needed using for-statements or higher order functions.

Nobody uses it because the implementation is not very efficient and Haskellers have a chip on their shoulder about performance. It subtracts the origin and computes strides on every index, but you could easily avoid this by storing the subtracted base pointer and strides with the array. Of course when you go to implement it you'll see light on 0-based indexing :)

Comment · 14 years ago
Why is there not a service that tracks news stories and algorithmically relates them into the narrative of history, driven by the singular question of "why?"? Something in between google news and quora/stack exchange (anonymized to avoid embarrassment of dumb questions like "what are Israel and Palestine fighting over anyway?" but with a points/voting system to propagate quality answers.) Whoever makes this, please Tell HN so I can sign up for your beta.
Comment · 14 years ago
I think a better analogy would be a farmer tending to his crops. Google users are not the customers, they're the product.
Comment · 14 years ago
C++ template's aren't just unusual, they're unique among mainstream languages. They're C++'s secret weapon. These days, if you're not making heavy use of templates in your C++ code then you're using the wrong language. Like you said, many people use C++ to solve problems they could be solving more quickly and more safely with another language, but it's not C++'s fault, it's their fault.

In particular, the key feature of C++ templates (as opposed to other similar systems of polymorphism) is that they abstract over not just code but data representation. This is what CJefferson was getting at and it's orthogonal to macros. Ocaml and Scala don't offer it. It's about data, not code, so you'll never be able to gloss over it with extra parallelism.

In C++ a std::pair<double,double> really is just two doubles, 16 bytes. It can be passed into and returned from functions in registers. If I have a singly-linked list of them, each list cell is 24 bytes (16 for the pair, 8 for the next pointer.) In any other (mainstream) language, the pair is really a pair of pointers to boxed doubles which reside in the heap, and the list cell holds a pointer to that. The overhead of this is unacceptable in many situations, and these situations are where C++ still thrives. (cf. the Eigen linear algebra library for an example of "doing it right.")

Most languages have given up on this feature because of the drawbacks (code bloat) and the unified runtime representation of data (basically everything is a void*) makes many things easier (garbage collection, serialization, etc.) (I'm not super familiar with C# but I understand the struct types address this somewhat, but not without their own drawbacks.) But thanks to LLVM (written in C++ btw) people are pushing this area of language development forward (Rust, Deca, and others) in an attempt to fix the (many) problems of C++ while preserving its strengths.

Oh and BTW: A tank with wings is called an A-10 warthog :)

Comment · 14 years ago
The more targeted the advertising, the more effective and therefore valuable it is.

But it's still hard to know what people want or need to buy right now

They can (and do) personalize it somewhat, but just aren't as well-placed as facebook, because they aren't as close to the user (people). People are ultimately where the money comes from. That's how advertisers get it.

So who's information is more valuable? Facebook's because they know more about you overall (your friends, your habits etc.) or Google's because they know what you want right now (because you just entered it right fucking there in the search box)

I'm leaning toward Google. If someone has a problem, they go to Google to search for ways to solve it, and as you point out, that's precisely when they're most amenable to advertising. People go to Facebook to connect with other people. Advertising will always be noise there. (Stupid mindless games notwithstanding.)

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton