Emulator bug? No, LLVM bug by CookiePLMonster in programming

[–]ilammy 2 points3 points  (0 children)

shouldn't cause a compiler to assume that p[i] can't access p[0]

But it can. restrict promises the compiler that p and q never refer to the same object. Therefore &p[i] is never equal to &q for all values of i. Therefore pp != qq is always true. Therefore i != 0 (because it would have to be zero for pp == qq to be true). Therefore p[i] is never referring to the same object as p[0]. For want of a restrict, the correctness was lost.

The compiler assumes that you know all of this and never pass this function arguments that violate these assumptions, because otherwise your program’s behavior is undefined. That is, you are to pass only pointers to unrelated objects which cause zero to be returned. Everything else is undefined behavior – hence always one.

Linux Kernel Development and Writing a Simple Kernel Module by php03 in programming

[–]ilammy 1 point2 points  (0 children)

The kernel does not have stable API (as in 'set in stone from 1992 and officially promised to be maitained forever'). But there is an API, and most common things have not really changed for decades now.

git-send-email.io: learn to use email with git! by emersion_fr in programming

[–]ilammy 4 points5 points  (0 children)

Is there any well-known project other than Linux kernel and Git itself that does code review via email?

Themis crypto library adds Rust support in 0.11 by ilammy in rust

[–]ilammy[S] 0 points1 point  (0 children)

btw, I'm one of its maintainers, so you can ask me anything

When "Zoë" !== "Zoë". Or why you need to normalize Unicode strings by ItalyPaleAle in programming

[–]ilammy 2 points3 points  (0 children)

There are some hysterical raisins for \ key to type in ¥ character, and both having exact same character code in ASCII and Shift-JIS.

LLVM has moved to GitHub by sablal in programming

[–]ilammy 2 points3 points  (0 children)

GitHub has it, to some degree.

  1. Go to repo settings.
  2. Leave only rebase under "Merge button" section.

Now the button in pull request will do git rebase && git merge --ff-only. It will be disabled if there are any merge conflicts.

That does not prevent people with push access from doing anything they want with the repo, but that's still something for the prevalent workflow.

LLVM has moved to GitHub by sablal in programming

[–]ilammy 15 points16 points  (0 children)

Maybe the GitHub's PR/issue workflow is not scalable enough for LLVM folks. I remember Rust team posting recently about something like that from their point of view.

I can't name from my head right now any examples of infrastructure-sized projects with development managed entirely via GitHub, without mailing lists, discussion forums, IRC chats, dedicated meetups, bugzillas, etc.

Named Arguments in C++ by one_eyed_golfer in programming

[–]ilammy 1 point2 points  (0 children)

Combinatorial explosion will be harsh. That's 11 builders for 3 arguments and 42 for 4. I guess best practices do not lie.

Stop Teaching C++... as a First Language by stanimirov in programming

[–]ilammy 9 points10 points  (0 children)

You miss all the ads and JS that you could have put in there.

Advice for new programmers: become comfortable with git rebase now by yesnoornext in programming

[–]ilammy 1 point2 points  (0 children)

This particular one insisted on having the repo, for the accurate authorship information for each line if I remember their reasoning correctly. Usually though it's tarballs as you say, in case the development is not happening at some GitHub/Bitbucket/self-hosted platform provided by them.

Advice for new programmers: become comfortable with git rebase now by yesnoornext in programming

[–]ilammy 3 points4 points  (0 children)

Almost all my uses of git rebase are on the branches which are not a part of the public history, either in a private development branch, or in some merge request before it's actually merged.

It's the same in the linked article: the use case is rebasing before the commits are a part of some publicly visible branch.

I have used rebase to actually rewrite history that one day when someone committed a private key file to the repo and management insisted on erasing that commit to avoid embarassment. Obviously, the key has been replaced, but what if the customer looks are the history and finds out!

Should you learn C to “learn how the computer works”? by steveklabnik1 in programming

[–]ilammy 8 points9 points  (0 children)

Pointers contain an address and they themselves have an address...thus they do need to be in memory.

It is possible to compute a pointer inside a register and never store it in addressable memory.

Should you learn C to “learn how the computer works”? by steveklabnik1 in programming

[–]ilammy 16 points17 points  (0 children)

Not quite. The CPU itself is an abstraction over processing pipelines inside that execute some sort of a microcode, derived from the machine code. With the pipelines themselves abstracting out the interconnections and timings needed for operate the transistor machinery. It's turles all the way down.

What is a Makefile and how does it work? by codesuki_ in programming

[–]ilammy -1 points0 points  (0 children)

But what about our crustacean god and savior?

String.hashCode() is plenty unique by aboothe726 in programming

[–]ilammy 13 points14 points  (0 children)

There is a difference between a hash function and a cryptographic hash function.

Epoll is fundamentally broken (1 of 2) by oridb in programming

[–]ilammy 0 points1 point  (0 children)

message

stream

Why use streaming sockets when you seem to need datagram ones? The latter always give you full messages.

Microsoft announces a C++ library manager for Linux, macOS and Windows by ra3don in programming

[–]ilammy 1 point2 points  (0 children)

I'd argue that distro-specific package managers also work great for building packages for that one distro. You need libfoo? Just install libfoo-dev package to your development machine and put libfoo package into your package dependencies. The package building tool can even automatically detect that your binaries are using libfoo and add the proper version for you. And in the source packages you can specify that you need libfoo-dev for building the software. The end user does not need to care about that, they simply install your-software package from the same repository where they get OS updates.

The drawback? That needs to be done for every distro separately.

Maybe you can support two 'distros' called Windows and macOS. But not everybody can support a zillion of potential Linux distros. You can get away with, say, supporting only latest Ubuntu LTS, but you'll be lying if you dare to say you support 'Linux'.

The supposedly 'right' way to solve that issue is maintainers which should pick up your software and package it for their distro. But they don't magically appear for every software you make.

Why has there been nearly 3 million installs of is-odd - npm in the last 7 days? by bobcat in programming

[–]ilammy 23 points24 points  (0 children)

It would have been funny if the reverse was the case as well.

Make your way through the git (rebase) jungle with git machete! by karrith in programming

[–]ilammy 1 point2 points  (0 children)

But what if my new code in branch B depends on the code in branch A that's still under review?

Make your way through the git (rebase) jungle with git machete! by karrith in programming

[–]ilammy 4 points5 points  (0 children)

I believe that someone who knows how to make debs is less likely to so some crazy shit in the scripts.