Better HN
topnewbestaskshowjobs
Log inSign up

GrumpySloth

4,901 karma · joined Sep 13, 2020 (6y ago) · 1,641 submissions

Submissions

comment 3y ago · link · parent

Wrong link. Currently it's: <https://www.tandfonline.com/action/cookieAbsent>

It should be, as daenney posted: <https://www.tandfonline.com/doi/full/10.1080/25785648.2023.2...>

comment 3y ago · link · parent

Yeah, the serpent always seemed to me reminiscent of Prometheus.

comment 3y ago · link · parent

There is a timeout after which you can't respond to a comment. So old threads don't die only because people lose interest, but also because HN doesn't allow them to continue the discussions anymore.

comment 3y ago · link · parent

> A compiler that makes incorrect assumptions is a bad compiler.

I agree, but that includes GCC and Clang. ¯\_(ツ)_/¯

comment 3y ago · link · parent

> That is an incorrect assumption, as it clearly does.

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

Some of my highest-quality, well-informed, well-constructed, unemotional comments were downvoted to death in the past. Some of my lowest-quality, emotional, knee-jerk comments were upvoted to the top of a submission. I used to be bothered by upvotes/downvotes, but after all this time, I don’t. They don’t mean anything.

comment 3y ago · link · parent

Reading the headline, I naively thought it was about teaching them unhealthy eating habits. Yet the content is even more bizarre.

comment 3y ago · link · parent

> If we don't know what will happen that is Undefined Behaviour.

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

You’re parsing untrusted input. Doing it with the smallest set of privileges possible seems like a common sense thing to do.

comment 3y ago · link · parent

That happens much more often when authors use shallow click bait titles, like here; so it’s not unfair to the author.

comment 3y ago · link · parent

I tried Strang in uni and it was about the worst linear algebra book I tried. Kostrikin on the other hand was perfect — he struck the right balance between geometric intuition and formal rigour.

comment 3y ago · link · parent

1. If you follow my link, you’ll see the process involves adding a README documenting git hashes, licence and changes made (I don't see what seems to you so arduous about it). You can checkout the git repo by hash and run a diff between the files added to the review and what you checked out. It’s also common practice to delete irrelevant files to make the review smaller.

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

No. Just copy files into the repo. Any way you like. In a GUI, in a terminal — it doesn’t require a dedicated tool. Although cargo in Rust e.g. provides a dubcommand for it (cargo vendor). Alternatively you can host the tarballs somewhere you control in static storage — be it a static web server, object storage or whatever.

How it’s done in Chromium: <https://source.chromium.org/chromium/chromium/src/+/main:thi...>.

comment 3y ago · link · parent

Now I’m having a laugh at all those times someone tried to explain to me that vendoring dependencies doesn’t make sense, when you have package managers which verify checksums of the things downloaded from GitHub/wherever. A good laugh.

Keep it simple, just vendor your deps.

comment 3y ago · link · parent

For scrolling nothing beats PageUp, PageDown, Home and End.

comment 3y ago · link · parent

> Graphs of benchmark results would be neat to have. Remember to put the code and graphs as a sort of TL;DR

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

Which also prevents good privilege separation/sandboxing. See PAM vs BSD Auth, where the former cannot be secured with anything like pledge/unveil or Capsicum, but the latter can.

comment 3y ago · link · parent

Where do birth certificates contain photos? That… doesn’t sound very practical. (Imagining an elderly person handing in their photo as a toddler to border control.)

comment 3y ago · link · parent

I have 1G fibre on a contract I can cancel any time with no fee.

comment 3y ago · link · parent

I think you're excessively hung up on the example of everything happening within a single team inside a single company or some such thing, when the author of the submission wrote about making a choice for themselves. You don't start coding in Lisp out of nowhere when working in a Java shop on a CRUD app. But if you're charting your own course, it's great to be able to choose whatever suits you best.

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

Better for the others, but is it better for the scouts? Too often individuals are treated as drones obliged to work for a collective, which feels entitled to the work of the drones. From your perspective, they're not a good team mate. From their perspective, they're not part of your team.

comment 3y ago · link · parent

Maybe pandoc?

comment 3y ago · link · parent

IMO The author proved here that Rust could have a much better syntax, when they showed the CrabML example.

comment 3y ago · link · parent

https://yakubin.com/notes/comp/reserve-and-commit.html

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

Why couldn’t have been Jim’s fault? The world is run by Jims.

comment 3y ago · link · parent

Right, I was thinking about Lisp-1. Good call-out.

comment 3y ago · link · parent

> Lisp chooses to remove infix minus.

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

Do you have a moment to talk about our lord and saviour kebab-case?

comment 3y ago · link · parent

10 years of experience is what, 2-3 jobs? Easy to fit on one page. Just adjust the font size and padding between sections from the time you applied when you didn't have any experience and needed to pad your résumé.

comment 3y ago · link · parent

It's sometimes good to use a smaller size. Many string/dynamic array libraries e.g. will use 32-bit types for size and capacity even on 64-bit platforms to conserve space, and by that virtue also be more cache-efficient. I think the Zig compiler also explicitly uses 32-bit types in a lot of places, even though it's targeted mostly for 64-bit platforms.
1
181920
55