Hacker News new | past | comments | ask | show | jobs | submit | smallstepforman's comments login

Nice article. Any project rewritten from scratch (version 3 here) by the same experienced engineers will inevitably be better/more robust/more performant than the previous versions. During our career growth as craftsmen, we build using tools we understand, and get a certain output. As we learn more about various other tools (techniques), we have a wider understanding and will make it better again.

Having read about their journey, I can see they use 77 mutexes and a hierarchy chart for locking to prevent deadlocks. How quaint. I keep on harping about the Actor programming model to deaf ears, but I guess the apprentices need more stumbling around before achieving true enlightenment.

Version #4, perhaps?

Any guru want to share what path to take after Actors? I’m ready…


The problem with actor in rust is two fold and would prevent their use in this context I think:

- They need async. Otherwise you need to implement yielding in house, have one actor per thread, etc. OS code is usually sync / callback based.

- They need owned and usually send for all input. Since you have to send input / messages over a channel it makes it a requirement to have owned values and send if crossing thread boundaries. Very annoying requirement in rust.


Not a guru, but my take is that the actor model is one method of architecting a system to separate synchronization from other concerns. There are other ways to do that, often specific to a particular problem and with more or less separation. As always, there are many tradeoffs involved.

Effect systems are great for concurrent programming and easier to reason about than actors. They aren’t available in all programming languages however.

After actors? Transactions for sure. The SQL databases have been doing it the right way for just as long.

For decades we have been using assert(input) and assert(output), so it's not exactly new. Forcing sanitary checks by the language runtime is an option, hence requiring contracts to spell out the range of valid input/output which is checked in debug mode. Otherwise, if it's optional, it will only be used by a subset of engineers. If its mandatory, it can cripple performance (unless we have unsafe scopes). Opt-out is always better than opt-in.

Anyone publish a study about the harmms of legalised stock trading (day traders), currency traders, auction hunters, real estate speculators, collectables, crypto hoarders etc you get the point. The only difference is time between sessions, wager amount and tangibles. The next revolution in gambling will add some ownership element, akin to bitcoin.


There is a difference, though. Stock trading is a non-zero-sum game, investment can result in an overall economic growth.

Betting is _literally_ a zero-sum game that doesn't provide any economic benefits.


Amazing you had to point this out. Some people are so used to thinking of the stock market as a gambling platform that we forget it serves an actual purpose, and is probably one of the primary drivers of our society’s prosperity.

That said, I’ve worked in consumer trading, and almost all of the profit margin comes from customers engaging in gambling-like behavior (e.g. crypto and options day trading). It’s a big reason I don’t work in that space any more.


>that we forget it serves an actual purpose, and is probably one of the primary drivers of our society’s prosperity.

We chose to give our fate of "prosperity" to monopoly money and we wonder why people became lonelier, more depressed, and hopeless in life.

When services cease to serve society and instead this speculation for people well off enough to participate, it should be no surprise Goodheart's law is minmaxed towards enshittification over quality. Shittier but higher engagement algorithms, price hikes on a whim, ads everywhere on your screen real estate, paywalls for essential news. And subscriptions for things that have no business being a subscription. So many subscriptions. I could go on all day.

And ofc the final optimization of this phenomenon is reducing costs on the mode expensive part of a business: labor. Automate it away or become a US shell company when 95+% operates in a 3rd world country paying well below US minimum wage. That's exactly what society needs, less reasons to get out of bed.

But if it made a few dozen billionaires even richer, I guess that's all that matters in the end.


I’ve traveled a bit and it’s pretty clear that the US has extremely high material prosperity. It’s not universally distributed but it is widely distributed. It’s not purely smoke and mirrors and creative accounting.

Certainly there are things that matter more in life than material prosperity, and there are many alienating things about western society.


Money spent transferring share(s) ownership doesn’t impact the companies cash flow unless it’s new shares emmision (eg if I buy issued coca cola shares, only the broker gets spendable cash).

Regarding gambling being a zero sum game, someone has to design, manufacture, service, install and operate the machines. Lots of employement building those machines. And taxes earned operating them. You do know that approx 5% of state revenues come from gaming activities.


Less than zero, really


Matt Levine had an interesting point/counterpoint here:

> There are a lot of ways to put your money into the stock market; some of them feel mostly like “fun gambling,” while others feel like “boring sensible investment of retirement savings in the long-term growth of the economy.” A lot of retail brokerage accounts will let you do both. If you are young, carefree and confident, and don’t have very much money, you might gravitate toward the gambling stuff. And then later, as you get more money and responsibility and grow up a bit, you will get more curious about buy-and-hold investing in low-cost index funds.

> And you can do both of those things — and transition between them — in the same brokerage account. This is good! Arguably it is socially useful for brokerage apps be competitive with, say, sports gambling apps, to be as fun and easy-to-use and exciting and risky as sports gambling. Because investing is competing with sports gambling for young, risk-seeking people’s attention. But the brokerage app is better positioned to transition those people into boring responsible investing. There is no analogous transition in sports gambling. Here is a recent paper finding that sports betting “does not displace other gambling or consumption but significantly reduces savings, as risky bets crowd out positive expected value investments.” Zero-day options are, arguably, a bit better than that.

> Again you cannot get too carried away with this theory. Is it socially beneficial to introduce riskier and zanier financial products to retail brokerages? Well, if the zanier products lure customers away from sports betting, and start them on a road to mature sensible investing, then yes. If the zanier products lure customers away from index funds, and start them on a road away from sensible investing, then no. I’m not sure there’s an a priori answer.


I've never thought of this theory. By analogy I suppose it says 'brokerage apps are to sports gambling as vapes are to cigarettes'


I'd still argue it's all gambling, even though there are many safe and boring bets. We can't guarantee Gold won't be obsolete in 40 years or thst we find some insane vein or synthesis process that deflates the value. We can't guarantee we hit some depression right when you want to cash out.

Leaving your money to banks with the hopes you end up on top is pretty much gambling no matter what. Even if it's safer than most traditional gambling.


It does fit the second dictionary definition of gambling: "take risky action in the hope of a desired result". However at that point almost everything you do in life could be called 'gambling' so it kind of loses all meaning. Buying a Big Mac? Gambling that it isn't infected with e coli. And so on.


Sports betting is bad because it is gambling and not productive. Stock trading is good because it supports creating value like new sports gambling companies.


Lets say I gather Diag data, which I conditionally print during testing. Are you saying that I cannot leave the diag code in place after I comment out the print function? Thats unproductive and a major obstacle to using Zig. I’m still pissed at Andrews stance of preventing Tabs, operator overloading, polymorphism, and this just seals my “stay away” stance. I really do want to like Zig, but cannot.


You don't need to comment out the print function - it could gate its behavior on a comptime-known configuration variable. This would allow you to keep your debug variables in place.


BeOS was “pervasively” multithreaded, which in non marketing speak means the kernel did not have a giant lock (since it was designed as a many core system from day #1). Its contemporary OS’s at the time had a giant single lock. BeOS also had 750ms preemption interval (or was it 3ms, I dont remember) while Linux and Windows had 20ms, then later 10ms, so this is what you fealt. A couple of decades later and most OS’s matched the finer locking granuality in kernel space, minus the premption interval (argument being throughput vs latency, since scripted OS benchmarks measure overall throughput, not GUI responsiveness). A perfect example is media buffers that benefit from smaller buffer sizes, at the cost of less throughput. Musicians notice better responsiveness in BeOS, hence the monicker “Media OS”.

Also, in GUI space, the BeOS/Haiku app server still offers a more distributed workload compared to other desktop environments. Every windows is assigned its own thread, the app gets its own thread, and the app and application server have 1 thread per app and window to ensure they are not blocked waiting for slow app message parsing. So minimum BeOS app with graphical “Hello World” window is 4 threads. So even if the app is busy, the rest of the system still feels responsive.

All this comes at a throughput cost, as well as an app development complexity cost, especially for ported apps. Haiku needs to marshall Qt/Gtk/toolkit messages from many windows into a single message queue to prevent multithreaded bugs from popping up (since in their original environment, all app message loopers were not multithreaded). This marshalling needs additional lock/unlock calls in Haiku even when not needed (messages to same window).

Haiku native apps, on the other hand, are smooth as ice. See this screenshot of Medo video editor where all windows are working in their own threads (https://raw.githubusercontent.com/smallstepforman/Medo/refs/...). On modern systems, this app is smooth as ice, which for a video editor is heresy. Disclaimer: I wrote the linked Haiku app.


> BeOS also had 750ms preemption interval (or was it 3ms, I dont remember)

3ms vs almost a second is a pretty big difference...


Some would say that Trump won 3 times


Yes, we know. Those people are wrong, but the mistake of their opponents is thinking that pointing this out is sufficient in the post-Obama era where things are so focused on retaining power. Most Republican politicians and staffers knew Trump lost in 2020 - we have records of them saying so – but they also recognized that he got a LOT of people to vote and gambled that the Democrats got lucky with the freak pandemic and Biden’s somewhat unique combination of being well-known nationally and white men thinking of him as one of their own even if they don’t agree with all of his policies. They adopted the big lie gambling that he’d do it again in 2024, and it worked.


Casino slot machines are highly regulated and certified by accredited agencies. They give accurate results. Vote counting machines, not so much.


Extraordinary claims require if not extraordinary evidence but at least evidence at all.

And please not the dominion claims that even Fox settled out of court on because they knew they were lying.


There have been quite a few demos over the years where voting machines are hacked. Now, this does not mean that they were hacked, for real, in a real election.

It does mean that it is possible to do, and in ways that paper ballots are not.


Busy people have no time to answer polsters. When you heavily critisize one group of supporters (and the social stigma associated with it), dont be suprised that in private they think differently. Finally, intentionally fabricating wrong poll results can psychologically influence weak minded (due to group think and our desire to comply with social norms). So it is immature to accept polls as a real indicator of what people think (especially in controversial political environment).

In reality, a lot more people have traditional values when it comes to race, LGBT whatever, sexism, spiritual values, opinions on Russia, Israel etc. However in public they may be scared to voice their true opinions.


Most polls are conducted via text message now and have fairly robust screening to weed out fake responses.


It clearly shows how bad the D candidate/policy is, such that people prefered the R candidate with all the flaws you listed. The eye opener should be why people rejected the D candidates.


It's not about policy though and it never was. There is no way the Democrats could have "policy-ed" themselves out of this.


I'm inclined to agree with you. At the same time, I don't think Kamala should have spent some of the limited time she had cozying up to people who wouldn't vote for her, antagonizing her base, and for the most part sidelining the people she had to convince.


It’s a white nationalist backlash. They cared not about the messenger; only the message. It’s also the product of Russian disinformation. Russia has perfected the art of sowing division and faux outrage. We’ve done it to other countries so we deserve it in some sense. We’ll see a rise of toxic masculinity. Women exercising sexual autonomy and gaining power is not something snowflake men can handle.

Such is my belief. I could be entirely wrong.


[flagged]


The is right out of Alexander Dugin's playbook.


Russia and China have been waging a cyber war against the U.S. for a long time now. Russian accounts on social media have been effective at sowing dissent, chaos, conspiracy theories, and false information. Tim Pool and others on Russia’s payroll is clear evidence of this.

The lesson of the day is that the U.S. is far more conservative than I thought. Trump is the President we deserve and we deserve what comes next. White rural voters will not be helped by him and I will not shed any tears at their plight.


[flagged]


You should the entirety of what I’ve written.

Russia has perfected the art of sowing division and faux outrage. We’ve done it to other countries so we deserve it in some sense.

It’s possible that Russia is better at some things than the U.S.


It is additionally also possible that a democracy with more or less independent media is much more vulnerable than a dictatorship with state-controlled media. The democracies in the world better wise up quickly and figure out a way to become resilient against this.


Dont you love myopic viewing of history. It was Russian tzar Alexander who liberated Finns from sweden, granted them their own language as official language (as oppised to Swedish), and were the first to grand Finland autonomy and self rule. They even expanded Finnish territory from war reparations with Sweden. After 1917 Finns wanted full autonomy, this was granted but negotiations about territory borders were unresolved. Finns used the turmoil in SSSR in 1917-1923 to get maximalistic gains. The winter war was just restoring borders to fair ethnic borders.


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

Search: