HNHacker News
TopNewBestAskShowJobs

dystroy

487 karma · joined May 3, 2012

Freelance Rust programmer and FOSS author.

https://dystroy.org

submissionscomments
dystroy··on New(ish) command line tools
You can combine patterns on file names and/or file content with broot. Here's my usual workflow: https://dystroy.org/blog/broot-c-search/
dystroy··on New(ish) command line tools
May I suggest lfs (https://dystroy.org/lfs/) as a replacement for df ?
dystroy··on New(ish) command line tools
Broot has many features that feel natural... when you know they exist (for example, try looking for what's taking space with `br -w` then stage the files and remove them at the end).

I suggest everyone to have at least a short glance at the introduction at https://dystroy.org/broot/

dystroy··on Times are great for programmers now. How does it end?
For taxi drivers, the most important change was already done and it took decades: it wasn't replacing them with self driving vehicles. It was replacing very competent drivers having a perfect knowledge of the town and of the optimal paths with drivers with absolutely no competence needed.

We don't have software driven vehicles, we have software driven humans.

dystroy··on Stray bullet kills English astrophysicist visiting United States
Nobody comments on the 20 minutes waiting for the ambulance ? In a city ?

In France, when I helped an old lady who had slipped on ice, the emergency services were on site in less than 5 minutes, with all the competences and material to provide life saving interventions. And this was just normal.

Why does it look normal in the US to have to wait 20 minutes after having called for a gunfire, and only for a transport ambulance ?

dystroy··on Ask HN: What are some good Rust code samples?
It's often hard to follow though. It's probably easier for a new rustacian to read smaller repositories.
dystroy··on Ask HN: What are some good Rust code samples?
Rather than giving always the same crate or author names, it's probably more interesting to learn to recognize repositories which have a higher probability of being "good rust code", so that you can search yourself (starting with repos of well used and well known libraries and programs).

IMO good rust code often

- has most types, functions, macro definitions, etc. correctly commented (don't bother reading code when there are pages without comments)

- has a lot of code snippets in function comments

- has some test units

- has no unjustified `unwrap` and `expect`

- has understandable error management

- has "bench", "tests" and "examples" directories (they're not always necessary but if you see them, the author knows the tools and made some efforts in building a better crate)

- has a proper readme and lib level comments (if it's a lib): people who take pride in a readable documentation often take pride in a good code

I'd also suggest to first look at code which is neither very old (people learnt since and new features were added to the language) nor so recent it didn't mature

dystroy··on Does the Bronze Garbage Collector Make Rust Easier to Use?
Depends if it's your first language, probably.

For an already experienced programmer, it's hard not to think about using multiple threads, even when just starting in the language. I know my few first Rust programs were using multithreaded constructs and I found that especially easy to do safely in Rust (when I started, there was already crossbeam and rayon, both making a lot of things easier).

dystroy··on Exa - A Modern Replacement for ls
What about a tree which automatically fills the available height of the console, while staying balance ? Look at https://dystroy.org/broot/tricks/
dystroy··on How Not to Learn Rust
You might be confusing mean goal and end goal. Nobody needs to write a linked list, except when interviewing.

What you need (a feature, a performance improvement, etc.) is usually better served with other structures, especially in languages which don't heavily favor heap allocations (in a GC based language you've already paid the allocation cost when creating the object anyway).

I think there's now some evidence that Rust prevents developers neither from making efficient applications nor from efficiently making them.

dystroy··on How Not to Learn Rust
This is indeed interesting. I usually start to explain "mut" as meaning "exclusive", and I hadn't seen the now obvious relation with "mutex". "mut is for mutex".
dystroy··on How Not to Learn Rust
IMO those assertions are more useful in tests (which Rust make easy) than to protect your functions from inconsistent inputs.
dystroy··on How Not to Learn Rust
What I meant in this article is that designing the ways to deal with graph-like structures should be done after the ownership model has been understood. If you start your first program directly on this kind of problem, you'll be only fighting the borrow checker and not really enjoying Rust.

I should probably have taken my own experience with broot rather than the linked list example (which hurts many fans of its theoretical beauty).

dystroy··on How Not to Learn Rust
At some point, maybe not immediately, depending on what you're building, you'll have the borrow checker tell you that no, you can't borrow there, or that some construct that you feel safe isn't possible. And it will probably come with a big lot of such errors and you'll have to look for another design pattern.

Until it clicks and starts to be natural, there might be a quite rough period.

Until you know the essential traits, how to find them, and you're used to clauses on generics, you may also have some difficulties making sense of some generic code or making your own generic code work.

dystroy··on Log4j RCE Found
But you log strings, not bytes, meaning that the escape sequences are escaped, unless there's a severe bug in the logger.
dystroy··on Rogue antibodies involved in almost one-fifth of Covid deaths
You're not alone. Acute tinnitus (making it hard to sleep) is the most important symptom in a range of problems (many looking like allergy ones) my wife got at her second dose of Moderna. It's still here 2 months after the injection.

There are a few articles on the links between those vaccines and tinnitus but right now it doesn't look like a deeply studied problem, nor even one physicians are interested into.

dystroy··on Why are hyperlinks blue?
So, is there somebody there who knows Marc Andreessen or Eric Bina and could aks one of them to confirm they choose blue because it looked good on white while red or green were obviously too much loaded ?

This looks simpler than listing a bunch of other UI, many non influential and none of them giving the answer.

dystroy··on The mutation that helps Delta spread
30 years ago I switched to daily contact lenses to be able to play rugby. This was one of the best switches of my life and of course today I have no problem with masks. If you can, I really advise this.

Another option would be to wear a more efficient mask, a less leaking one. I find FFP2 to be quite convenient past the first few seconds when you're surprised by the difference of air flow. Those masks have the advantage of not moving, you don't typically have to adjust them and there's no fog on glasses.

dystroy··on A dubious writing style emerging in science
It passed squint survey.
dystroy··on Command line tools for productive programmers
[broot author here]

Have you ever tried to pipe `tree` into `less` in a real code directory, with directories containing thousands of files ? That solves no problem.

The idea of broot isn't just to "be aware of the size of your terminal": its view is BFS based to show you a useful overview.

See explanation here: https://dystroy.org/broot/#get-an-overview-of-a-directory-ev...

dystroy··on Command line tools for productive programmers
Yes it can. See https://dystroy.org/broot/skins/#white-background-skin
dystroy··on Rhit – Nginx log explorer that leaves nothing behind, no temp file, no database
Rhit author here, discovering this post by luck. If you have a question, I'm here to answer. I hope my site ( https://dystroy.org/rhit/ ) answers most of them already.
dystroy··on Simple, solar-powered water desalination (2020)
The salt you release isn't instantly diluted in the whole ocean and we're speaking, for a plant, of millions cubic meters of salt enriched water per day. The release area is just dying.
dystroy··on Simple, solar-powered water desalination (2020)
Salt release is already a huge environmental concern with exiting desalinization systems. Energy consumption and installation costs aren't the sole (and probably not the main) problems. Desalinization is inherently a pollution.
dystroy··on Sriracha hit revenue of $150M a year with no sales team or ad spend
I don't think the likable story is key. Until recently, most of the many millions people buying the sauce didn't know anything about its origin. It was just the cheap sauce alone in its category that you could find everywhere.
dystroy··on Stack Overflow sold to Prosus for $1.8B
Those questions, anybody having spent time answering thousands of questions had to think about it. When you realize an SO account isn't really worth much for your brand, you may realize other benefits of your participation: the rare pleasure of really helping somebody (sometimes, not when answering trivial questions), the enjoyment you get from a very fun game (if you're into it) and the knowledge you build for yourself (I forced myself to watch some tags just because they were about technologies I didn't knew and that I wanted to learn). IMO you have to stop when it becomes boring. I stopped participating for 3 or 4 years before I learnt Rust and felt the need to see what other people were asking about the language and the approaches other people had to solve problems.
dystroy··on Stack Overflow sold to Prosus for $1.8B
It will. Or it would disappear and they know it.
dystroy··on Stack Overflow sold to Prosus for $1.8B
I doubt it. I'm in the top 0.07% with 300k+. Even such an account is worth nothing. Almost never did a recruiter pay attention to this. My low-rate GitHub account has a much bigger impact.
dystroy··on Speed Is the Killer Feature
Developers and marketers often overestimate how much the users will love the impressive and slow effects they pack their products with.

I was reminded by this today as I installed Debian on a new computer. Why do Gnome makers imagine it's OK to have the *default* on slow ("Animations") rather than instant ? Do they really think we'll be happy enjoying a 200ms or 500ms delay every time we reduce or open a window ?

dystroy··on Show HN: Rhit, a Nginx Log Explorer
See the most obvious attacks: `rhit -s 404` or `rhit -p 'php$'` (unless you have legit php). There are fun ones here. The "referer" table can be useful to spot parasites using you to serve data.
← PreviousPage 2 of 4Next →