News for hackers. Stuff that matters.

doorman2

Re:Chess, but neither player moves first on Monday November 14, 2022 @10:22PM (#33604860)
Unfortunately I can't play due to the HN hug of death, but I just want to say that this is a great idea. Chess is a wonderful game on its own, but having a synchronous element to the game and information asymmetry seems like it could add a lot of depth.
I find it helpful to think about blockchains as the next step in the fintech ladder. Imagine you want to represent ownership of a company, i.e. stock. You don't need electricity to do that. You can accept orders in person, record ownership in a book, issue paper certificates, etc. However, when the mainframe was invented, it became easier to track ownership electronically. Using electronic transactions also made it possible for many more people to trade and expanded the types of products offered, e.g. options became commonplace. Now, the blockchain has arrived. It does everything a mainframe at a large financial institution can do, but it opens up the platform so that more complicated transactions can happen and democratizes the platform so that anyone with a computer can write their own smart contract.

What we're seeing now is akin to the the dotcom boom / bust in the late 90s and early 2000s. A new technology has appeared on the scene which leads to two things:

1) People get ahead of themselves. In the late 90s, people could envision all the cool things the internet would unlock and tried to start businesses to realize the potential. Many of those business ideas would be viable today, but the tech wasn't there at the time leading to a lot of empty promises being sold. Today, people can envision how the blockchain will lead to the securitization of everything, but the tech isn't quite there to make the transition yet.

2) As with any optimism boom, there will always be crooks ready to separate a fool from their money.

Google's first party platforms (Search and YouTube) account for 85% of ad revenue [0]. Search alone accounts for 72%. I'm not really sure how AdSense is relevant to the discussion. Google is clearly a huge competitor to the NYT.

[0]: https://www.sec.gov/Archives/edgar/data/1652044/000165204422...

> The NYT is in the "providing content to lure people to advertisers" business.

What does that mean? The NYT sells ads, i.e. you can pay the NYT to have your advertisement shown in the NYT. Google sells ads, i.e. you can pay Google to have your advertisement shown in Google results. The NYT and Google sell the same thing. They are competitors.

Re:Deno 1.28: Featuring 1.3M New Modules on Monday November 14, 2022 @10:22AM (#33595262)
You use the setsockopt system call. This is an example in C:

    int sfd = socket(domain, socktype, 0);

    int optval = 1;
    setsockopt(sfd, SOL_SOCKET, SO_REUSEPORT, &optval, sizeof(optval));

    bind(sfd, (struct sockaddr *) &addr, addrlen);
In Go, you can use syscall.SetsockoptInt. Most languages have a way of setting this option. You have to create the socket yourself and pass it into your HTTP server in most cases, but it depends on the library.

Edit: oh sorry, you meant when systemd is opening the port for you. It looks like you can set ReusePort=yes in your configuration? https://www.freedesktop.org/software/systemd/man/systemd.soc...

Re:Deno 1.28: Featuring 1.3M New Modules on Monday November 14, 2022 @10:08AM (#33595050)
You could solve the resource starvation issue by running multiple instances of your app and binding to a port using the SO_REUSEPORT option. This will allow multiple instances of your app to use the same port.

This option is also quite good for deployments as you can have instances stop reading from the port while client traffic is still being served from other instances on the port. This works well for HTTP requests, but less so for something like gRPC.

Re:Mighty is shutting down after 3.5 years on Monday November 14, 2022 @09:54AM (#33594796)
Browsers aren't single threaded, so the ST performance isn't the end-all-be-all metric to use. JavaScript is single threaded, but the browser itself uses multiple threads. E.g. there is the main thread, which handles the user input. There is the rendering thread, which actually takes up a majority of the CPU time on a lot of websites. And then there is stuff like GPU acceleration, which makes a lot of the web performant when it wouldn't be otherwise. Of course, a server does all of these things worse than a decent laptop.
Re:What You (Want to)* Want on Monday November 14, 2022 @09:51AM (#33594740)
Basically, there is no free will. Think about it like this: where do your thoughts come from? They appear magically in your head. So you can choose between the set of things you think about, but the set of things you think about is out of your control.
Crypto doesn't pose an existential threat to the NYT business model like social media and search do. I.e. The NYT is in the advertising business. Google, Facebook, et al are direct competitors.
Re:FTX Balance Sheet on Sunday November 13, 2022 @01:34PM (#33585909)
I mean they do that. Companies issue, hold, and buy back stock all the time. The difference is that JPM stock is a thing that people want and has intrinsic value as it confers ownership over the company.
Re:Mold may switch to non-commercial-only license on Sunday November 13, 2022 @01:21PM (#33585755)
Are there any out-of-the-box non-commercial licenses? I’ve wanted to do this too, but I’m too lazy to find an appropriate license.
Re:Mighty is shutting down after 3.5 years on Sunday November 13, 2022 @12:58PM (#33585496)
Mighty had no hope of succeeding. I’ve built something very similar to Mighty, and the fact is that browsers are hogs, and then adding on video transcoding on top of that makes the situation completely untenable. If someone can’t afford a computer good enough to browse the web, they sure as hell can’t afford a computer that can transcode HD video at all times, which is essentially what they’d need to pay for.
It's not an excuse, just an economic reality. People prescribe value to things. The value of a typical transaction at a centralized exchange isn't worth the on-chain transaction cost. That's a problem with current blockchains, not a problem with the purchaser.
Fees are cheaper on centralized exchanges. Like with everything else in crypto, transaction fees kneecap most of the cool stuff.
I wouldn’t say tether shows that trustless decentralization is irrelevant. Rather, the existence of tether proves the need for stable coins. What was interesting about LUNA is the attempt to create an unbacked stable coin. That would have been a true innovation had it worked.
How do you send data to the client without their IP address?
Re:Hedge fund admits half its capital stuck on FTX exchange on Saturday November 12, 2022 @12:34PM (#33575183)
Let's say all the money is in BTC, which is down 74% YoY. If you started with $100, you'd have $26. And then you lost half of it, which brings you to $13. So you'd be down 87%, which is on-par with many tech stocks.
Re:Ask HN: Programming Without a Build System? on Saturday November 12, 2022 @12:31PM (#33575160)
I feel your pain. I've given up on so many projects because I got bored tinkering with build systems.

Ultimately, the answer to your question is going to depend on what you want to make. For instance, if you want to make an iOS app, it's going to be difficult to do so without using Xcode's build system.

Go is a very good language in terms of having a build system that stays out of your way. On Linux, you'd do something like `sudo apt-get install golang`, and then be on your way.

One nice thing about submitting forms the "old way" is that they work even when JS is disabled. Not many people care about that, however.
Monero implements sender privacy as well.
You could do that with Monero as well. Ultimately, you would use a taxable system because you’re honest and want to pay taxes. So nothing about using Monero prevents the parties from reporting their transactions to tax authorities. Just as nothing prevents merchants from reporting their cash transactions.
Re:Thirteen Years of Go on Friday November 11, 2022 @05:14PM (#33567606)
Yes, succinctness is almost never in Go's favor.
> In 1945, the psychoanalyst René Spitz published an article in which he explained how deprivation of social interactions can lead to a condition named "hospitalism" in infants. According to Spitz, young children who are cared for in institutions can suffer from severe impairment in their development because they are not provided with sufficient maternal care.

We figured this out without needing to torture monkeys. Apparently, though, this was not sufficient for Harlow, as he created his pit of despair almost 30 years later.

Isn't that true of almost everything humans do? When I get a tank of gas, I'm basically paying to have a bigger problem in the future. I do so because it solves a problem I have in the present.
Re:How Stdbuf Works on Friday November 11, 2022 @03:11PM (#33566152)
Thanks, that's is interesting background. From my pty experience, though, the answer is a bit unsatisfying. One reason is that I thought ^D generated an EOF in the terminal. For instance, if I use `wc` in the terminal, it reads from STDIN until I use ^D and then I get the output. Another reason is that it seems like a bug in the program to not respond to EOF. At the very least, unbuffer could offer an option? Anyway, I digress...

The PTY interface in general feels a bit lacking. Normally, if you use a pipe, you can close to write end of the pipe to generate an EOF. With pseudo-terminals, you only have one file descriptor for writing input and reading output so you can't have the system generate an EOF without disabling your ability to read the output.

Re:Thirteen Years of Go on Friday November 11, 2022 @02:54PM (#33565918)
Personally, I hate writing Go. It's a very dull and boring language, but it's an amazing language (objectively speaking) for software development.

1) It's performant. The language itself is very fast, the GC is very fast and go routines make concurrency fast.

2) The tooling is great. Once you have the Go CLI installed, everything else "just works." Cross-compilation is super easy. Install dependencies is easy. Generating code is easy. Embedding files is easy. The ecosystem is really mature. Modules are easy to create, export, and import. Compilation time is fast. The list goes on...

3) The generics system is amazing. It beats any system that implements generics with type erasure.

4) The language itself is very easy to read and write.

5) The language is relatively new, which means less outdated cruft. The language also puts an emphasis on having only one way to do things.

So comparing it to other languages:

- Python: Terrible tooling. Not performant

- C# Bad tooling (do I need .NET, .NET Core, Mono? How do I create a project? What is this crazy project xml file? How do I export my project to be consumed by others? How do I import a dependency?). Also, as an older language, it has a bit of cruft, e.g. it has optional types, but they also aren't required? Maybe if I knew more about C#, I would find it better. But using it with Unity didn't leave a great taste in my mouth.

- JavaScript: not performant, especially in multi-core environments.

- Rust: Rust is too hard to write. It's not worth the overhead if you can afford a GC.

- C++: Same as rust, + more foot guns and unsafe memory management.

- Zig: Don't have much experience with Zig, but I'd like to.

- Ruby: Not performant, not typed.

- Swift: Tooling is bad. Compilation is slow. Cross-platform is not a priority. Swift Package Manager is buggy. Using Xcode sucks.

- JVM languages: bad tooling (maven, sbt, gradle are all a pain), generics have type erasure.

Of course, there are reasons to use other languages. If you’re writing an iOS app, the tooling for Swift is best-in-class. Or if you’re doing ML, the ML-specific ecosystem in Python outweighs all other considerations.

Re:The World Is Run by People No Smarter Than You on Friday November 11, 2022 @01:18PM (#33564531)
This may have been more true during the times of nobility. With modern democracies and market economies, we at least try to have some form of meritocracy. Obviously, we fall short in a lot of ways, but the goal is to bring to best to the fore.
Re:How Stdbuf Works on Friday November 11, 2022 @12:56PM (#33564187)
I was recently working with a bunch of pseudo-terminal stuff, so I was curious about how unbuffer works. One thing that stuck out to me in the manpages is this:

    Caveats
    
    unbuffer -p may appear to work incorrectly if a process feeding input to unbuffer exits. Consider:
    
    process1 | unbuffer -p process2 | process3
    
    If process1 exits, process2 may not yet have finished. It is impossible for unbuffer to know long 
    to wait for process2 and process2 may not ever finish, for example, if it is a filter. For expediency, 
    unbuffer simply exits when it encounters an EOF from either its input or process2. 
Why does unbuffer care whether or not process2 exits? Can't it receive the EOF from process1, send it to process2, and then wait for process2 to exit? If process2 doesn't exit after receiving an EOF from stdin, then what's the issue about simply letting the pipeline hang? Isn't that what would happen without unbuffer?
It's not like they're giving the lithium away for free?
What was it about the 20th century that produced such heartless people? Lead exposure? I understand that the 20th century is far from an aberration in terms of human cruelty, but there is an element of sadism that feels different than other centuries.

For instance, read the first sentence from Harlow's Wikipedia page:

> Harry Frederick Harlow (October 31, 1905 – December 6, 1981) was an American psychologist best known for his maternal-separation, dependency needs, and social isolation experiments on rhesus monkeys, which manifested the importance of caregiving and companionship to social and cognitive development.

Did we really need to torture these creatures for decades to understand the importance of care giving? The experiments seem like a flimsy pretext for torture.

Older »