HN user

atiedebee

177 karma
Posts0
Comments128
View on HN
No posts found.

The concise help text should only include:

- A description of what your program does.

- One or two example invocations.

- Descriptions of flags, unless there are lots of them.

- An instruction to pass the --help flag for more information.

I disagree with this. The first 3 points should all unconditionally be in the man page of the program. In my ideal scenario, the jq short help message would omit everything after the "Usage" section except for the message to run the command with --help.

But the goal isn't to catalogue all human knowledge. Having an article for every living person would be "cataloguing all human knowledge" but it would also be a meaningless endeavour. Some knowledge is worth preserving in an encyclopedia, other knowledge isn't. That is why they have their notability guidelines.

Right before the statement in Wikipedia being an ideological playground:

Our best hypothesis is quite simple: some of the mods just don't like Odin as a language and don't want it on Wikipedia as any form of "advertisement".

It doesn't directly say "political bias", but it certainly is implied (not as in national politics, more like ideological)

But the tech giant says it kept operational carbon emissions down by continuing to purchase massive amounts of clean energy.

I never got this line of reasoning. If you are using 37% energy and you buy it from providers of clean energy, doesn't that mean that someone else won't be able to use that energy and will have to use fossil fuels anyways? It's the equivalent of "reducing" a country's emissions by forcing companies to move to a country where they ARE allowed to pollute and just importing the produce from there.

By cheating you gain a certificate that says you can do things which you cannot. The difference between cheating in university and forging a degree is the time it takes.

When going to a doctor, you wouldn't want them to have cheated for their exams during training. You expect them to be well equipped to practice medicine and to ensure you get correct diagnoses and care. When hiring a programmer or software engineer, you should expect them to be able to provide you a proper, well architected application given the requirements.

Except that brotli uses Huffman coding. It's main claim to fame is using higher order statistics to select a Huffman table and its built-in dictionary.

This class of compression programs sees larger differences due to the way the data is modelled instead of the specific entropy coder used.

It depends on the format. Brotli switches the Huffman codes used based on the previously decoded bytes, but gzip and bzip2 for example use the same Huffman codes for a bigger block of data. But even then, there might be some more details that you'd need to work out, like the decoding of LZ offsets.

I imagine you would want to test "idiomatic" code for these comparisons. It doesn't make much sense to compile with C++ and write everything in C.

I made a program with some inline assembly and tried O3 with clang once. Because the assembly was in a loop, the compiler probably didn't have enough information on the actual code and decided to fully unroll all 16 iterations, making performance drop by 25% because the cache locality was completely destroyed. What I'm trying to say, is that loop unrolling is definitely not a guarantee for faster code in exchange for binary size

I don't know about survival bias. LLMs are well suited to this task of taking in this cloud of soft data like a description of symptoms and spitting out a potential diagnosis.

And it will do so confidently and incorrectly. A single description of symptoms from a patient is very unlikely to be enough. This is why doctors are there to ask follow-up questions and do examinations. Symptoms alone can describe a dozen different illnesses.

An ode to bzip 4 months ago

bzip3 is very different from bzip2. It is not even made by the same person and is not nearly as ubiquitous.

I know this position is wrong, but it feels hard to spend my time on something that someone else might not have spent the time to create

I don't think that position is wrong. I felt similarly when tutoring a high-school student recently. They didn't do any work themselves, they were forced by their parent to come to me two days before a test. I offered to help, but when I realized that the student didn't care enough to study by themselves, I basically lost all motivation to help them.

It feels the same with AI-generated content. If the "creator" didn't care to spend time on it, why should I spend mine?

ISO C99 actually defines multiple types of deviating behaviour. What you're describing is closer to implementation-defined behaviour than anything else.

The three behaviours relevant in this discussion, from section 3.4:

  3.4.1 implementation-defined behavior
  unspecified behavior where each implementation documents how the choice is made
  EXAMPLE An example of implementation-defined behavior is the propagation of the high-order bit when a signed integer is shifted right.

  3.4.3 undefined behavior
  behavior, upon use of a nonportable or erroneous program construct or of erroneous data, for which this International Standard imposes no requirements
  Possible undefined behavior ranges from ignoring the situation completely with unpredictable results, to behaving during translation or program execution in a documented manner characteristic of the environment (with or without the issuance of a diagnostic message), to terminating a translation or execution (with the issuance of a diagnostic message).
  An example of undefined behavior is the behavior on integer overflow.

  3.4.4 unspecified behavior
  behavior where this International Standard provides two or more possibilities and imposes no further requirements on which is chosen in any instance
  An example of unspecified behavior is the order in which the arguments to a function are evaluated.
K&R seems to also mention "undefined" and "implementation-defined" behaviour on several occasions. It doesn't specify what is meant by undefined behaviour, but it does indeed seem to be "whatever happens, happens" instead of "you can do whatever you want." But ISO C99 seems to be a lot looser with their definition.

Using integer overflow, as in your example, for optimization has been shown to be beneficial by Charles Carruth in a talk he did at CppCon in 2016.[1] I think it would be best to have something similar to Zig's wrapping and saturating addition operators instead, but for that I think it is better to just use Zig (which I personally am very willing to do once they reach 1.0 and other compiler implementations are available).[2]

[1] https://youtu.be/yG1OZ69H_-o?si=x-9ALB8JGn5Qdjx_&t=2357 [2] https://ziglang.org/documentation/0.15.2/#Operators

Recompiling the dependencies should only really happen if you change the file with the implementation include (usually done by defining <library>_IMPLEMENTATION or something like that.

I checked the spec and Scheme R5RS does have lazy evaluation in the form of promises using "delay" and "force", but I can see why explicitly having to put those everywhere isn't a good solution.

Im very familiar with Nix or the language, but why would interpreting guile scheme for package management be expensive? What are guix and nix doing that would require evaluating everything lazily for good enough performance?

Ran the tests again with some more files, this time decompressing the pdf in advance. I picked some widely available PDFs to make the experiment reproducable.

  file            | raw         | zstd       (%)      | brotli     (%)     |
  gawk.pdf        | 8.068.092   | 1.437.529  (17.8%)  | 1.376.106  (17.1%) |
  shannon.pdf     | 335.009     | 68.739     (20.5%)  | 65.978     (19.6%) |
  attention.pdf   | 24.742.418  | 367.367    (1.4%)   | 362.578    (1.4%)  |
  learnopengl.pdf | 253.041.425 | 37.756.229 (14.9%)  | 35.223.532 (13.9%) |
For learnopengl.pdf I also tested the decompression performance, since it is such a large file, and got the following (less surprising) results using 'perf stat -r 5':
  zstd:   0.4532 +- 0.0216 seconds time elapsed  ( +-  4.77% )
  brotli: 0.7641 +- 0.0242 seconds time elapsed  ( +-  3.17% )
The conclusion seems to be consistent with what brotli's authors have said: brotli achieves slightly better compression, at the cost of a little over half the decompression speed.

I thought the same, so I ran brotli and zstd on some PDFs I had laying around.

  brotli 1.0.7 args: -q 11 -w 24
  zstd v1.5.0  args: --ultra -22 --long=31 
                 | Original | zstd    | brotli
  RandomBook.pdf | 15M      | 4.6M    | 4.5M
  Invoice.pdf    | 19.3K    | 16.3K   | 16.1K
I made a table because I wanted to test more files, but almost all PDFs I downloaded/had stored locally were already compressed and I couldn't quickly find a way to decompress them.

Brotli seemed to have a very slight edge over zstd, even on the larger pdf, which I did not expect.

There is no common word for Queen in Germanic languages

Correct me if I am misunderstanding what you meant, but Dutch has koningin and German has Königin? They are basically a feminized version of king.

Its interesting how early programming languages are mentioned as having proper names. In the 60s we went from BCPL to B to C. B and C are not descriptive at all. Should they have been named "operating systems language" or "portable Unix language" instead? I also fail to see how AWK is a well named tool according to these metrics. The initials of the creators dont tell you anything about what it actually is or does.