News for hackers. Stuff that matters.

Snarwin

Re:"They had no concept of a duty of care to their users." on Sunday September 27, 2026 @11:30AM (#49867540)
Sure. And likewise, users who care about backwards compatibility have no duty to do anything for the Neovim developers--they can simply use a different editor that suits their preferences.
Re:Simple Is Not Small on Monday September 07, 2026 @05:58PM (#49603410)
That's not what the linked article is saying. The point made in the article is that the 'uniq' utility couples together two unrelated concepts--sorting and frequency counting--and this coupling forces you to write more complex code, compared to the version where frequency counting is decoupled from sorting.

All of this is completely correct, but it has nothing to do with bash vs. Clojure. The same decoupling can easily be achieved in either language.

Re:Simple Is Not Small on Monday September 07, 2026 @12:46PM (#49600296)
> There's no native Unix equivalent to frequencies, this sort | uniq -c is the closest we can get. Not only is it less performant (it has to collect the full input into memory before continuing), but it ties aggregation to ordering.

One of the core features of the Unix command-line is that it is user-extensible. If there's no "native" command equivalent to frequencies, you can write your own, and it will be given the same first-class treatment as any other binary in your PATH. This is entirely in keeping with the Unix philosophy of simple implementations.

Re:C++ says "We have try at home." on Sunday December 28, 2025 @05:51PM (#46415334)
The oldest defer-like feature I can find reference to is the ON_BLOCK_EXIT macro from this article in the December 2000 issue of the C/C++ Users Journal:

https://jacobfilipp.com/DrDobbs/articles/CUJ/2000/cexp1812/a...

A similar macro later (2006) made its way into Boost as BOOST_SCOPE_EXIT:

https://www.boost.org/doc/libs/latest/libs/scope_exit/doc/ht...

I can't say for sure whether Go's creators took inspiration from these, but it wouldn't be surprising if they did.

Re:Is Mozilla trying hard to kill itself? on Wednesday December 17, 2025 @08:07AM (#46301538)
I thought the "free" in "free web" was supposed to mean "free as in freedom," not "free as in beer." Have we really reached the point where the CEO of Mozilla no longer understands or cares about that distinction?
Re:Giving C a Superpower on Monday November 17, 2025 @09:35AM (#45953930)
There's plenty of application-level C and C++ code out there that isn't performance-critical, and would benefit from the safety a garbage collector provides.
Re:Buy a Faster CPU on Sunday August 24, 2025 @11:03AM (#45004755)
Several things:

1) Em-dashes

2) "It's not X, it's Y" sentence structure

3) Comma-separated list that's exactly 3 items long

It's possible that without the medication, you wouldn't have gotten burned out like this. But it's also possible that you'd have missed out on all of the benefits of being medicated and still gotten burned out anyway.
Re:Partially Matching Zig Enums on Saturday August 09, 2025 @11:59AM (#44847544)

  import std.meta: AliasSeq;

  enum E { a, b, c }

  void handle(E e)
  {
      // Need label to break out of 'static foreach'
      Lswitch: final switch (e)
      {
          static foreach (ab; AliasSeq!(E.a, E.b))
          {
              case ab:
                  handleAB();
                  // No comptime switch in D
                  static if (ab == E.a)
                      handleA();
                  else static if (ab == E.b)
                      handleB();
                  else
                      static assert(false, "unreachable");
                  break Lswitch;
          }
          case E.c:
              handleC();
              break;
      }
  }
Re:The hype is the product on Wednesday July 30, 2025 @03:32PM (#44738578)
> ChatGPT is succeeding because they created a better search experience

Or perhaps because Google created a worse search experience.

Re:Piano Keys on Saturday July 19, 2025 @07:34PM (#44620488)
It's not actually that much to remember. There are 3 shapes that cover most of the major chords, and 3 special cases (F♯, B♭, and B).
Re:I write type-safe generic data structures in C on Monday June 30, 2025 @04:02PM (#44427242)
You can still write the extension in C++ and expose an extern "C" interface.
Re:4B If Statements on Thursday December 28, 2023 @07:46AM (#38792923)
It looks like bans for odd/even license plates were used in Paris in 2014 [1] and 1997 [2], but not before then. However, a similar scheme was used to ration gasoline in the US during the 70s [3].

The only source I can find for the claim about police confusion is the one cited by Wikipedia [4], whose reliability I'm inclined to doubt based on the 1997/1977 discrepancy.

[1] https://www.npr.org/sections/thetwo-way/2014/03/17/290849704...

[2] https://www.wired.com/1997/09/paris-smog/

[3] https://www.npr.org/sections/pictureshow/2012/11/10/16479229...

[4] https://en.m.wikipedia.org/wiki/Odd%E2%80%93even_rationing#D...

Re:Git Branches: Intuition and Reality on Thursday November 23, 2023 @11:08AM (#38394272)
It looks like this is what git merge-base --fork-point is supposed to do, although according to the docs it is not 100% reliable.
Interestingly, C already does this for function calls: "fptr()" is considered equivalent to "(*fptr)()".
Re:NFS > FUSE: Why We Built Our Own NFS Server in Rust on Tuesday September 19, 2023 @03:46PM (#37575420)
Page is completely unreadable in Firefox for Android.
I'd say C is actually a pretty good choice for an educational project like this. Having to write out all of your data structures by hand and manage your memory manually is a good learning experience, and since you're not writing serious production code, you don't have to worry too much about making mistakes.
Re:Cory Doctorow's new book on beating big tech at its own game on Wednesday August 02, 2023 @08:42PM (#36979885)
I don't think these authors intend for you to interpret their criticism of Audible's business practices as a statement about your moral character. One of their central points is that Audible's business practices have severely limited consumer choice in the audiobook market. You can't be held morally responsible for a choice that's been taken out of your hands.
Most likely the intended audience is the press. Now that this letter has been published, journalists can write stories like "Online Safety Bill Under Fire From Security Experts", which make the issue digestible to a lay audience.
Re:Finding the best sine function for Nintendo 64 on Wednesday June 28, 2023 @08:16AM (#36505313)
> Case in point at 9:30[0] he talks about localised memory patterns as though he's the first to come up with it

This seems like an uncharitable interpretation to me. When he says "I'm not sure if anyone else has ever used this approach," it's pretty clear from context that the "approach" he's referring to is interleaving the sine and cosine tables to improve cache usage. And he doesn't even claim to be the first to come up with it, just to have independently discovered it.

Re:The GTK+3 port of GIMP is officially finished on Wednesday April 19, 2023 @08:28PM (#35634966)
First result on DDG is a Wikipedia article that says

> The term was coined in 1998 by Vincent Flanders, author of the book and accompanying website Web Pages That Suck.

Re:Shells Are Two Things on Thursday February 09, 2023 @01:28AM (#34720413)
A number of command-line programs are actually just wrappers around a more strongly-typed library API. For example, curl and libcurl, or ffmpeg and a whole collection of audio/video libraries. [1]

Of course, in the POSIX world, "library API" means "C API", so if you want to write nice-looking Python code like in the article, there is still some more work to do.

[1] https://trac.ffmpeg.org/wiki/Using%20libav*

Maybe "decode"? As in "decode a Unicode string", or "decode a JPEG image", or "decode an MP3 audio file."
Re:In praise of MIDI, tech’s hidden gift to humanity on Tuesday December 20, 2022 @09:07PM (#34075840)
MuseScore doesn't use MIDI to store sheet music; it only uses it for playback.
Re:Guido was right, there should be no lambda in Python (2018) on Tuesday September 27, 2022 @08:03PM (#33002759)
And the use of the LAMBDA keyword goes all the way back to John McCarthy's original paper on Lisp from 1960:

https://archive.org/details/recursive-functions-symbolic-exp...

Re:Show HN: Vim Tutorial as RPG on Friday September 23, 2022 @10:09AM (#32952147)
If you want to play an RPG that will get you used to moving around with hjkl, you can also try a traditional roguelike like nethack [1] or dcss [2].

[1] https://www.nethack.org/ [2] https://crawl.develz.org/

IANAL but it looks like the default is 30 days:

https://www.law.cornell.edu/rules/frcp/rule_34

Re:Teaching C (2016) on Sunday September 11, 2022 @02:59PM (#32802281)
Someone has uploaded a PDF to github, here:

https://github.com/VernonGrant/gnu-c-language-manual

Re:Using unwrap() in Rust is okay on Monday August 08, 2022 @06:25PM (#32391896)
The problem with this approach is that, when a panic actually happens at runtime, there is no way to tell whether it was caused by an isolated mistake like forgetting to check for zero, or by memory corruption writing garbage all over your data structures. If it's the first, recovering is fine; if it's the second, you risk exposing the user to data loss and security vulnerabilities. So the only safe thing to do is crash.

Now, it may be true that you get better reviews selling software that corrupts data or gets its users hacked than selling software that crashes. But unless you hate your users, those are probably things you want to avoid.

Re:How safe is Zig? on Thursday June 23, 2022 @02:09PM (#31852985)
Here's a version with D included:

https://gist.github.com/pbackus/0e9c9d0c83cd7d3a46365c054129...

The only difference in BetterC is that you lose access to the GC, so you have to use RC if you want safe heap allocation.

Older »