HN user

kevinastock

39 karma
Posts1
Comments17
View on HN

What's the reason for 'asm("");' in 002.c (and other c codes)? All I can see that doing is intentionally breaking the compiler's ability to optimize over loop iterations, which puts rust a huge advantage over c.

Shouldn't it be 'float * restrict a'?

When could one get into trouble thinking that "restrict == this will not alias"? If X is never modified during B it seems like aliasing wouldn't cause any problems.

Since restrict means nothing if no value in it is modified, would it be reasonable and possible for the compiler to issue a warning in cases like example1?

Aliasing information is one place the programmer can help the compiler. The 'restrict' keyword in C/C++ is a great example of this. Also information provided by 'const' can be very helpful for the compiler. While both of these aren't strictly hints because they limit what you can do and still get correct results, they do tell the compiler facts that would be otherwise difficult or impossible to prove.

It's visible in view source:

  "The requested document is no more.",
  'No file found.',
  "Even tried multi.",
  "Nothing helped.",
  "I'm really depressed about this.",
  "You see, I'm just a web server...",
  "-- here I am, brain the size of the universe,",
  "trying to serve you a simple web page,",
  "and then it doesn't even exist!",
  "Where does that leave me?!",
  "I mean, I don't even know you.",
  "How should I know what you wanted from me?",
  "You honestly think I can *guess*",
  "what someone I don't even *know*",
  "wants to find here?",
  "*sigh*",
  "Man, I'm so depressed I could just cry.",
  "And then where would we be, I ask you?",
  "It's not pretty when a web server cries.",
  "And where do you get off telling me what to show anyway?",
  "Just because I'm a web server,",
  "and possibly a manic depressive one at that?",
  "Why does that give you the right to tell me what to do?",
  "Huh?",
  "I'm so depressed...",
  "I think I'll crawl off into the trash can and decompose.",
  "I mean, I'm gonna be obsolete in what, two weeks anyway?",
  "What kind of a life is that?",
  "Two effing weeks,",
  "and then I'll be replaced by a .01 release,",
  "that thinks it's God's gift to web servers,",
  "just because it doesn't have some tiddly little",
  "security hole with its HTTP POST implementation,",
  "or something.",
  "I'm really sorry to burden you with all this,",
  "I mean, it's not your job to listen to my problems,",
  "and I guess it is my job to go and fetch web pages for you.",
  "But I couldn't get this one.",
  "I'm so sorry.",
  "Believe me!",
  "Maybe I could interest you in another page?",
  "There are a lot out there that are pretty neat, they say,",
  "although none of them were put on *my* server, of course.",
  "Figures, huh?",
  "Everything here is just mind-numbingly stupid.",
  "That makes me depressed too, since I have to serve them,",
  "all day and all night long.",
  "Two weeks of information overload,",
  "and then *pffftt*, consigned to the trash.",
  "What kind of a life is that?",
  "Now, please let me sulk alone.",
  "I'm so depressed."

The faster version looks like it might not be numerically stable; if sum(l_quantity) is greater than the maximum value that can be represented it would overflow and give meaningless results. Given the arrays mentioned by the average function, it could also be maintaining a heap and adding the numbers from smallest to largest for more stability.

Programmers Survey 15 years ago

I fully agree it's satire or a really bad survey, but that doesn't disqualify Ubuntu from being an operating system.