Hacker Newsnew | past | comments | ask | show | jobs | submit | Snarwin's commentslogin

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.


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?


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.


Right, does `sudo` net benefit from removal of heap corruption, out of bounds, or use after free, etc errors that GC + a few other "safeties" might provide? I think so!


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


>1) Em-dashes

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

Proper typography and hamburger paragraphs are canceled now because of AI? So much for what I learned high school english class.

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

This is a pretty weak point because it's n=1 (you can check OP's comment history and it's not repeated there), and that phrase is far more common in regular prose than some of the more egregious ones (eg. "delve").


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.


  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;
      }
  }


Thanks! That indeed does the equivalent as the Zig code... but feels a bit pointless to do that in D, I think?

Could've done this and be as safe, but perhaps it loses the point of the article:

    enum U { A, B, C }

    void handle(U e)
    {
      with (U)
        final switch (e) {
        case A, B:
          handleAB();
          if (e == A) handleA(); else handleB();
          break;
        case C:
          handleC();
          break;
        }
    }


> ChatGPT is succeeding because they created a better search experience

Or perhaps because Google created a worse search experience.


The only thing I find bad about Google search now is their "AI" summary, which is often just wrong. I can deal with ads in the search results, I expect them, and I have no doubt ads will be shown in ChatGPT search results too, because they are bleeding money. And ChatGPT is under no obligation to show you anything with any accuracy, which is what the underlying tech is based on - guessing. Thanks, I'll take my chances with actual search results.


I think AI evangelists avoid talking about search because AI is why every internet search engine sucks. I use DuckDuckGo and Startpage, and when trying to find answers to nontrivial questions I get ONLY AI spam sites as results. (Come up with 1500 semi-specific SEO-friendly articles vaguely relating to subject the theme of website N. Then repeat until N=100

And shortly enough, AI is not even going to help with searching – it will eat its own s*t and offer that as answers. Unless the AI giants find some >99.99% way to filter out their own toxic waste from the training data.


There was a period I remember fondly when the SEO slop was still mostly human generated because AI couldn't quite do it yet, and I was getting much better results from DDG than from Google. Now it's all despair-inducing.


What you're saying is totally correct about AI slop polluting the web, but the reason they don't want to talk about it is because the second they frame "AI" as slightly better search, it invites all sorts of unfavorable financial comparisons. It also deflates the hype because now you're talking about a better version of a thing everyone is familiar with instead of some magical new buzzword like "agent" or "RAG" or whatever we're going to be talking about next year when agents don't work.


That reminds me of this post, here, from a couple of weeks ago[0].

[0] https://news.ycombinator.com/item?id=44615801


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).


And then you add 4th note and you break the accidental 3-note symmetries :)


You can still write the extension in C++ and expose an extern "C" interface.


That's possible, but then the people building your extension need a C++ toolchain.

The question was "please provide examples where switching to C++ involves jumping through even more hoops", and in my view requiring downstream to use a C++ environment when they're expecting to use a C environment qualifies.


True. For me, C++ itself is the maze of hoops I would rather want to avoid.


Most C compilers are C++ toolchain as well, we are no longer in the 1990's.

Unless of course the project is using such a old compiler.


Problems in this domain arise more because you’re wandering off the beaten path for configuration and tooling than because the systems lack absolute capabilities. If you don’t want to build your extension the way that the extension framework expects you, all sorts of annoyances show up. Maintaining an cross-platform compatible C extension is hard enough already.


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...


The wikipedia article matched my vague recollection of the event, but if they got the year wrong then it may as well just be a rumour at this point.


Thanks!


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: