HNHacker News
TopNewBestAskShowJobs

GrumpySloth

4,901 karma · joined September 13, 2020

submissionscomments
GrumpySloth··on Algebra
Both are important. I replied to a comment about commutativity, so I focused on that.
GrumpySloth··on OpenBSD: Removing syscall(2) from libc and kernel
Linux doesn’t have an official libc. Raw syscalls are its only official API.
GrumpySloth··on The housing market looks like a bubble, 2008 regulator says
> Add in the adult segment of Generation Z

That would be about half of them.

Baby Boomers + Gen X = 134 million

Millenials + half of Gen Z = 107 million

Young people are outnumbered, and it’s going to get worse.

Numbers from <https://www.statista.com/statistics/797321/us-population-by-...>

GrumpySloth··on Linux gives up on 6-year LTS kernels, says they’re too much work
It was about code in third-party apps, not in Windows code.
GrumpySloth··on Writing Small CLI Programs in Common Lisp (2021)
> glibc has very good backward compatibility, with careful symbol versioning and whatnot.

Not in my experience. Working through exercises in Practical Binary Analysis, the first problem I needed to solve was running programs compiled against an older glibc on older Ubuntu on a new Ubuntu version with newer glibc, which boiled down to hunting down the glibc so from the older Ubuntu. Without it, the programs crashed on startup. That problem wasn’t even planned by the book author, but it sure was a good thematic fit. :)

GrumpySloth··on Philosophy of Science 101: What is the problem of induction?
Popper is more methodology of science, while Kuhn is more protosociology of science. Kuhn’s book doesn’t refute Popper’s, even if he would have liked it to.

I don’t know about the two others, but after reading about them briefly they seem as antirational as any philosophers subscribing to Hegel and/or Marx. When it comes to Lakatos specifically, I can say with certainty that his philosophy of mathematics has so little to do with mathematics that it’s not worth any paper (I studied maths and know many professional mathematicians personally).

GrumpySloth··on Rethinking Window Management
AwesomeWM as well. It allows you to write your own tiling algorithms in Lua.
GrumpySloth··on I claim Rich Hickey is wrong about non-null arguments to functions (2020)
I agree with Rich Hickey here and I think this is a flaw of sum types compared to union types. If Option<T> was a union type, T would be a subtype of Option<T> and those changes wouldn't be breaking. When writing Rust, I find myself repeatedly writing implementations of the From trait for enums, just because most of the time I actually want union types, not sum types. I think sum types should be built on top of union types by combining union types with a "lexically-scoped newtype", if that makes sense (i.e. they wouldn't be built in, they would be the result of two orthogonal features, while allowing for other combinations as well).

Edit: another nice consequence of this design would be None being its own type, which can be transparently converted to an Option<T> for any T, allowing for type inference to go in only one direction, while still avoiding the boilerplate of Option<T>::None. Unidirectional type inference would make for more intelligible compiler errors. Full Hindley-Milner can get confusing.

GrumpySloth··on Aptos, our modern successor to Calibri
Yeah. I have no idea what those images have to do with the surrounding text. Even ignoring the context, they don’t demonstrate what the font actually looks like all that well. That and, as others mentioned, it being published on medium.com instead of microsoft.com makes the whole thing look very unprofessional.
GrumpySloth··on C’s Biggest Mistake (2009)
I read it. I don't see your point. Sentinel values simply give you a very low performance ceiling that you can't optimise past. What I wrote only took me a couple minutes. It's far from optimal (but it already takes 2/3 the time the sentinel version takes, and 1/2 the time Lemire's range version takes). With thorough effort I bet you could get at least 10 times faster than that, provided you are given the length. With sentinels, you're just left with the original performance levels you can't improve.
GrumpySloth··on C’s Biggest Mistake (2009)
When you have the length, you can unroll the loop, so that you e.g. do 4 iterations at a time. With NUL you can’t do that. Moreover, loop iteration can be done in parallel (instruction-level parallelism) with processing the content of the string, since there is no data dependency between the two. With NUL you introduce a data dependency.
GrumpySloth··on C’s Biggest Mistake (2009)
Same as going from 64 to 65.
GrumpySloth··on Debian 12 “Bookworm”
I've never had a computer which would work with the official ideologically-pure installer. Always had to use the non-free one. I'm glad this vote turned out the way it did.
GrumpySloth··on Ron: Rusty Object Notation
For inter-machine communication TLV binary formats are far superior. Simplicity of parsing, efficiency. Can't compete.
GrumpySloth··on Nim 2.0.0 RC2
Garbage collectors, type systems, modules, polymorphic functions are not syntactic sugar. Asm also isn’t syntactic sugar, if only for the polymorphism (how many different CPU instructions are MOV in Asm again?); or just the fact that it’s text and machine code is binary code, while desugaring code doesn’t change its language.
GrumpySloth··on Zig as an alternative to writing unsafe Rust
Rust is supposed to be a systems programming language. If writing basic data structures was an edge case in it, the language would be broken. Luckily, in my experience it isn’t (at least not in this way).
GrumpySloth··on “Clean” code, horrible performance
Even in C compiler will emit warnings for unhandled cases in switch statements as long as you don’t provide a default case (as you shouldn’t).
GrumpySloth··on “Clean” code, horrible performance
This thread is, predictably, another demonstration of conflating optimisation with being aware of performance.

The presented transformation of code away from “clean” code had nothing to do with optimisation. In fact, it made the code more readable IMO. Then it demonstrated that most of those “clean” code commandments are detrimental to performance. So obviously when people saw the word “performance”, they immediately jumped “omg, you’re optimising, stop immediately!”

Another irritating reaction here is the straw man of optimising every last instruction: the course so far has been about demonstrating how much performance there even is on the table with reasonable code, to build up an intuition about what orders of magnitude are even possible. Casey repeated several times that what level of performance is right for your situation will depend on you and your situation. But you should be aware of what’s possible, about the multipliers you get from all those decisions.

And of course people bring up profilers: no profiler will tell you whether a function is optimal or not — only what portion of runtime is spent where. And if all your life you’ve been programming in Python, then your intuition about performance often is on the level of “well I guess in C it could be 5-10 times faster; I’ll focus on something else”, which always comes up in response to complaints about Python. Not even close.

GrumpySloth··on Ask HN: Best examples of software documentation that you've come across?
The Emacs info manual is also a gem. And the Emacs info mode is my favourite document viewer, which makes for a nice experience all around.
GrumpySloth··on C was not created as an abstract machine
> A compiler that makes incorrect assumptions is a bad compiler.

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

GrumpySloth··on C was not created as an abstract machine
> 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.

GrumpySloth··on Lisping at JPL Revisited
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).

GrumpySloth··on Lisping at JPL Revisited
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.
GrumpySloth··on Directly access your physical memory (dev/mem)
To be pedantic, that’s provided by bash, not devfs. You wouldn’t be able to do it like this from e.g. a C program.
GrumpySloth··on Technical Blogs You Recommend?
Casey Muratori's blog (everything stuff): <https://www.computerenhance.com/>

Max Bernstein's blog (compiler stuff): <https://bernsteinbear.com/blog/>

Michael Stapelberg's blog (Linux stuff): <https://michael.stapelberg.ch/posts/>

Göran Weinholt's blog (Scheme stuff): <https://weinholt.se/>

GrumpySloth··on C23 Implications for C Libraries
You need to get rid of the space between “??” and “(“.
GrumpySloth··on C23 Implications for C Libraries
This example doesn’t involve digraphs. Trigraphs also preceded digraphs, so their semantics couldn’t have been motivated by digraphs. In fact digraphs were added as a better-thought-out alternative to trigraphs. Digraphs were added in C99, whereas trigraphs were added in C89.
GrumpySloth··on C23 Implications for C Libraries
They’re not difficult to implement. It’s a sed pass running before any preprocessor or even lexer, which is the horrifying thing. They replace characters in source code, they’re not normal tokens like digraphs. And so e.g. the following program won’t print what a mere mortal would expect:

  #include <stdio.h>

  int main() {
    puts(“What??(Really.)”);
  }
Try running that. Only change the quote marks to the ones on a normal keyboard (I’m on my phone.)

Edit: Oh, and remember to compile with -std=c11 e.g. gnu11 has trigraphs disabled by default.

GrumpySloth··on C23 Implications for C Libraries
> Trigraphs are removed from the language.

Finally! My joy knows no bounds.

GrumpySloth··on Emacs-like editors written in Common Lisp
Beware of performance issues though. Guile is extraordinarily slow on numerical code at least. Specifically, orders of magnitude slower than Chez Scheme, while the latter is just a couple times slower than LuaJIT e.g. I got really turned off from Scheme after running some benchmarks on a couple implementations. Although I know that for people coming from say Python it may even be an upgrade.
← PreviousPage 6 of 7Next →