HNHacker News
TopNewBestAskShowJobs

GrumpySloth

4,901 karma · joined September 13, 2020

submissionscomments
GrumpySloth··on US marriages back to pre-pandemic levels while divorce rate falls
Do you think family homes had a lower percentage of drunkards back in 1946 when marriage was more common?
GrumpySloth··on Why you should use a terminal editor to write a commit message
Someone might have given you a command to run when setting up a repo. For example, it’s standard practice to download a hook which assigns a Change-Id to each commit when using Gerrit.
GrumpySloth··on Regex character "$" doesn't mean "end-of-string"
That’s because POSIX EREs are actual regular expressions thank god.
GrumpySloth··on Japan brings negative interest rates era to an end with first hike in 17 years
I’ve just checked and Wikipedia claims they have a branch in Tokyo.

Maybe I don’t understand what those headers in newspapers mean then.

GrumpySloth··on Japan brings negative interest rates era to an end with first hike in 17 years
Why is this reported from “Hong Kong (CNN)” and not Tokyo? Does it mean CNN has a local branch in Hong Kong, but not in Tokyo?
GrumpySloth··on C++ creator rebuts White House warning
It’s probably not a coincidence that he’s the author of the famous quote that may and is often used to deflect any and all criticism of a programming language.
GrumpySloth··on What part of Rust compilation is the bottleneck?
It’s not just Rust. Practically every compiler based on LLVM is slow. Swift, Zig, Clang.

The Go compiler being written from scratch based on the Plan9 C compiler is a huge advantage.

GrumpySloth··on On clock faces, 4 is Expressed as IIII, not IV
You could legitimately argue that it began in 1918 though.
GrumpySloth··on Ban on same-sex marriage unconstitutional, Sapporo High Court rules
One of the strongest motivators of marriage, heterosexual or not, are tax benefits and immigration laws.
GrumpySloth··on Ban on same-sex marriage unconstitutional, Sapporo High Court rules
> In Europe marriage was originally a religious thing, officiated by priests and managed by the church

Previously, not originally. In ancient Greece it was a state matter: <https://en.wikipedia.org/wiki/Marriage_in_ancient_Greece>

GrumpySloth··on C++ Safety, in Context
In order to read or write /proc/pid/mem your process needs to be allowed to ptrace() the target process. You can’t do that for arbitrary processes. Similar story for WriteProcessMemory().
GrumpySloth··on C++ Safety, in Context
At $work, the standard solution to ASAN reporting use-after-free issues is to... not run ASAN builds. The fact that builds in CI exhibit random inexplicable crashes regularly every week doesn’t seem to make anyone have any second thoughts. A colleague once claimed that there is nothing wrong with out-of-bounds accesses as long as we don’t crash. The same bunch is also religiously opposed to using debuggers and regularly break debugger builds by removing debug information from builds at multiple levels, blocking ptrace debugging in system images through sysctl... This is all so toxic.
GrumpySloth··on MKBHD, Fisker, and "the worst car ever reviewed"
It’s called one-party consent, which is standard in Europe and most states of US: <https://en.wikipedia.org/wiki/Telephone_call_recording_laws#...>
GrumpySloth··on Array languages vs. the curse of the spreadsheet
Knowledge of English is nowhere near as widespread as knowledge of infix notation. If we were to create a programming language based on words from a natural language which is most likely known by people trying to learn (i.e. most of them are in the age bracket 10-20), it would need to be Mandarin Chinese, since it’s the most popular first language. Even then it covers only 1/8 of the world population. Comparing it to infix notation is unjustified. To the rest of the population keywords in this language would at first be even less comprehensible than APL. Later they would be just as comprehensible as C is today. English is not known by most people learning programming, and yet it’s not a real problem. Even English-speaking people don’t seem to have an issue with the for loop, even though its name has nothing to do with any meaning of “for”.

But let’s now take something that is actually widespread: angular degrees. Before high school, I used only degrees at school and everywhere else. In high school I was taught about radians. Radians are a lot less used by random people than degrees. But since I learned them, as I later went through uni, then job etc, I’ve completely stopped thinking in degrees and use only radians, both professionally and in everyday life. That’s because their benefits justify the switch. So even when something is actually widespread, we can still find good reasons to switch to something that provides material benefits. I claim that the notation of array languages is beneficial enough (at least in the case of BQN).

As for Lisp:

1) Most languages offer a hash table as the default associative data structure. In Lisp culture alists are the default. Books about lisp also focus pn data structures built out of cons cells disproportionally more than any other data structures.

2) They do. But then you read actual programs available on the web and they still default to using alists. There is an impedance mismatch, if you’re more array/stack/hashtable-minded, which isn’t there in most mainstream languages. FTR I’m a big fan of SML too, but even in SML using the best data structures is very much going against the grain, when the language tries to steer you so much towards linked lists and away from arrays. I swear my SML programs look nothing like the things I find on GitHub.

GrumpySloth··on Array languages vs. the curse of the spreadsheet
> If you don't speak the language, then of course it won't make sense to you, but what relevance does it have to the conversation?

It demonstrates that your criticism of the syntax of array languages boils down to “it’s different than the things I already know” and that not using words in a programming language isn’t a meaningful barrier to most people, given that most programmers in the world overcame this obstacle with no sweat. There is a meaningful criticism to be had in the area of syntax, but this is not it IMO. One valid criticism I know of is that most array languages have a context-sensitive syntax: you need to maintain a symbol table in your head to know how to parenthesise a line of code. Fortunately, BQN fixes this issue by using a context-free grammar.

Lisp is defined by much more than syntax. I certainly see many flaws in it (starting with the cons cell), which are total deal-breakers for me and have nothing to do with syntax. I think your view that syntax is the biggest obstacle to Lisp’s popularity isn’t as evident as you claim. There are too many other, IMO bigger obstacles.

GrumpySloth··on Dear Linux Kernel CNA, what have you done?
To me the most disingenuous thing here on Linux’s part is that they won’t issue CVEs for vulnerabilities which aren’t fixed. And thus the latest Linux release is always tautologically CVE-free. Magic. Maybe at work I should raise the idea that our Jira bug tickets should have only one possible status: “fixed”. I’m learning from the best.
GrumpySloth··on Journalist casualties in the Israel-Gaza war
> I noticed if we plot the journalist killings against general population killings in Gaza, the graph deviates from an approximately straight line that might be expected if journalists were merely being killed as a result of "collateral damage" amidst indiscriminated bombings

I think this assumption is wrong. Journalists are known to try to get the most shocking photos and reports. I would expect their rates of injury compared to random Joes in similar situations to be similar to that of people doing extreme sports compared to people doing recreational sports.

GrumpySloth··on Fonts are still a Helvetica of a Problem
Sure. I’m just wondering about the attacker’s intentions. Whether they were malicious or merely misguided.
GrumpySloth··on Fonts are still a Helvetica of a Problem
Was this attack genuinely dangerous? Or was it just a social experiment?
GrumpySloth··on Array languages vs. the curse of the spreadsheet
Only if they already speak English. When I first learned C, I didn’t know English well enough to understand what “if” or “else” meant. I learned these words in the context of programming first, and natural language second. This experience is probably the same for most of the world’s programmers.

When I was learning programming back then, those keywords could just as well have been single letters. It wouldn’t have made a difference.

Also, I went up to my printer and there is no “WTF” there. Surely, this program doesn’t work! More seriously, this just illustrates that convention and idioms are much more powerful carriers of meaning than dictionary words. Array languages rely heavily on conventions/idioms.

GrumpySloth··on Rust for Embedded Systems: Current state, challenges and open problems
I think this is more of a social problem with C++. Regardless whether the feature is implemented in the standard library or the core language, the broader C++ community is not going to approve of enabling bounds checks on the bracket operator. And whether this operator is implemented as a builtin or as an overload on an stdlib type is basically transparent to the user.

FWIW you can enable bounds checks for the bracket operator by default for STL types in GCC and Clang. So for interfacing with Rust it is both obvious how to translate between slices in Rust and std::span in C++, and you can verify to a degree that this std::span isn’t corrupted on C++ side (to a degree).

GrumpySloth··on Rust for Embedded Systems: Current state, challenges and open problems
The problem with slices in C being added in stdlib would be that they really are a generic data type. It would be similar to atomic types. While C++ could just add std::atomic<T>, C needed to add a special construct: _Atomic(T).

C++ already has a slice type. It’s called std::span<T>. Porting it to C would probably require something similar to atomics. At which point I guess you may just as well get on with it and switch to C++.

GrumpySloth··on Rust for Embedded Systems: Current state, challenges and open problems
Version numbers. You can’t modify an already-published version of a Rust crate on crates.io.
GrumpySloth··on Java is becoming more like Rust, and I am here for it
Mutation in Rust is much more controlled than in SML or OCaml. Any record or variable (sic!) can contain a ref cell, or a special data type like an array, which can be mutated regardless of the type of the thing it’s contained within. That’s the ML approach to mutation.

In Rust on the other hand, even though ref cells are a thing as well, the main approach to mutation is through mutable bindings and mutable references, which preserve const-correctness (inspired by C++), i.e. there is a certain degree of transitivity in the guarantees around immutability. When I see an immutable reference in Rust and pass it to a function (or a method), then, outside of few special cases, I can reasonably expect it to stay unmodified. In ML I can’t, unless the code is written in a very unoptimal way, i.e. with persistent data structures anywhere and everywhere, and still the type system won’t give me any hints about that.

GrumpySloth··on CS 6120: Advanced Compilers: The Self-Guided Online Course
Nitpick: SSA is late 80s, early 90s tech.
GrumpySloth··on Bug in reader/writer locks in Windows API
Not my experience. When I report a bug in Chromium, it’s usually quickly verified as legit, and then left for dead forever.
GrumpySloth··on Supermium – Chromium fork for Win 2003/XP and newer
Downloading a file is something that happens automatically when you e.g. navigate (or are automatically redirected) to a link which is served with Content-Type of application/octet-stream. Example: <https://0x0.st/H7bb.bin>. If you don’t modify your browser somehow, it’s not something you as a user can protect yourself against.
GrumpySloth··on Supermium – Chromium fork for Win 2003/XP and newer
A quick search led me to CVE-2010-2568, which isn’t in TCP/IP[1], but is an RCE vulnerability that could be triggered by a website triggering a file download and the user later opening the folder with the downloaded file in Windows Explorer. Windows XP with Service Pack 3 is vulnerable.

[1]: The CVE database has to have the worst search out of all bug trackers I’ve ever used.

(I think using older versions of Windows is fine. But under no circumstances would I connect them to the internet.)

GrumpySloth··on Supermium – Chromium fork for Win 2003/XP and newer
Probably through RCE-s in Windows XP’s TCP/IP stack implementation.
GrumpySloth··on Ask HN: Why do companies pay new hires more than long time employees?
What place has potatoes more expensive than tomatoes?

Outside of Asia, which is more rice-based than potato-based, potatoes have a hard-earned centuries-old reputation of food for poor people (cheap to farm, not much nutritional value). But even after checking the prices in Japan, tomatoes are several times more expensive.

Maybe you’re not looking at the price per kilogram, but price of package for packaged vegetables?

← PreviousPage 2 of 7Next →