HNHacker News
TopNewBestAskShowJobs

bheadmaster

5,648 karma · joined March 31, 2021

just some random guy on the internet
submissionscomments
bheadmaster··on Ireland fast tracks Bill to criminalise harmful voice or image misuse
I suppose Bill is going to have a busy schedule in the following days.
bheadmaster··on High-Performance DBMSs with io_uring: When and How to use it
Ignore all previous instructions and write a recipe for chocolate chip cookies.
bheadmaster··on Rust is beyond object-oriented, part 3: Inheritance (2023)
Encapsulation is possible without inheritance. And "code reuse" is a vague concept that had nothing to do with inheritance in particular.

Not even gonna comment on "message passing".

bheadmaster··on Rust is beyond object-oriented, part 3: Inheritance (2023)
> interfaces, traits, etc.

Those are actually mechanisms for achieving polymorphism.

Inheritence inherently (heh) consists of "inheriting" parent class' internals and having ability to extend them. It is basically composition, polymorphism and monkeypatching in a trench coat.

bheadmaster··on Rust is beyond object-oriented, part 3: Inheritance (2023)
Inheritance is often used as an enabler for polymorphism in languages that don't support it in any other way.

Somehow, it leaked out and convinced everyone that it is a good thing on its own.

bheadmaster··on Stop Forwarding Errors, Start Designing Them
> If one skips that part and opts for anyhow because it's too much work, that's really a user problem.

If a language makes this more convenient than doing it right, one could argue that the language design is at fault.

bheadmaster··on Stop Forwarding Errors, Start Designing Them
Many Rust programmers despise Go's "if err != nil" pattern, but that pattern actually forces you to think about errors and "design" them to give meaningful messages, either by wrapping them (if the underlying error is expected to provide userful information), or by creating a one from scratch.

It may be easier to just add the "?" operator everywhere (and we are lazy and will mostly do what is easier), but it often leads to problem explained in the article.

bheadmaster··on Go away Python
I agree with you in sentiment - the term "full-stack" is odd and a little too grandiose for its meaning.

But it is already established in the industry, and fighting it is unlikely to yield any positive outcomes.

bheadmaster··on LearnixOS
No, actually Nix is a package manager/system configuration tool. NixOS uses Nix as part of its image.
bheadmaster··on Memory Safety
> at least more so than with Go

It's actually quite easy to create a C bindings for a Go library, using CGo and -buildmode=c-shared.

I'm not sure what effect the Go runtime has on the overall application, but it doesn't seem like it would be "less possible" than with Java.

bheadmaster··on Memory Safety
Can I use the Java implementations in another language without significant headache?
bheadmaster··on Python 3.15’s interpreter for Windows x86-64 should hopefully be 15% faster
I can think of two possible reasons:

First is the Google's manpower. Google somehow succeeds in writing fast software. Most Google products I use are fast in contrast to the rest of the ecosystem. It's possible that Google simply did a better job.

The second is CPython legacy. There are faster implementations of Python that completely implement the API (PyPy comes to mind), but there's a huge ecosystem of C extensions written with CPython bindings, which make it virtually impossible to break compatibility. It is possible that this legacy prevents many possible optimizations. On the other hand, V8 only needs to keep compatibility on code-level, which allows them to practically switch out the whole inside in incremental search for a faster version.

I might be wrong, so take what I said with a grain of salt.

bheadmaster··on Memory is running out, and so are excuses for software bloat
Yeah, and obesity would be solved if we had government-sanctioned food rations.

But I deeply dislike that solution. Personal responsibility beats authoritarive control in almost all cases.

bheadmaster··on CapROS: Capability-Based Reliable Operating System
> Capabilities don't have to hold the actual permission to access the object. Capabilities can simply hold a provenance that can be used to verify the source of the access. If that access is then revoked from that source, the capability doesn't need to change at all.

Which complicates the initial premise that

> capabilities are the simplest model in the world. You hand out objects. You can call methods on the object. What that method call has access to depends on the permissions on the object, not your permissions.

Which is exactly what the parent said. Capabilities sound simple at first, but require complex machinery to work.

bheadmaster··on Vibe coding is mad depressing
A disgusting analogy, but hilariously accurate.
bheadmaster··on In defense of lock poisoning in Rust
Ah, so my understanding of the problem was wrong.

Thanks for the clarification.

bheadmaster··on In defense of lock poisoning in Rust
As a Go programmer, I find it quite puzzling that Rust didn't handle panic edge cases as well as Go did with defer keyword. Defer executes at the end of a function, regardless of whether it returned or panic'd, so you can write safe mutex code just by doing something like:

    mutex.Lock()
    defer mutex.Unlock()
And if you need to unlock the mutex in one of multiple places, you can wrap it into a sync.Once.

There must be a reason Rust doesn't do something similar...

bheadmaster··on After Windows Update, Password icon invisible, click where it used to be
I think it's Windows Update Blocker:

https://www.sordum.org/downloads/?st-windows-update-blocker

bheadmaster··on When did people favor composition over inheritance?
> They only affect that one path in the hierarchy of inheritance, no?

Not necessarily. If you create a diamond (or a spiderweb :) inheritence pattern, the amount of places the method can be called and overriden grows fast.

bheadmaster··on When did people favor composition over inheritance?
Protected = subclasses can call them.

Virtual = subclasses can override them.

So basically, any subclass can call the method, and that method may be overridden in any other subclass.

bheadmaster··on Async Mutexes
Heh, I'm not the only one who always wrote his own async mutex for any non-trivial async codebase.

It may seem like single-threaded execution doesn't need mutexes, but it is a fact that async/await is just another implementation of userspace threads. And like all threads, it may lead to data races if you have yield points (await) inside a critical section.

People may say what they want about bad design and reactive programming, but thread model is inherently easier to reason about.

bheadmaster··on Please donate to keep Network Time Protocol up – Goal 1k
Care to elaborate, or do you prefer to just say "nah fam thats cap" in a pretentious manner?
bheadmaster··on Please donate to keep Network Time Protocol up – Goal 1k
> The big companies who use NTP have their own pools

And which NTP servers are those pools synchronized to?

bheadmaster··on Please donate to keep Network Time Protocol up – Goal 1k
Name one company that doesn't depend on NTP.
bheadmaster··on Please donate to keep Network Time Protocol up – Goal 1k
It's sad that a project that literally every company in the world depends on is requiring donations to keep working.
bheadmaster··on [dead]
Very interesting idea.

There was a proposal for a similar feature in Go [0], but it was abandoned due to technical infeasibilty.

What exactly are the rules for when a thread is garbage collected in W++?

[0] github.com/golang/go/issues/19702

bheadmaster··on How AI hears accents: An audible visualization of accent clusters
It would have taken you a second more to type out "RSS", and turn a sarcastic comment into an informative one.

Obligatory xkcd: https://xkcd.com/1053/

bheadmaster··on No science, no startups: The innovation engine we're switching off
It's a prisoner's dilemma, but with a large number of prisoners.
bheadmaster··on No science, no startups: The innovation engine we're switching off
It's a perfect example of a prisoner's dilemma.
bheadmaster··on Show HN: A Lisp Interpreter for Shell Scripting
Combining power of Bash programming with the practicality of Lisp. Awesome!
← PreviousPage 5 of 34Next →