HNHacker News
TopNewBestAskShowJobs

nemo1618

4,299 karma · joined March 20, 2012

Director of the Sia Foundation.

https://github.com/lukechampine

https://twitter.com/lukechampine

http://lukechampine.com

submissionscomments
nemo1618··on Be careful with Go struct embedding
yup, less than 24 hours after writing that comment, I found myself embedding a struct so that I could override one method in a test, haha
nemo1618··on Be careful with Go struct embedding
Over the course of ~10 years of writing Go, my ratio of "embedding a struct" to "regretting embedding a struct" is nearly 1:1.

I do not embed structs anymore. It is almost always a mistake. I would confidently place it in the "you should be required to import 'unsafe' to use this feature" bin.

nemo1618··on Eleven Music
I'm very interested in this too. We're beginning to see models that can deeply understand a single image, or an audio recording of human speech, but I haven't seen any models that can deeply understand music. I would love to see an AI system that can iteratively explore musical ideas the same way Claude Code can iterate on code.
nemo1618··on Do variable names matter for AI code completion? (2025)
Time for Hungarian notation to make a comeback? I've always felt it was unfairly maligned. It would probably give LLMs a decent boost to see the type "directly" rather than needing to look up the type via search or tool call.
nemo1618··on Ask HN: What are you working on? (July 2025)
I'm dipping my toes into decompilation -- specifically, decompiling Super Smash Bros. Melee. Once you get into the groove, it's kinda addicting! Now that I've done a few functions by hand, I'm wondering how to best leverage AI to speed up the process.

Come decompile with us! https://github.com/doldecomp/melee

nemo1618··on Parsing Protobuf like never before
There are two ways to look at this.

First is that, if the parsing library for your codec includes a compiler, VM, and PGO, your codec must be extremely cursed and you should take a step back and think about your life.

Second is that, if the parsing library for your codec includes a compiler, VM, and PGO, your codec must be wildly popular and adds enormous value.

nemo1618··on A list is a monad
I think this adds more confusion than it removes.

A list is not a monad. A list is a data structure; a monad is more like a "trait" or "interface." So you can define a List type that "implements" the monad interface, but this is not an inherent property of lists themselves. That's the sense in which a list "is a" monad: the OOP sense.

Haskell's List monad provides a model for nondeterminism. But that certainly isn't the only way List could satisfy the monad interface! It was a deliberate choice -- a good choice, possibly the best choice, but a choice nonetheless.

nemo1618··on The Fed says this is a cube of $1M. They're off by half a million
> Bill, who lives near Aylesbury, said the reason for the request last Wednesday would be revealed in 23 years.

...well?

nemo1618··on Weird Expressions in Rust
Many people aren't aware that you can use key: val declarations in arrays
nemo1618··on Weird Expressions in Rust
I wonder, what's the "weirdest" expression in Go? Here's one:

   type Foo struct{}
   func (Foo) Bar() { println("weird...") }
   func main() {
    ([...]func(){^^len(`
   
   
   `): (&Foo{}).Bar})[cap(append([]any(nil),1,2,3))]()
   }
nemo1618··on Consider Knitting
Knitting is definitely the O.G. fidget toy for neurodiverse women
nemo1618··on Why Algebraic Effects?
I see two downsides. Looking at this snippet:

    my_function (): Unit can AllErrors =
      x = LibraryA.foo ()
      y = LibraryB.bar ()
The first thing to note is that there is no indication that foo or bar can fail. You have to lookup their type signature (or at least hover over them in your IDE) to discover that these calls might invoke an error handler.

The second thing to note is that, once you ascertain that foo and bar can fail, how do you find the code that will run when they do fail? You would have to traverse the callstack upwards until you find a 'with' expression, then descend into the handler. And this cannot be done statically (i.e. your IDE can't jump to the definition), because my_function might be called from any number of places, each with a different handler.

I do think this is a really neat concept, but I have major reservations about the readability/debuggability of the resulting code.

nemo1618··on A 2030 Morning Routine
I wonder: if we get superintelligence before 2030, do you think we should revive him ASAP, or wait and do it in 2030?
nemo1618··on ChatGPT now performs well at GeoGuesser
Neat, thanks for doing this!
nemo1618··on The Bitter Prediction
Thank you for sharing this :)
nemo1618··on Faster interpreters in Go: Catching up with C++
Is computed goto used for anything other than interpreter loops? Because if not, I would rather have a special "it looks like you're trying to implement an interpreter loop" case in the compiler than add new syntax.
nemo1618··on Roc rewrites the compiler in Zig
my hot take: the language should accept \, but formatters should replace it with λ
nemo1618··on The humble for loop in Rust
> Why is map so much faster? I am not sure. I suspect with the map() option the Rust compiler figures out it can avoid allocations altogether by simply writing over the original vector, while with the loop it can't. Or maybe it's using SIMD? I tried to look in the compiler explorer but I'm not competent enough yet to figure it out. Maybe someone else can explain!

Yep, it's due to SIMD -- in the assembly for `using_map`, you can spot pcmpeqd, movdqu, and psubd, while `using_loop` doesn't have any of these.

nemo1618··on Advent of Code 2024
I did this, and it's been very satisfying! Here's where I'm at now: https://www.youtube.com/watch?v=r99-nzGDapg
nemo1618··on Fun with Go Iterators
ah, that's what it's called! I did this in my compile-to-Go language, but I didn't know the name for it: https://github.com/lukechampine/ply?tab=readme-ov-file#suppo...
nemo1618··on Ask HN: What are you working on (September 2024)?
I've been working on a tool for identifying samples in sample-based music, specifically vaporwave. I spent a long time building a cool TUI for it, but I realized many people aren't comfortable with TUIs, so just yesterday I finished the MVP of a web version. Here it is: https://barbershop.lukechampine.com

Try it with this classic: https://vektroid.bandcamp.com/track/420

nemo1618··on iPhone 16 Pro and iPhone 16 Pro Max
These days, most of the photos I take are with disposable cameras that I buy whenever I go on a trip. Despite the name, the high cost of the camera makes each shot more precious, and I much prefer the low-fi film grain style to whatever black magic is going on in my smartphone sensor. Also, the novelty/nostalgia makes people smile when you ask them to take a picture of you. And then there's the anticipation of sending the film off for development, not knowing what will turn out well and what will be an underexposed mess. Highly recommended.
nemo1618··on Go is my hammer, and everything is a nail
One of the most important qualities of Go is that it is actually possible to fully understand the language -- in the sense that you never see a snippet of Go code and think "wtf, you can do that?" or "hang on, why does that work?"

Getting to that point takes many years, to be sure. But the language is simple enough, and changes slowly enough, that it is not an unrealistic goal -- the way it would be in C++, or Rust, or just about any other mainstream language.

nemo1618··on What's in my location history?
I was very annoyed when Google recently announced they were deprecating Timeline for Web: https://support.google.com/maps/answer/14169818?visit_id=638...

They frame it positively, of course ("now your data lives on your device!") but AFAICT it's all downside. I can't browse my location history on a nice big screen, and (very annoyingly) the app does not let you view your aggregate history over the span of a month or year -- only a single day. Plus, if you lose your phone, you lose all that precious data, unless you configure the app to automatically sync your history to Google's cloud...wait what? Wasn't not doing that the whole point? Just baffling.

nemo1618··on One Million Checkboxes
I added a Mac keyboard shortcut, so anywhere I type "shrg" it expands to ‾\_(ツ)_/‾

If I need an escaped version, that's "shrgg": ‾\\\_(ツ)\_/‾

nemo1618··on Show HN: Roast my SQLite encryption at-rest
Ha, you're right, I even have benchmarks in the README showing 0 allocs/op. Nice. (Sorry for doubting you, past-self!)

In the past I've implemented a form of the write-buffering you describe -- it was not fun. But it was a lot more important in that context, because flushing a write meant uploading many MB to remote servers. With 4 KB pages flushed locally, I'd wager it's not worth it.

nemo1618··on Show HN: Roast my SQLite encryption at-rest
Hey, it's my Adiantum package! How's the performance? Revisiting the API now, I see that Encrypt and Decrypt return newly-allocated slices, which is unfortunate. Should I add Append variants that don't force an allocation?
nemo1618··on NYC startup founder Sophia D'Antoine dies after being struck crossing street
Sophia and I were classmates at RPI. She was brilliant and funny and she carried herself with a refined lightness and dignity that is rarely seen these days, like gravity didn't pull on her as hard as the rest of us. I am crushed to hear of her passing at such a young age. Rest in peace, Sophia.
nemo1618··on Write a Letter to Your Future Self
Over the course of 13 years, I wrote 365 Future Emails to my 2020 self, one for each day of the year. It was pretty interesting to see myself "age" in fast-forward like that. The first handful of letters were pretty lame -- very short, lolsorandom-style stuff. Towards the end I was using it more like a journal, often writing many paragraphs per email.

What did I glean from it all? I don't know. It wasn't as mindblowing as I had hoped, frankly. Mostly I was struck by the sad reality that I had failed to predict what would be interesting to my future self. It reminded me of how, as a teenager, I had filled many pages of my journal talking about an MMORPG I was addicted to, rather than how I felt towards my siblings, or my spiritual beliefs, or a funny joke I heard at school, etc. Another sad irony was that the older I got, the more I wrote -- but when I read the letters, the more recent they were, the less interested I was in them. I wanted to read thousands of words written by my 15-year-old self, but all I got was a few sentences. Oh well. Maybe those longer passages will be interesting to 40-year-old me.

nemo1618··on The road to hell is paved with asphalt
> road damage scales as the fourth power of the axle weight

Is there a theoretical basis for this? It looks like the "fourth power law" comes from an empirical test conducted in the 50s: https://en.wikipedia.org/wiki/AASHO_Road_Test

However, that article says:

> ...critics point out that its data is only valid under the specific conditions of the test with regard to the time, place, environment, and material properties present during the test. Extrapolating the data to different situations has been "problematic".[3] Other studies have attempted to refine the results, either through further empirical studies, or by developing mathematical models, with varying success.

I have some intuition for why certain physical systems would scale quadratically or cubically, but where on earth is the quartic scaling coming from here??

← PreviousPage 3 of 30Next →