HNHacker News
TopNewBestAskShowJobs

GrumpySloth

4,901 karma · joined September 13, 2020

submissionscomments
GrumpySloth··on Kagi Changelog 2/13: Faster and more accurate instant answers and Wikipedia page
Same in Poland. I suspect they’re generally slower in Europe than US due to location of servers.
GrumpySloth··on Kagi Changelog 2/13: Faster and more accurate instant answers and Wikipedia page
I’ve been using Kagi for a while. Unfortunately, its website on mobile is much lower quality than say DDG. One issue I find often is that when I want to edit a previously-entered query in the search box, sliding the text cursor is very hard – it often stops at search box boundary and doesn’t scroll the text inside. Another is that sometimes the search results page freezes after I come back to it from a different tab. When I try to scroll, it refuses to scroll and only briefly shows some white space around the currently-viewed part. I blame all those on some JS that’s too creative for its own good.

Aside from that, I wish Safari had a setting to add custom search URLs, so that I can paste my Kagi auth token, instead of having to use xxSearch, which also has some annoyances. Obviously, this part is not Kagi’s fault.

I’ve stopped using Kagi on mobile and went back to DDG. It’s still stellar on desktop though.

GrumpySloth··on Aho – a Git implementation in Awk
Care to give any examples of Linux distros without Perl?
GrumpySloth··on Aho – a Git implementation in Awk
> much lesser lines of code

Doubtful. awk has a lot of implicit behaviour which allows the programmer to write very terse scripts. An equivalent Python program is usually several times longer.

GrumpySloth··on Aho – a Git implementation in Awk
Perl is installed by default on most Unix systems. FreeBSD being the exception. Python isn’t. Although Python is popular; if we’re comparing the probability of someone having the interpreter installed already, it’s greater for Perl, even if people aren’t aware they already have it.
GrumpySloth··on Sony is erasing digital libraries that were supposed to be accessible "forever"
Crunchyroll is the most bizarre streaming service I’ve tried. None of the anime had original audio tracks. One Punch Man was available only with a French dub. A Korean anime had many audio tracks to choose from... but none of them were Korean. What the hell?

Cancelled the trial after several minutes.

GrumpySloth··on Two's complement integers with only sign bit set should be a trap representation
Floating point numbers also don’t obey normal algebra laws and are notoriously tricky to get right.

Two’s complement on the other hand form an honest-to-god commutative ring, their implementation is dead simple and it’s very rare that they lead to bugs in and out of themselves. They’re one of the most beautiful solutions in computer science IMO.

I’d give up floating point much more readily than two's complement.

GrumpySloth··on TCC RISC-V Compiler Runs in the Web Browser (Thanks to Zig Compiler)
Statically linking with musl and enabling LTO sounds like what you’re looking for.
GrumpySloth··on Pandoc
> To people who say "Word sux", I say "That just means you don't know how to use Word properly".

Or maybe those people just have eyes which can spot the differences in spacing between documents created with different Word versions, the mediocre kerning, and a multitude of other typographical annoyances.

Even a website is easier to replicate exactly in another browser than a Word document to be replicated from scratch in a new version of Word. And if by some miracle you manage that, the end result will always look meh.

GrumpySloth··on Prefer table driven tests (2019)
Hypothesis approach looks interesting. I’ll look into it.

As for my approach to generation, there’s not much to it. Instead of generating arbitrarily complex values and then trying to shrink them to simpler ones, I start with simple values and, if they work, proceed to more complex ones. In every test run I use the same values. It’s basically a brute-force, which omits values which are sufficiently similar to values already tested.

The omission is achieved by having a base set of simple values where each is judged by me to be sufficiently different from the others (I basically copy e.g. tricky numbers/unicode values from quickcheck implementations, which are used inside generating code), and the base set is ordered from simplest to less simple. Then I run a loop which goes over all elements of the base set, run the test, then take a function which based on the base set produces more complex values, run the test on that etc. So the earliest fail is going to be the simplest value it can generate.

GrumpySloth··on Prefer table driven tests (2019)
I have a finite budget of code and time I can afford to spend. One of the choices gives me a much better RoI in my experience. I prefer to spend the rest of the budget on the main code.
GrumpySloth··on Prefer table driven tests (2019)
Door A: tests find bugs sometimes (property-based)

Door B: tests find bugs almost always with a fraction of the code (my approach)

I choose Door B.

I still test properties tbh. I just don’t let randomness ruin it and don’t need to implement any shrinking.

GrumpySloth··on Prefer table driven tests (2019)
The problem with property-based tests is that for non-trivial input data, like e.g. source code for a compiler, it’s hard to implement shrinking, since it’s hard to tell in general what it means to simplify a program (or another piece of non-trivial input). Another issue is that randomisation introduces flakiness when the input space is large. I prefer to write tests by writing a small number of simple base cases and then code which produces increasingly more complex combinations of them up to a certain size. It’s completely deterministic and the order goes from simpler to more complex, so when the test fails, it fails at the simplest case it could find and doesn’t need to go from more complex, to simpler, which is much mire complex. By moving from property-based tests to this approach I’ve sped up my tests and made them more reliable. Previously they weren’t as effective at finding bugs, and when they did find them, it was hard to reproduce other than by copying the random generator seed. And the shrinking code was very complex.

So my approach intuitively is a bit like writing down a small set of simple axioms and then generating their more complex consequences. The key being the order.

GrumpySloth··on Intel's Humbling
They didn’t sabotage them. The CPUs just didn’t align with Apple’s goals. It’s not like they gave the M1 CPUs the cooling that Intel didn’t get. My Mac Mini M1 never spins up its fans and everything is fine. I love it. If it did, I’d consider it a downgrade.
GrumpySloth··on Helios: A distribution of Illumos powering the Oxide Rack
I know about that. This is a special edition for embedded though. But CentOS is news to me. CentOS was targeted for servers.
GrumpySloth··on Helios: A distribution of Illumos powering the Oxide Rack
CentOS wasn’t used in embedded systems.
GrumpySloth··on Tell HN: YouTube RSS feeds are gone
I guess I’ll stop watching YouTube. ¯\_(ツ)_/¯
GrumpySloth··on Zed, a collaborative code editor, is now open source
I think on Linux at least it freezes due to watching too many files using inotify to update its sidebar. I wish there was an option to disable that. Same thing happens with Sublime Merge. It’s unusable on giant repos.
GrumpySloth··on The Case for Rust in the base system
Not after I added the second paragraph. ;)
GrumpySloth··on The Case for Rust in the base system
Perhaps that will bring FreeBSD from Tier 2 to Tier 1 of Rust support, if they cooperate with the upstream?

https://doc.rust-lang.org/nightly/rustc/platform-support.htm...

GrumpySloth··on The Case for Rust in the base system
The stuff that’s included in the system after a standard install, before you install any additional stuff. It’s all in one repository and it’s maintained by the FreeBSD project. Stuff like the kernel, libc, utils, dtrace, compilers needed to build base, ... Basically everything that’s needed for a usable system. It’s updated all together through binary patches, not separately through packages like on Linux. When you want something more, you either compile it from source using Makefiles stored in a repository called “ports” (the Makefiles download the tarballs with source code, verify their checksums, build them etc), or you install pre-built packages using the pkg package manager.

The FreeBSD project tends to like to slim the base system down. E.g. some years ago they removed Perl from the base system. So out-of-the-box the only scripting language that’s available is shell. In contrast, OpenBSD has more stuff in its base system and on the subject of Perl they doubled down on it (their package manager e.g. is written in Perl). It’s also visible, when you download the base system repos for each of them and run tokei to find out the numbers of LOC. (I don’t remember the numbers off the top of my head.) That said, FreeBSD still includes a full LLVM toolchain due to the rule “base builds base”, and LLVM is... a lot. It’s the biggest source of bloat in my jails to be honest. I keep meaning to find out if I can remove it from them.

GrumpySloth··on White space does matter in C23
It’s not a token separator in the "#define foo(x)" example. You never get a "foo(" token, regardless of whitespace, but whitespace decides whether it’s a function macro definition or a constant definition. The standard needed to invent a new token called lparen, which is a left round bracket that is not preceded by whitespace, to make it make any sense.
GrumpySloth··on Identifying Rust's collect:<Vec<_>>() memory leak footgun
There is nothing unsafe about allocating more memory than necessary.
GrumpySloth··on How to Design an ISA
> Saying that one isa is faster or more energy efficient is like saying that c++ syntax is faster than java syntax.

Which may be true, if we’re talking about compilation speed, although in this case the reverse is true.

GrumpySloth··on Operating on infinite lists
What length does a cyclical list have?

  (define l '(1 2 3))
  (set-cdr! (cddr l) l)
GrumpySloth··on iPhone seemingly sends iOS keyboard data to an iCloud server
I want to search the local computer, to launch an app, not search the internet.
GrumpySloth··on The failure of self-checkout technology
Except the speaker screams at you, very loud.

The best ones I’ve used are at Rossmann. Completely silent, and don’t measure the weight of anything, so you never get to the “sorry, your shopping’s weight is off by 1g” part. The UI is also very efficient, where in Carrefour they seem to periodically add more popups to the process.

GrumpySloth··on Cloned rhesus monkey lives to adulthood for first time
2: I thought wegfawefgawefg was talking about prenatal genetic alterations to normal children. I don’t think anyone would treat anyone differently based on that, similar to how noone treats IVF children differently - the things happening at that stage seem to only lead to judgemental treatment of parents, not children. And the parenting issue in this case doesn’t exist obviously, since it’s solved like for any other child.
GrumpySloth··on Cloned rhesus monkey lives to adulthood for first time
1. How is cloning going to lead to it?

2. I don’t see anything wrong with that. I would have preferred to be born without inheriting neurological disfunctions common in my family.

GrumpySloth··on Std: Clamp generates less efficient assembly than std:min(max,std:max(min,v))
But then it uses AVX instructions. (You can replace -march=znver1 with just -mavx.)

When AVX isn’t enabled, the std::min + std::max example still uses fewer instructions. Looks like a random register allocation failure.

← PreviousPage 4 of 7Next →