Better HN
topnewbestaskshowjobs
Log inSign up

MathMonkeyMan

2,676 karma · joined Nov 28, 2019 (7y ago) · 1,131 submissions

Submissions

comment 3y ago · link · parent

yep, need a nightly build as of today

comment 3y ago · link · parent

> > you don’t need to write destructors

>

> I think this is not accurate. Destructors are not

> deallocators, they are supposed to set the object field in

> an invalid state. Now truth is that both are often called

> together, e.g `delete`.

If the object manages some resource other than memory, and if the object's lifetime is intended to guard the resource, then a destructor is needed.

But if the object manages memory only, as is often the case, and all of that memory came from the arena, then you really don't need to call any destructors.

This is the approach taken in one C++ [library][1] I've worked with, where objects represented scalar values to be used en masse for spreadsheet-like applications. In those applications (especially in 32-bit mode), being able to omit an allocator pointer and neglect a destructor call made things smaller and faster.

[1]: https://bloomberg.github.io/bde-resources/doxygen/bde_api_pr...

comment 3y ago · link · parent

Separating parsing from semantic analysis simplifies the parser considerably.

If one of Go's aims was to make different trade-offs than [C++][1] did, then the choice not to use "<" as a grouping operator was a good one.

[1]: https://youtu.be/WfIr7lKT4Sk?t=204

comment 3y ago · link · parent

I'm not looking for any numbers, so I don't know.

One argument I've heard in favor of government-owned industry is for things that must be more or less guaranteed for everybody, regardless of capital.

Drinking water, postal service, election management, and violence (police, national guard, military) come to mind.

Those examples might be more efficient and affordable if privatized, but then it might be expensive or unreliable to get mail in Alaska, or there might be lawlessness near parts of the Mexican border, or elections might be fraudulent in some districts.

Throwing tax dollars, laws, and bureaucracy at these things doesn't necessarily improve them, but maybe it raises the bottom, at considerable cost.

comment 3y ago · link · parent

I've been playing with a lispy thing that might be:

    (grocery_list
      (fruit "apple")
      (fruit "banana")
      (fruit "pear"))
That's pretty much exactly XML. Alternatively:

    (grocery_list
      (fruits "apple" "banana" "pear"))
but the semantics are different.

My motivation is expressing docker-compose.yaml in the "best" way I can imagine, as a design exercise. In that case, I'd rather have a bunch of (service ...) forms, instead of a "services" object. Not sure why. Maybe it's a pun on interpreter-driven formats like that used by [guix][1].

[1]: https://guix.gnu.org/manual/en/html_node/Shepherd-Services.h...

comment 3y ago · link · parent

Put some parentheses in there and you're good to go :)

comment 3y ago · link · parent

These days when I present cash at the counter, it's as if I shouted "BOO!" while the cashier was sleeping. "DO YOU REMEMBER YOUR TRAINING?"

comment 3y ago · link · parent

I think GP was referring to how 1/3 cannot be represented as a binary floating point number. There should be something other than a "3" after the "..." if that was the point.

1/3 truly is an endless 0.33333... independent of any technology.

comment 3y ago · link · parent

Each PR has 20 lines, and there are 30 such PRs over six months.

comment 3y ago · link · parent

It does reach your brain, and it does affect you, just like a fog of gnats you've grown accustomed to still affects you.

For what it's worth, the ads aren't for you. They're for anybody or anything that might click them, knowingly or not, and that's not you.

comment 3y ago · link · parent

presumably you can still open them from the inside

comment 3y ago · link · parent

Then it's about designing the tests.

Maybe that _is_ a good idea...

comment 3y ago · link · parent

The public are fine, come on.

comment 3y ago · link · parent

just some dental floss tycoons

comment 3y ago · link · parent

A divorce lawyer in New Jersey told me that 1/3 of the prenups she sees end up making any difference.

comment 3y ago · link · parent

I don't know about averages, but I have known a cop who got into it for the sake of law and order, and promptly left after seeing how things were done. It must vary widely depending on the management, like any bureaucracy.

comment 3y ago · link · parent

This would be a fun addition to a college's History or Journalism curriculum.

comment 3y ago · link · parent

Ah, so requiring one to file their taxes is akin to allowing them to own firearms. A check against incursions on freedom. That an industry makes a killing on it is just a side effect :)

comment 3y ago · link · parent

> There is a contingent of Congress that does not want to make tax preparation easier because it aligns with their narrative that taxes are bad. The more painful tax preparation is, the more sympathy they find with this narrative.

I'm primed to believe this because I'm a registered Democrat raised in that kind of household. Is it true, though? The logic makes sense, but how could we really determine whether a tax-bashing neoconservative actively protects labyrinthine tax practices in order to justify adjacent political ends? I'm more likely to conclude that it doesn't happen.

comment 3y ago · link · parent

I didn't read the book, but I watched the recorded [lectures][1]. I got the sense that course was the tip of an iceberg of an entire academic discipline of programming philosophy and practical wisdom. On its face, though, it is an introduction to programming that starts with symbolic substitution, moves on to mutation and other tricks, and then I think gets into interpreter design.

If you want your mind blown, read "The Little Schemer" (or the original "The Little Lisper," or another of its variants). I particularly like the section near the end where the Y combinator is (secretly) described. The goal of that book is to "teach you to think recursively." It's not about writing recursive functions at work, but about appreciating the self-referential properties of algorithms.

[1]: https://www.youtube.com/playlist?list=PL8FE88AA54363BC46

comment 3y ago · link · parent

A contemporary explanation of near and far pointers on page 16. Today I learned.

comment 3y ago · link · parent

I'm going to try this. Any preferences for a low-fuss reader?

comment 3y ago · link · parent

People don't want to support cash transfers because they think that the beneficiaries will blow it on drugs. But they're wrong: if you eliminate anybody who would blow it on drugs, then that problem doesn't occur at all!

comment 3y ago · link · parent

I was looking for something like that, but didn't find it at a glance. Not surprising, I suppose.

comment 3y ago · link · parent

Here's part of an English translation of the Russian constitution: http://www.constitution.ru/en/10003000-03.htm

and the Chinese constitution: http://www.npc.gov.cn/zgrdw/englishnpc/Constitution/2007-11/...

It's not about the constitution.

comment 3y ago · link · parent

Why wouldn't they? It's free money. And they control the technology.

People pay for cable television, and for New York cab rides, and for many other things laden with advertisements.

comment 3y ago · link · parent

I read a blog post somewhere (don't remember where) that describes the process of unfactoring (multiplying?) code as an exercise. Copy/paste the code until there's one straight code path per use case. Then examine the similarities and factor the code again. What you end up with will often be different from what you started with, and probably simpler, especially if the code had begun to drift from its original author's design.

So, "unfactor" the code and then factor it again. Let's call it... "refactoring."

My $0.02, then, is that "the wrong abstraction" assumes that you are unwilling to change it. What if we were comfortable tearing down our classes all willy nilly and replacing them with some other thing? Is it too risky? Does it hurt too many feelings?

Maybe the problem lies there, instead of in duplicate vs. abstract.

comment 3y ago · link · parent

> What is the logic behind this practice other than profit maximization?

I don't know, but I can't imagine any other logic.

Maybe posting the price they'd like to charge would scare away almost all interested parties.

Maybe the price they charge you depends more on how much money they think you have than it does on a market's "decision" on what the product is worth.

comment 3y ago · link · parent

> Plenty of people have already made the decision to delegate decisions to AI.

That got me thinking.

comment 3y ago · link · parent

Might help to replace

    cat foo | $command
with

    <foo $command
It's the same order, but I think $command can sniff what kind of file stdin is, and optimize.
1
262728
38