Hacker Newsnew | past | comments | ask | show | jobs | submit | ryani's commentslogin

Listening to Mike Duncan's "Revolutions" podcast I was distinctly struck with the idea that the main thing leftists like to do, even more than fighting rightists, is fighting other leftists.


Sadly, you can't easily do the full pimpl idiom in C++.

The pimpl idiom is a C idiom where a header declares an opaque structure and prototypes of functions that take pointers to that structure. In C the OP example would look something like

    // widget.h
    typedef struct Widget_t Widget; /* opaque! */

    Widget* Widget_Create(const string* pName);
    Widget* Widget_Clone(Widget*);
    void Widget_Destroy(Widget*);

    void Widget_click(Widget*);
    int Widget_clickCount(const Widget*);
    const string* Widget_label(const Widget*);

    // widget.c
    struct Widget_t {
        int clicks;
        string *name;
    };
    // ... implementations of the functions from the .h ...
In particular, in C `Widget` directly has `clicks` and `name` as fields.

But in c++ we like to use methods on objects, and in order to do this, you need the class declaration in scope, which means your current compilation unit needs to have seen all of Widget's data members. In practice this means if you try to use "pimpl" in C++, you do something like the OP where there is a pointer to an opaque type inside your class.

However, this is not the same thing. Methods are called with a `this` pointer, which means every access to the internal structure adds a second pointer dereference. This is why this isn't the true pimpl -- it wastes an extra deref on every access.

You can get true pimpl in current C++ but it's a lot of boilerplate and heavily relies on compiler inlining. An implementation of the example from the OP: https://godbolt.org/z/6EznxeG1n . In practice this is too much work, hard to read, and so nobody does it.

For the c++ standards committee: please add an "opaque class" feature where the class can only define non-virtual method prototypes. Then the full class declaration, in the associated cpp file, could include its parent classes, actual data layout, and function implementations.


A similar opaque pointer pattern with member functions is possible to do with inheritance.


Completely agreed, but in fairness to the c++ standards committee, this is solved from a standards perspective by c++ modules


> I can tell you right now that you would have to pay me far above market rate to get me to move

If everyone feels that way, then it's not an above-market rate, it's by definition the market rate. The market rate for a job might be different at different locations.

(Note that I'm not taking a position on whether or not using the H1B program to reduce the market rate here is a good idea)


What statutory penalty?

https://www.copyright.gov/512/

Read the requirements for a takedown notice. The only thing a DMCA notice needs to claim under penalty of perjury is that you are authorized to enforce the copyright that you are claiming. The report from the copyright office on the linked page states:

> Senders of both takedown notices and counter-notices are liable for damages if they make knowing material misrepresentations regarding whether the material to be taken down is infringing, or has been removed or disabled by mistake or misidentification. Courts have appropriately interpreted this provision by requiring actual knowledge or willful blindness of falsity, not merely negligent or unreasonable misrepresentation.

"Knowing" does a lot of heavy lifting here. Courts have determined that someone who uses an automated system to identify infringing content and submits takedown notices against all of that content does not "knowingly" misrepresent anything.

Furthermore, even in the case where there is bad faith, there's no statutory penalty, it relies on the targeted party suing and in court proving BOTH bad faith, and damages.

The DMCA has no teeth against false claims.


I want to be able to click-and-drag. For example, in this row

    1 2 |x x  |
if I left click the second cell and drag right it should mark all the blank cells black.

Similarly in the inverted case, if I have marked cells and right-click-and-drag next to them it should mark the empty spots I cross over with Xs.

Important: this doesn't change the state of any cell that wasn't blank to start out. You should have to click on a marked cell to clear it (or right click to replace it with an X). And similarly to above, if you drag, it should change only the cells you touch that match the starting state of your original cell to the new state.


This is also available (with an included Flash emulator, so playable on modern machines) in Zach's free retrospective "Zach-like" [1]

[1] https://store.steampowered.com/app/1098840/ZACHLIKE/


How is "Baumol effect" different from supply and demand for any limited resource?

Let's say that some new use for copper is discovered, that drastically increases the demand for copper. The cost of existing items that use copper is going to go up, even if those items are no more productive than they used to be, because the new items are now in high demand.

You can see this effect in real life with GPUs; it's much more expensive to buy a gaming graphics card today than it was a decade ago, because GPUs are in high demand for other applications.

So, increasing the productivity of labor in some sector is going to do the same thing supply and demand does to anything else -- the cost of labor goes up, but not as much as the productivity in that sector, and the producers of labor will enjoy higher demand.


>How is "Baumol effect" different from supply and demand for any limited resource?

It isn't, but nominal growth as a consequence of demand without increase in real output makes you no better off, that's the "fake" part. More practical example than graphics cards is houses. Large chunk of the US market, constantly goes up in price, but not because housing is becoming more productive. It's because money from other sectors spills over. Good for landlords, bad way to measure real economic activity. You'd be better off if you could roll houses from the conveyor belt and collapse prices.

Rising education prices don't reflect greater quality in education, faster teachers, or more graduates, i.e. output, which is what we ought to care about, but just higher spending funded by real gains in other sectors.


Hi Chaim! I really enjoyed working with you on Spore. What have you been up to in the intervening years besides writing this book?


Hi Ryan!! I got a PhD, did some indie game stuff, made some babies (with some help, mainly from my wife), design consulting. You can see more of my projects here: https://chaim.io, like some tangible/mixed reality computing (done while I was working at a research lab with Bret Victor), and Earth: A Primer, a science book made of simulation toys.


> ... working at a research lab with Bret Victor), and Earth: A Primer, a science book made of simulation toys.

For the folks reading this, I just wanted to point out that Earth: A Primer is one of the coolest sets of explorable explanations ever made:

https://www.earthprimer.com/

Thanks for making all this cool stuff! :-)


I do love the Earth Primer.

The Earth is our Mother, so we shouldn't treat her like Dirt! ;)


Ryan!! Now you’re getting tagged. Long time. I saw Ted and Rebecca a couple weeks ago. If you’re that Ryan I.


I think something like Unity or Gamemaker or even Scratch fills that niche now. They are a bit more game-focused than Hypercard (which was really more of an early iteration on the web), but, I think, capture a similar feeling of empowerment and creativity among nerdy young people as Hypercard did for nerdy young me.


This is such a crazy take. "Because the waste is so huge, it's impossible to do anything".

It's not like any individual reform is going to suddenly end all that waste and put everyone involved out of a job. Iterative small improvements make a real difference in people's lives, and won't provoke an immediate giant supply-side shock.

I don't pretend to have the answers to the question of "what reforms should we do?" but throwing our hands up and saying "nothing!" is not the answer.


Its kind of that way

How do you reduce inefficiencies and cut costs without compromising care?

You cut jobs that are redundant. America spends an insane amount of money on administrative overhead. 4x the average of other wealthy nations [1]. This is largely in part because our fragmented insurance system leads to excessive redundancy in administrative roles

So meaningful reform means cutting jobs. Or you do the shitty political move and preserve these useless jobs for the sake of keeping people employed because our social safety net is a joke and the cost cutting you do make is at the expense of compromising care and vulnerable populations (eg cutting Medicare and Medicaid benefits). Then you get more clinician burn out and struggle to fill key clinical roles/staffing issues, scheduling issues and longer appointment waiting periods, more deaths and complications from a lack of preventative care, more mental health issues and drug abuse in communities, etc. all of which is happening in the USA.

[1]https://www.pgpf.org/blog/2023/07/how-does-the-us-healthcare...


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: