HNHacker News
TopNewBestAskShowJobs

tuetuopay

1,764 karma · joined December 23, 2021

submissionscomments
tuetuopay··on I designed my LED matrix PCB with code
The author aims at developing their own autorouter and has a few blogposts on the topic. I guess the board is autorouted, hence the ugly-looking routing.
tuetuopay··on What I wish I knew about privacy sooner
Indeed: https://www.ludlowinstitute.org/articles/what-i-wish-i-knew-...

I don't know what this insitute is nor its color however.

tuetuopay··on What I wish I knew about privacy sooner
Thanks for the warning!

I find it sad that a whole article can be dismissed due to where it is published. By itself, it is completely fine and blasts already open doors to the HN crowd, but I like its concise wording and how it phrases some points, like the one about GMail.

Though it is quite interesting that such a privacy stance on "I have nothing to hide" comes in an allegedly neo-nazi paper, knowing this is the mindset that led so many people to be tracked by nazis. People knowingly went to nazi census. I find it quite ironic.

EDIT: verbatim copy of https://www.ludlowinstitute.org/articles/what-i-wish-i-knew-.... @dang perhaps?

tuetuopay··on Reworking 30 lines of Linux code could cut power use by up to 30 percent
Yup, you’re right. I always forget this patch only applies to opted-in polling and not automatic polling for interrupt moderation.
tuetuopay··on Reworking 30 lines of Linux code could cut power use by up to 30 percent
Practically none of it would be applicable (if using a commercial router). They all use hardware offloading, and traffic seldom touches the CPU. Only "logical" tasks are raised to the CPU, like ARP resolution and the likes (what’s called "trap to cpu").

If you’re doing custom routing with a NUC or a basic Linux box, however, this would gain massive power savings because that box pretty much only does networking.

tuetuopay··on HDR‑Infused Emoji
oh god. off my evening goes tweaking the multiply value for proper effect.
tuetuopay··on Problems with Go channels (2016)
This article has an eerie feeling now that async rust is production grade and widely used. I do use a lot the basic pattern of `loop { select! { ... } }` that manages its own state.

And compared to the article, there's no dead coroutine, and no shared state managed by the coroutine: seeing the `NewGame` function return a `*Game` to the managed struct, this is an invitation for dumb bugs. This would be downright impossible in Rust, and coerces you in an actual CSP pattern where the interaction with the shared state is only through channels. Add a channel for exit, another for bookeeping, and you're golden.

I often have a feeling that a lot of the complaints are self-inflicted Go problems. The author briefly touches on them with the special snowflakes that are the stdlib's types. Yes, genericity is one point where channels are different, but the syntax is another one. Why on earth is a `chan <- elem` syntax necessary over `chan.Send(elem)`? This would make non-blocking versions trivial to expose and discover for users (hello Rust's `.try_send()` methods).

Oh and related to the first example of "exiting when all players left", we also see the lack of proper API for go channels: you can't query if there still are producers for the channel because gc and pointers and shared channel objetc itself and yadda. Meanwhile in rust, producers are reference-counted and the channel automatically closed when there are no more producers. The native Go channels can't do that (granted, they could, with a wrapper and dedicated sender and receiver types).

tuetuopay··on A year of Rust in ClickHouse
In the context of Tokio, the tokio's native mutexes / locking primitives. For sync code, parking_lot is the de facto replacement for the stdlib's ones.

I don't remember where I read it, but it has been admitted that having synchronization primitives with poisoning in the stdlib was a mistake, and "simpler" ones without it.

for context: a mutex is poisoned should a panic occur while the mutex is held. it is then assumed the guarded data to be broken or in an unknown state, thus poisoned.

tuetuopay··on A year of Rust in ClickHouse
This is factually incorrect. The behavior you describe with Elixir (sic) is precisely what most Rust async runtimes do. (sic because it's Erlang that's to thank)

IMHO that is the sensible thing to do for pretty much any green thread or highly concurrent application. e.g. Golang does the same: panicking will only bring down the goroutine and not the whole process.

tuetuopay··on A year of Rust in ClickHouse
You can install a global panic handler to avoid bringing the whole process down. Instead of aborting, take the stack trace, print it, perhaps raise to sentry, and kill the specific "work unit" that caused it. This "work unit" can be a thread of a task, depending on how the application is architected.

This is precisely what Tokio does: by default, a panic in async code will only bring down the task that panicked instead of the whole application. In the context of a server, where you'll spawn a task for each request, you have no way to bring down the whole application (), only your current scope.

(): there could be other issues, like mutex poisoning, which is why nobody uses the stdlib's mutexes. But the general point still stands.

tuetuopay··on Writing C for Curl
Everything is a balance. IMHO, the "identifiers should be short" "functions should be short" and such are knee-jerk reactions to overly long things that are common in some other languages (looking at you, Java). Like the practice of indicating the type, pointer, etc. Stuff ike `pWcharInputBuffer` and such.

There is a balance between `*p` and `inputPointerToMiddleOfBufferThatFrobnicates`.

tuetuopay··on France rejects backdoor mandate
Since when the general population are the decision makers? /s

Well, half /s anyways. Working class don't want them because "they're taking our jobs". Middle class don't want them because "blah blah security". Upper class want them because that's cheap labour. And as it happens, the upper class is the class in power.

Most french don't care. But this still creates tensions, even between immigrants, say for like housing. As we say in french, it's a "bourbier".

In the end, it's the same situation as in any other country where immigration has taken over the frontline of the political debate.

tuetuopay··on France rejects backdoor mandate
The article clearly states that it was pushed by the Interior Ministry. Those in there know exactly what they are doing.

On the other hand, the interior minister himself has no clue, as well as all the politicians in the assemblée. This is where the double-bluff is from. (granted, I think Darmanain was an exception)

We have to remember that, while the minister changes with the government and thus is by definition a politician (seriously, look at some of our ministries, they go from education to health taking a trip by ecology with a pit stop in finance), the ministries themselves are made of people that mostly stay in place and are not affected by government changes. Those are the ones making the calls. And those precisely know what they're doing (thing DGSI and DGSE).

tuetuopay··on Go European: Discover European products and services
Well, it's not really to have a clear enemy. It's an effort to avoid having one.

The day the US drops the Cloud Act would be the death of all European CSPs. Until then, cloud offerings not subject to it will thrive, and the US will be seen as hostile.

And for all other subjects, it's a simple matter of not putting all of your eggs in the same basket. Having privileged trade partners is a good thing, but it becomes a bad one when it's a partner (singular). Today, the US has full power on Europe's tech landscape, which is concerning, even if it's a friend country.

Oh, and I say a "friend country", but given the latest announcements where the US Govt. clearly targets Europe and wants to sanction it (e.g. tariffs on French exports), the friend is turning around.

TL;DR today Europe does not see the US as an enemy. But it does everything for it to never happen, and this include reducing the dependency on the US.

tuetuopay··on Go European: Discover European products and services
And yet the website is hosted on AWS :')

Quite telling, this would be an ideal case for Scaleway/OVH/anyone else.

tuetuopay··on Linus on Rust and the Kernel DMA Layer
Well, yes, but this only matters if you distribute the compiled probes: you'll have to distribute the source for the probes. And, thankfully, this is not AGPL where network interaction counts, so:

- a cloud provider writing a dataplane using ebpf does not have to provide the source - a company selling on-prem software (e.g. esxi) that ships with ebpf probes would need to distribute their source

(note: IANAL)

tuetuopay··on Linus on Rust and the Kernel DMA Layer
In the specific case where I'm using Rust, unsafe is definitely better. I mostly write eBPF XDP programs for where I write unsafe code.

So yes I agree that I don't get safety benefits. However, it does not mean I don't get increased reliability from it. Just type safety allows APIs to be expressed in ways you cannot hold them wrong. Heck, just getting a Result<u32, u32> instead of a i64 for faillible operations is a godsend.

In the end, this is why I'm a big proponent of Rust for many areas of programming, including areas where memory safety is the least of your concerns. My gRPC APIs are written in Rust, my system daemons are written in Rust, my eBPF probes are written in Rust. Rust is a modern language whose design is deliberate on many levels to address common issues in programming. If you'd ask me, Rust's "marketing" putting memory safety first is quite a disservice as there are many areas where it helps writing correct programs.

Greg KH noted this in his email in another branch of the thread, and I wholeheartedly agree with him.

tuetuopay··on Linus on Rust and the Kernel DMA Layer
Sure! I use the aya framework (https://aya-rs.dev) that provides the kernel-side bindings to write the probes in Rust, and the userspace tooling to load it in the kernel, interacts with maps, etc. Quite a joy to work with, and has all the niceties you'd expect from using Rust.

We write XDP apps for custom dataplanes where traditionally DPDK would be used (routers and such). Our upcoming network acls are written this way, so close to your netfilter usage.

tuetuopay··on Linus on Rust and the Kernel DMA Layer
In the end, for kernel users, yes. However, what he did is much larger IMHO: he addressed the utter blockade performed by the maintainer, that basically said no without any margin of negotiation.

In the end, he explicited that not wanting to touch Rust goes both ways: you don't want to touch Rust? Fine. But you lose all rights to complain about what others are doing with Rust.

In other words: don't be a jerk, and don't have selective involvement.

tuetuopay··on Linus on Rust and the Kernel DMA Layer
Even unsafe rust is safer than C. Error management, type safety, modern language, etc. There are many reasons to use Rust in place of C, even if your whole code is one giant unsafe blob.

I run eBPF code written in Rust in production, and oh boy how more readable it is compared to C. Even simple stuff like `if let Some`, actual sum types, generics, are enough to warrant using Rust over C. And its endtrypoint is basically unsafe { ... }.

tuetuopay··on How does Ada's memory safety compare against Rust?
I've written Rust professionally for the past 6 years, and pretty much exclusively for stuff where memory safety is the least of my concerns (even speed!). I've made gRPC APIs, agents running on machines to setup configuration and such. The usual suspects for this work would usually be Python or Go.

You've pretty much summed up why I'm standing behind Rust for non-memory-critical applications: tooling, error messages, and the type system. For business logic, you cannot beat all that, as a lot of business errors can be avoided using those (all praise the Rust enums!). Also, you've summarized my feeling about the functional world embraced by rust: it provides quite a bit, without requiring a Haskell PhD to write it. Seriously, iterators and the associated trait are a godsend (even though having to always write .iter()....collect() is sometimes clunky).

As for the GC. I've yet to come to situations where the lack of GC was the real hindrance. It has more to do with futures adding not easy to grasp lifetime bounds to data, but one quickly learns to embrace it by moving data when needed. Combined with channels and Arc, there are many escape hatches making in my opinion the GC a non-issue.

IMHO, making GC-less languages acceptable again is a good thing, because it keeps diversity in the ecosystem and gives options. It also shows that doing without GC does not relegates written code to manual memory management like C/C++. In fact, Swift does the same and is pretty good at being a GC-less language. Both Rust and Swift are languages where memory management is opinionated by embedding it in the language, and thus ergonomic. Frankly, I rarely think about "oh hey, I wished I had a GC".

tuetuopay··on Seagate: 'new' hard drives used for tens of thousands of hours
how are they "more trustworthy"? after all, it's data on a flash on the drive board.

is it lack of tooling, as demonstrated by needing the last smartmontools version to even read them, or some protection in the firmware to prevent resetting them (hey, no legit business resetting the power-on hours to zero...).

I checked the recertified ironwolf 12TB drives I bought, and both SMART and FARM report times in line with when I installed them in my nas. Of course, since they're recertified by seagate themselves, they may very well have a backdoor to reset FARM.

tuetuopay··on Invisible Electrostatic Wall at 3M plant (1996)
I'd say styropyro. He'd be up for it. The issue is, 3M or similar would never let him approach one of their plants :D
tuetuopay··on Invisible Electrostatic Wall at 3M plant (1996)
neither. even a shortcut saying like "total energy delivered" is not accurate, because it depends on how it is delivered and how it dissipates.

styropyro made a fascinating (if terrifying) video about it

tuetuopay··on Magic/tragic email links: don't make them the only option
This is even worse for copying the link. On iOS the contextual menu comes with the preview, which will destroy the magic link.
tuetuopay··on The GPU, not the TPM, is the root of hardware DRM
With the proper MMU settings, yes, the CPU can definitely be denied access to some memory area. This is why devices like the raspberry pi have that weird boot process (the GPU boots up, then brings up the CPU), it's a direct consequence from the SoC's set-top-box lineage.
tuetuopay··on The history of twisted-pair Ethernet [video]
Signal integrity basically. Using more pairs means reducing the bandwidth needed on each pair, thus the cost of the cable.
tuetuopay··on Go Protobuf: The New Opaque API
I can’t wait to try this new Protobuf Enterprise Edition, with its sea of getters and setters ad nauseam. /s

However I can get behind it for the lazy decoding which seems nice, though I doubt its actual usefulness for serious software (tm). As someone else already mentioned, an actual serious api (tm) will have business-scope types to uncouple the api definition from the implementation. And that’s how you keep sane as soon as you have to support multiple versions of the api.

Also, a lot of the benefits mentioned for footgun reductions smell like workarounds for the language shortcomings. Memory address comparisons, accidental pointer sharing and mutability, enums, optional handling, etc are already solved problems and where something like rust shines. (Disclaimer: I run several grpc apis written in rust in prod)

tuetuopay··on The 70% problem: Hard truths about AI-assisted coding
For the same reason people use AI for some coding tasks: it generates boilerplate without needing to be programmed by an human. SWIG needs to be adapted to every language, and only targets C libraries. What about Rust, like in this case?

This is a case where LLMs can be good, because they can infer quite a bit about the needed scaffolding, and can generate bindings between languages where no such tool exist. We don't need to write a tool for every combination of languages (or adapt one like SWIG to add a language).

But in the long run, depending on how many bindings we need, the cost of each binding may end up outweighing the upfront cost of a human writing the tool.

tuetuopay··on The 70% problem: Hard truths about AI-assisted coding
Well this is a good experiment. I don't find your idea bad at all: use AI to autogenerate bindings to expose a library in another language. This would be a good usecase for AI as it's not complex (well, most of the times) and is a lot of boilerplate.

Publishing the repo is worth it, because it showcases what the AI can (and cannot) do, and it is not there yet. But as a real package to pypy, indeed less.

← PreviousPage 10 of 20Next →