Recent submissions

Comment · 1 month ago
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.
Comment · 1 month ago
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.

Comment · 1 month ago
> 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.

Comment · 10 months ago
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.

Comment · 10 months ago
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?
Comment · 11 months ago
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.
Comment · 1 year ago
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

Comment · 1 year ago
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.
Comment · 1 year ago

  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;
      }
  }
Comment · 1 year ago
> ChatGPT is succeeding because they created a better search experience

Or perhaps because Google created a worse search experience.

Comment · 1 year ago
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).
Comment · 1 year ago
You can still write the extension in C++ and expose an extern "C" interface.
Comment · 2 years ago
Comment · 2 years ago
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.
Comment · 3 years ago
Interestingly, C already does this for function calls: "fptr()" is considered equivalent to "(*fptr)()".

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton