HNHacker News
TopNewBestAskShowJobs

noam_k

156 karma · joined October 4, 2022

submissionscomments
noam_k··on Git rebase -I is not that scary
I wouldn't say it's wrong.

My preference, however, is creating a fixup commit and using rebase to squash it into the old one.

Edit: A sibling comment mentioned "git history fixup" which I'll have to try out.

noam_k··on Show HN: A (marginally) useful x86-64 ELF executable in 301 bytes
Is it really not ELF? The file starts with the \x7FELF magic, but I'm not by my laptop to see what `file btry` outputs.
noam_k··on System76 on Age Verification Laws
You might want to take a look at differential privacy. It takes an unintuitive amount of noise to make the system useless.

You also need to account for how "easy" it is to de-anonymize a profile.

(Sorry I don't have links to sources handy.)

noam_k··on Ask HN: Anyone else struggle with how to learn coding in the AI era?
I'd like to draw a parallel to carpentry:

A carpenter uses tools to shape wood into furniture. Each tool in the toolbox has different uses, but some are more efficient than others. For example, a table saw lets the carpenter cut more quickly and accurately than a hand saw. Nobody would say "that's not a real carpenter, he cheats by using a table saw".

A carpenter can also have an assistant (and I'm specifically not talking about an apprentice) who can help with certain tasks. The assistant might be trained by someone else and know how to perform complex tasks. When the carpenter builds something with the assistants help, is that considered a team effort? Does the carpenter need to take responsibility for the assistants mistakes, or the trainer? Who gets credit for the work?

I don't have answers for these questions, but I think the parallel to software is straightforward: we have a new tool (assistant) that's available, and we're trying to use it effectively. Perhaps it's going to replace some of our older tools, and that's a good thing! Some of us will be lazy and offload everything to it, and that's bad.

I do think that learning the fundamentals is as necessary as ever, and AI is a great tool for that as well.

(Disclaimer: I've been programming for about 15 years, and haven't integrated AI into my workflow yet.)

noam_k··on Ask HN: What are the best engineering blogs with real-world depth?
https://lcamtuf.substack.com/
noam_k··on Lisp: Notes on its Past and Future (1980)
I'm not sure what exactly you're referring to, but one avenue to implement AI is genetic programming, where programs are manipulated to reach a goal.

Lisp languages are great for these manipulations, since the AST being manipulated is the same data structure (a list) as everything else. In other words, genetic programming can lean into Lisp's "code is data" paradigm.

As others mentioned, today everything is based on neural networks, so people aren't learning these other techniques.

noam_k··on Interstellar Mission to a Black Hole
That would be cool.

I read somewhere that a black hole with the mass of the moon will absorb about as much cosmic radiation as it emits Hawking radiation. This is a fine line between "the black hole disappears before we can examine it" and "oops, we got eaten by a black hole".

noam_k··on Weird CPU architectures, the MOV only CPU (2020)
I'm surprised the article doesn't mention OpenASIP [0], which not only helps you define the architecture, but also provides RTL synthesis and a working (if not always useful) compiler.

[0] http://openasip.org/

noam_k··on No adblocker detected
Can anyone explain why the ID of the div is modified?
noam_k··on Homomorphically Encrypting CRDTs
I think the issue here is that the server would have to store a copy of the register per peer, as it can't calculate which one is the most recent. Using FHE allows the server to hold a single copy.

In other words the server could forward and not store if all parties are always online (at the same time).

noam_k··on My AI skeptic friends are all nuts
This sounds like the "only following orders" argument.

_If_ developers _collectively_ were to quit jobs that don't line up with their morals and ethics, we _might_ see a change. I'm not saying this is an easy decision to make, and I definitely don't want to judge someone who decides to take a higher paying job, but there's potential here to shift the direction AI is taking.

noam_k··on Ask HN: Memory-safe low level languages?
You may want to look at Lua[0]. It's often used as an embedded scripting language in larger projects (and games), has good performance, is memory safe, and is extensible in the same manner as Python (write your performance bottleneck in C/C++).

I don't remember specifics, but there are some odd footguns to look out for.

[0] https://www.lua.org/

noam_k··on How long does it take to create a new habit? (2015)
I happen to be taking a Team Lead course, and forming habits came up yesterday. 21 days weren't mentioned explicitly, the time frame was "a few weeks". We were given 6 criteria when forming a habit:

1. Tangible - you need to pick a tangible action that is observable. If you're trying to fix a part of your behavior you can't pick "I'll pay more attention" as a habit to correct yourself, instead you should write a note or say some phrase.

2. Up to me - don't form a habit that requires outside factors. If you want to start jogging, don't ask your neighbor to jog with you. Each time he's not available, you'll have an excuse not to jog.

3. Swallow the frog - don't push it off. This isn't a well defined criteria, the idea is to minimize excuses (like #2).

4. Daily - a habit needs to be formed by taking action every day.

5. Trigger - your action needs a trigger. This can be an internal (feeling hungry), external (a timer on your phone), or contextual (every morning, every time you walk into a conference room).

6. New - it's very hard to form a habit if you've already tried and failed. Pick an action that you haven't already tried.

There was also an important note that changing behavior often requires multiple steps. The instructor gave the example of using dental floss. It's hard to go from nothing to flossing every day, so break it into:

1. Every time you go into the bath room in the evening, pick up the dental floss, and put it down.

2. After picking up the floss becomes a habit, cut a piece of floss, and throw it out.

3. After cutting the floss becomes a habit, floss a few teeth.

And so on.

noam_k··on What would happen if we didn't use TCP or UDP?
Is this a real issue? SCTP runs over IP, so unless your talking about firewalls and such, the support should be there.

Edit: a quick search showed that NAT traversal is an issue (of course!)

noam_k··on JSON has become today's machine-readable output format on Unix
But then you can't tell the difference between 0.12 and 0.00012.

Unless you're suggesting to use the strings "0" and "00012", at which point you could just use a byte string with the utf8 encoding of the value.

noam_k··on Numbers Are Leaves
Not a professional mathematician, but you have the benefit of set operations mapping to functions you're familiar with.

For example, set union becomes the max function.

noam_k··on Egoless Engineering
I heard this phrase in college and it stuck: "when all you have in your toolbox is a hammer, every problem looks like a nail".
noam_k··on You are probably sitting down for too long
When my daughter is standing, I tell her to sit down. When she slouches in her chair, I tell her to sit up.

(I'm American, and curious if British have similar/differing expressions.)

noam_k··on A High-Level Technical Overview of Homomorphic Encryption
Amazing summary, Jeremy!

One nitpick is regarding the double-CRT: you are referring to the RNS encoding, when the original paper[0] uses the term to talk about how polynomials are stored for fast computation. It's a nice philosophical view of decomposing the polynomial Φm(X) into products X − ζi the same way that the integer modulus Q is decomposed into primes. So it's more like one CRT on the coefficients, and another implemented as a DFT.

[0] https://eprint.iacr.org/2012/099

noam_k··on HTML Attributes vs. DOM Properties
Good point, but HTML already has a workaround by using strings:

<div onClick="func()">...</div>

Now, I'm not a JS developer, so my opinion shouldn't count for much, but that looks like a much less usable standard to me.

noam_k··on How Matzo Is Made
This is a somewhat generally accepted theory. (I don't have sources handy, though.)

What makes modern matzah hard is the flour/water ratio. When more water is added, the bread is also softer. The issue with soft matzah is that it spoils quickly, and if you need bread for 7 days you need to make matzah during Passover.

Okay, you say, so make some matzah on Passover, right? But matzah is tricky, because if enough time passes between mixing the water and flour, it is considered leavened. (This is a religious definition, not a physical one.) Merely owning leavened bread is prohibited, so European Jews made dry matzah to prevent unfortunate slip-ups.

This custom started within the last few hundred years (again, I don't have sources, so I'm not sure about exact dates). Yemenite Jews still use soft matzah.

Edit: part of the Passover story mentions Hillel, who would wrap matzah around his Passover offering and bitter herbs. This definitely indicates soft matzah, but is much later than the Exodus itself.

noam_k··on Improvements to static analysis in GCC 14
Very cool stuff!

I haven't done much C development lately, so I'm curious how often `strcpy` and `strcat` are used. Last I checked they're almost as big no-nos as using goto. (Yes, I know goto is often preferred in kernel dev...) Can anyone share on how helpful the c-string analyses are to them?

noam_k··on Simpson's paradox
Well, if we're going to nitpick, light has zero rest mass[0], but does have mass while in motion. This is how solar sails can work, since they use the momentum from the photons.

[0] https://en.m.wikipedia.org/wiki/Invariant_mass

noam_k··on Why is Prettier rock solid?
I can't agree more, and I can't disagree more. There's a great deal to be learned by experimenting yourself.

My workflow is:

* Learn the concept

* Implement it

* Research prior art

* Throw away my first implementation and rewrite it properly

(Edit: formatting)

noam_k··on Zed Editor: All Occurrences Search from 1s to 4ms
I didn't delve too deeply into the code in the post, but no, I wouldn't say that this is example of zero-cost abstractions at all.

Zero cost can come in two forms (that come to my mind right now, feel free to comment with more): runtime and memory. You mentioned dynamic dispatch (when calling a vtable method) that _can_ be zero cost when using generics, the compiler will "inline" the type and know what method is being called. Note that there is a compile-time trade-off here, and the binary size would be larger than using `&dyn` (a pointer to a vtable).

To illustrate memory zero-cost, consider an optional boolean argument to a program. A boolean has two valid states, but used 8 bits of memory, defining `Option<bool>` would naively use one byte for the discriminant, and another for the value. Rust uses the niche optimization[0] to promise that this type will only use one byte of memory.

[0]https://google.github.io/comprehensive-rust/smart-pointers/b...

noam_k··on Hacking a CTF: Do not use ECB mode for encryption
I recommend going through the CryptoPals[0] challenges. I'm halfway and they really beat into you the problems with ECB.

[0]https://cryptopals.com/

noam_k··on Par: Paragraph reformatter, vaguely similar to fmt, but better
My preference is 100 characters. I find it usually takes up half the screen, allowing split screen editing (on modern screen sizes).

But while on the subject, I can't help bringing up the QEMU coding style[0]:

> Some people like to tile their 24” screens with a 6x4 matrix of 80x24 xterms and use vi in all of them. The best way to punish them is to let them keep doing it.

[0]: https://qemu-project.gitlab.io/qemu/devel/style.html#line-wi...

noam_k··on Intel, Samsung, and TSMC Demo 3D-Stacked Transistors
In addition to the answers already given, there are defects during the process that are more likely to render your chip useless the larger your chip is. This is true for smaller chips as well, and often the design handles a defunct component, but you prefer minimizing defects per chip.
noam_k··on Why you can't divide by zero
> 1/0 = 0 is a totally sensible convention

Except that for all other numbers we have 1/x * x = 1, while 0*0 = 0. Defining division by zero this way breaks existing rules.

noam_k··on Enums in Rust – and why they feel better
I think what you want is to enable box_patterns[0]. I have no idea why it isn't stable yet.

[0] https://doc.rust-lang.org/beta/unstable-book/language-featur...

Page 1 of 2Next →