5 ms·
For instance `std::ptr::offset` which is apparently a trivial wrapper around some LLVM internal: https://llvm.org/docs/LangRef.html#getelementptr-instruction ht
by Blikkentrekker 6y ago
For instance `std::ptr::offset` which is apparently a trivial wrapper around some LLVM internal: https://llvm.org/docs/LangRef.html#getelementptr-instruction https://llvm.org/docs/LangRef.html#getelementptr-instruction
I'm not sure as to what capacity GCC has a similar instruction but I heard that LLVM's using of signed integers here is apparently nonstandard and what lead to Rust's decisions for vectors to be limited to a certain size: https://doc.rust-lang.org/nomicon/vec-alloc.html https://doc.rust-lang.org/nomicon/vec-alloc.html
- stouset 6y agoI don’t know why you’re italicizing LLVM, gcc, and Rust, but I (and perhaps others) find it relatively jarring as my brain automatically parses it as emphasis even though it clearly isn’t intended to be. I only bring it up because it pretty drastically harms readability (for me at least, and to a degree I frankly find surprising). Just thought you may want to know.
- samb1729 6y agoLooking at their commenting history, they have a habit of italicising really often, so it's not specific to this topic. It does indeed make a lot of their comments annoying to read without obviously adding any value.
- codetrotter 6y ago> It does indeed make a lot of their comments annoying to read without obviously adding any value I’m going to assume that you mean that the italics don’t add value, and not their comments as a whole. I think your comment could be read either way. Anyways, even so others have since pointed out reasons why the might be used to doing so.
- balnaphone 6y agoThis is common nomenclature to enhance readability in fields that have a large number of neologisms and proper nouns, such as some technical domains, medicine, investment banking, and so on. It's particularly useful when names are in the same language as the base language (e.g. in English "Peter" is easily recognized as a name, but "better fish" means something in the language, but can also be used as a proper noun, so using italics for proper nouns serves to disambiguate the intended meaning).
- deleted 6y ago[deleted]
- tssva 6y agoMaybe he is used to writing in MLA style which calls for the titles of software to be italicized just as books, movies, etc are.
- Blikkentrekker 6y agoThis is indeed a point of contention among different styles of whether software titles should be italicized. Though the position that they should uniformly be is the minority one, it is certainly used by some outlets with considerable weight, and I believe it to be the consistent one if titles of books and films are too. Some style guides make the even more inconsistent distinction that only titles of video games be italicized, but titles of “application software” not be. I suppose that on H.N., where such software is frequently mentioned, it does stand out more.
- unanswered 6y agoThe video games example seems consistent to me; we regularly italicize the names of plays (for example) but not the names of tools and businesses.
- Blikkentrekker 6y agoBecause tools and businesses are not titles that qualify for intellectual property, a piece of software is. I do not italicize Google the company either, but I do that of Google the search engine. The titles of scientific research papers are also typically italicized.
- CUViper 6y agoGlibc malloc also limits the maximum according to ptrdiff_t, which is effectively the same as Rust isize.
- chrisseaton 6y agogetelementptr is just some pointer arithmetic - all backends can do that. And using signed integers is unusual yes, but again all backends (obviously) also support signed integers.
- steveklabnik 6y agoIMHO, "Just some pointer arithmetic" is selling it a bit short. There's a lot of stuff there around provenance that matters, that is, there's a reason this is an intrinsic and not just a subtraction after casting both to an int. (I agree on the signed integer thing though.)