4,901 karma · joined Sep 13, 2020 (6y ago) · 1,641 submissions
comment 3y ago · link · parent
It should be, as daenney posted: <https://www.tandfonline.com/doi/full/10.1080/25785648.2023.2...>
comment 3y ago · link · parent
That’s my entire point. Compiler is free to make incorrect assumptions.
> It is also incorrect given the standard text.
According to C11 standard, section 3.4.3, the standard imposes no requirements on undefined behaviour.
comment 3y ago · link · parent
comment 3y ago · link · parent
Implementation-defined behaviour is a thing. Not knowing what will happen is not an accurate description of undefined behaviour. What the compiler does is assume that undefined behaviour doesn’t happen. When it does happen, it results in a contradiction, and logically every sentence is a consequence of a contradiction (see e.g. “Bertrand Russell is the pope”). That produces all those infamous bugs. Because just like every sentence is a consequence of a contradiction, every program state can be a result of UB. This is untenable.
comment 3y ago · link · parent
2. Same as in 1.
3. It’s not an issue in my experience. A much bigger issue are large JSON files captured for snapshot testing or just big binary files. If your repo is so small that its deps are its majority, then it really shouldn’t take all that much time (or you use too many/too big deps, but I doubt you can beat Chromium which has Skia-sized deps).
> Compare to using a simple file with a 1) url, 2) secure hash, 3) list of patches to apply. Reviewing and ensuring correctness is trivial, upgrading is trivial, PRs are trivial.
Using a url doesn’t remove the need for reviewing the code of your dependencies. If you don’t, you’re essentially running “curl | sh” at scale. Checksums without code review don’t mean much.
comment 3y ago · link · parent
How it’s done in Chromium: <https://source.chromium.org/chromium/chromium/src/+/main:thi...>.
comment 3y ago · link · parent
Keep it simple, just vendor your deps.
comment 3y ago · link · parent
Thanks for the suggestion. I’ll use it when I get around to updating this page. For now though I’ll let it sit there, as I’m too tired with it at this point.
> there's no clear instructions as to how I'd use it for my own projects. Perhaps work on a CMake / Autoconf config for a library build?
It’s not meant to be used as a library. It’s only for demonstrative purposes. There are a couple choices made in this code motivated by that, like not checking for integer overflow, or hardcoding page size based on the target platform at compile time. If someone wants to use the code anyway, they should just copy it into their project and possibly modify the parts which aren’t up to snuff. That’s also what I’m doing, as I wrote a more robust version in Rust for my project. I only wrote C++ for the article, because that’s what more people are familiar with, and there are more implementations, so I got to benchmark this code against several implementations of std::vector.
As for CMake/Autotools, I think the scripts in the repo are better for my little demo, as they don’t add any dependencies beyond what’s already available on each platform, they’re more transparent and easier to use. For a big project I’d probably use CMake, but I don’t think it’s warranted here.
> The repository itself might not have enough visibility due to being self hosted. While I do love self-hosting, maybe posting a read-only mirror on GitHub would bring in more exposure?
The intended path of discovery, when it comes to the repo, is through my article. It’s not meant to be independent, so I don’t really care about the discoverability of the repo as a stand-alone thing. As for GitHub, I don’t like it for a variety of reasons and if I can help it, I’ll avoid it.
comment 3y ago · link · parent
I can't count the number of times someone published their open source project and inevitably people in the comments started questioning their language choices, because they wouldn't be able to use it in their "team", and how that choice is ultimately harmful for "the community". Now, you're not doing that exact thing here. I'm just thinking about how all that focus on "the team" and "the community" often goes too far.
Personally, I'm not going to do anything in Common Lisp, but I'm always happy seeing other people doing their projects in that language (and many others).
comment 3y ago · link · parent
comment 3y ago · link · parent
In-depth analysis of a memory allocation strategy, which allowed me to write an alternative to std::vector, which in my benchmarks performed better for all but a few workloads and on those few was competitive.
I was exhausted after finishing it. It may have been too long for some folks though. No upvotes.
comment 3y ago · link · parent
Infix has nothing to do with it. - refers to the subtraction function regardless of whether it is placed in prefix or infix position. Infix will trigger a type error, not a syntactic error — it will tell you that e.g. it cannot call a fixnum. Lisp quite ordinarily requires function names to be separated from their arguments by spaces, which is just a special case of the rule that atoms need to be separated by spaces. That’s all.
comment 3y ago · link · parent