Recent submissions

Comment · 3 months ago
> even GC isn't necessary

Um, isn't it? Don't all Lisp variants have it? IIRC McCarthy's LISP just ran out of memory until the GC was written.

Comment · 1 year ago
> steps the RNC didn't even take, in this case.

What steps are you referencing? I don't get your comment.

Also, the DNC and RNC just choose people and fundraise. It's strange to me how people refer to the parties like this.

Comment · 1 year ago
> I'm really not sure why Democrats don't just let Trump shoot himself in the foot.

That had been their strategy, to just let Trump do things and become unpopular without drawing attention to themselves, but while Trump and Republicans have become less popular, Democrats' approval ratings have been sliding down as well (although they have a lead in the generic ballot) and polling indicates most Democratic voters think they're not doing enough to stop Trump. So, making a big show of "playing dirty" (threatening to gerrymander back in retaliation), and publicly saying that they'll no longer tie their hands behind their back, probably brings satisfaction to those people they're polling badly with. It's the kind of sentiment I've heard for years from online Democratic voters, and from people I know, but never was validated by the actual Democrats until now.

Comment · 1 year ago
Comment · 1 year ago
Funnily enough, this has resulted in people saying things like "見てみましょう" and "見てみてください", which confused me at first. But I suppose this is like non-native English speakers being confused by the extra "do" in phrases like "I already did do my work."
Comment · 1 year ago
Yeah, firing the labor statistics head because Trump say she's been faking the numbers to make him look bad actually makes it seem both obviously politically motivated and casts whatever comes after into doubt. Now their credibility is degraded.

That's different from just saying the numbers are obviously being faked under Biden or whatever with no real evidence because you just feel like the economy is bad and assume corruption. Now there actually does seem to be corruption!

Comment · 1 year ago
Because he talks like them, and they know he's a scumbag, but he's their scumbag, which they sic on the people they hate most: the vermin liberals, the immigrants poisoning the blood of the country, the parasitic federal workers whose lives they want to make miserable, the trans people they deem as all predatory groomers, the academics and scientists they're defunding because it's all woke. It's about taking their lump of flesh. They excuse the open corruption as at least being open corruption, since they assume everyone else is ten times as corrupt behind closed doors. That's why they were fine withholding disaster relief from blue states in 2020.

It makes me angry as hell. They hate us and you can't say anything about it because if you're not nice enough to them, they act like you're being mean to them and the personal reason they'll continue to vote for people that demonize and hate you.

Comment · 1 year ago
>This is clearly dog whistle langauge and not intended to be taken literally, but it is starting to be a common trope and it makes me very curious as to how this industry operates?

It's clearly just dismissive language that doesn't have to make sense. The only purpose is to make climate change seem like a fake concept thought of by groups with nefarious intentions. It's like asking the author of a short story what the main character's favorite color is. That detail simply wasn't considered because it's not needed in the short story.

Comment · 1 year ago
> "C is the language that combines raw power of assembly with expressiveness of assembly."

The most expressive part of C is the syntax oriented around writing terse, side-effectful expressions that manipulate buffers, pointers and counters, with the array of precedences and the pre- and post-increments and assignment operators and short-circuiting operators. You can write stuff like this:

  while (--n > 0 && (c = getchar()) != EOF && (*s++ = c) != '\n')
      ;
  *s = '\0';
Or these snippets (taken from K&R):

  // Parsing flags for command line arguments
  while (--argc > 0 && (*++argv)[O] == '-')
      while (c = *++argv[O])
          switch (c) {
          // ...
          }

  // Last line of a buffered `getchar()` implementation 
  return (--n >= 0) ? (unsigned char) *bufp++ : EOF;
You can write other programs in C, like GUI programs and compilers, but it's not as nearly tailor made for such programs and it's basically just like assembly, like you said.
Comment · 1 year ago
Yeah, it would have to be something like this if you wanted to avoid the signed integer overflow at the end of the loop:

  assert(i <= j);
  for (;;) {
      do_something_with(i);
      if (i == j)
          break;
      i++;
  }
Comment · 1 year ago
> I did consider that, but I wrote "in general" for a reason. It works very specifically in the case of "add one" or "subtract one", but it doesn't work with anything more complicated, like chasing pointers or adding/subtracting more than one at a time.

You're reminding me of the book "Modern Compiler Design." The author goes over how to compile a general Pascal-style for-loop correctly, accounting for increasing or decreasing ranges, differing step sizes, and accounting for overflow. It was written using just goto statements, so I adapted a version of it to C. Just replace "intN_t" with an actual integer size. It works by calculating the number of times the loop will run. If "from" is equal to "to," it's still going to run at least once. Again, this is not mine, just adapted from the author's code (Dick Grune's).

  // enumerate: print out numbers from "from" to "to", inclusive, with step size "by"
  void enumerate(intN_t from, intN_t to, intN_t by) {
      uintN_t loop_count;
      intN_t i;
      if (by > 0) {
          if (from > to) return;
          loop_count = (to - from) / by + 1;
      } else if (by < 0) {
          if (from < to) return;
          loop_count = (from - to) / -by + 1;
      } else /* (by == 0) */ {
          // Maybe some kind of error
          return;
      }
      for (i = from; ; i += by) {
          printf("%d\n", i);
          if (--loop_count == 0) break;
      }
  }
You can see it's more complicated than the idiomatic C for-loop, haha. But that's just a general solution. Like you guys noted, it could be simpler for step sizes of 1.
Comment · 1 year ago
It's true that theorem provers can be just sufficiently advanced type systems (the Curry Howard correspondence), but not all theorem provers operate that way. Isabelle/HOL operates on higher order logic. Imperative ones like SPARK or Dafny just rely on encoding preconditions and postconditions and things like loop invariants and just use SMT solvers for verification, IIRC.

Having an advanced type system does seem to encourage this sort of informal proof oriented thinking more than imperative and somewhat typeless languages do, though, since preconditions and postconditions and loop invariants and inductive proofs on loops are things you have to do yourself entirely in your head.

Comment · 1 year ago
Perhaps it's that you never have to read the whole file into memory at once if it's with a `FILE *` rather than a string. I'm not that person, this is just my assumption.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton