Recent submissions

Comment · 2 years ago
I agree that the comment sounded pretty hostile, but I also agreed with the assessment that it might be better to avoid allocation in general. I know the code in the post is highly simplified, but you aren't exactly fully using "lazy iterators," at least in the post. refresh/load_hotels is still allocating new Hotels, each of which contains a one-million-element Vec. If you could reuse the existing self.hotels[id].prices Vec allocations, that might help, again at least in the example code.

On second glance, I guess this is what you're getting at with the ArcSwap comment in the post. It sounds like you really do want to reallocate the whole State and atomically swap it with the previous state, which would make reusing the prices Vec impossible, at least without keeping around two States and swapping between them.

Anyway, tone aside, I still think the comment had validity in a general optimization sense, even if not in this specific case.

Comment · 2 years ago
Comment · 2 years ago
In grad school I worked on three separate Fortran code bases written as early as the 80s with tens of thousands of lines, no source control or version history, no build systems or even build scripts, and no tests. I think a lot of old scientific software is in the same condition, with some mix of "if ain't broke don't fix it" and the code being very hard to refactor.

This quote from the linked PRIMA page pretty much sums up my experience porting the above code too: "I hope I am the last one in the world to decode a maze of 244 GOTOs in 7939 lines of Fortran 77 code — I did this for three years and I do not want anyone else to do it again"

Comment · 2 years ago
Yeah the article says these "aren't used anymore," but my image viewer (sxiv) complained that the gif was corrupted until I put something there. It still displayed the image, but it also complained afterwards.
Comment · 2 years ago
Those examples contain overlap, but not in the first or last digit that is given as the solution. So from the instructions you can't tell that the intermediate list of numbers should be 8, 2, 3, you only know that the final answer is 83.
Comment · 2 years ago
Comment · 3 years ago
Comment · 3 years ago
Personally, I got tired of weird quirks like this with vterm and now bind this command to the key I used to have vterm on to spawn my actual terminal (st) in my current directory. It's probably not what most people want from vterm, but I prefer it.

  (defun open-term-here ()
    "open st in `default-directory`"
    (interactive)
    (call-process-shell-command
     (concat "st bash -c \"cd "
      default-directory
      " && exec zsh\"")
     nil 0))
Comment · 3 years ago
Comment · 3 years ago
It already is! I've been building Emacs from the development branch for the last couple of years, and the improvements in 29 and now 30 have really been great. I barely remember the sluggishness the other comment mentions.
Comment · 3 years ago
He links to a page about ARM MTE in the section where he talks about memory tagging and CHERI for the first time.
Comment · 3 years ago
I agree, it's not about it being "easy" to find the documentation or "easy" to watch the video. This is the landing page for the project, and I'd much rather see the commands in the video listed out on the page rather than having to watch someone else's terminal session.

I was recently looking at nushell, and that website has exactly what I would expect to find: example input with screenshots of the output instead of a video.

Comment · 3 years ago
The example in previous versions of the Go math/rand package suggested using time.Now().UnixNano() to seed the RNG source since that's essentially a random int64.
Comment · 3 years ago
Not sure exactly what they meant, but I assume most arguments in this vein have something to do with form. A well-executed deadlift is a great exercise, but you have to balance the risk of injury, especially for new lifters without a trainer or coach to help with their form.
Comment · 3 years ago

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton