HNHacker News
TopNewBestAskShowJobs

m0th87

4,936 karma · joined April 21, 2009

Howdy. I'm the former CTO of The Muse (YC W12). Now I travel and build things for fun.

Email (ROT13™): fvzbafba ng tznvy qbg pbz

submissionscomments
m0th87··on Going faster than memcpy
https://www.intel.com/content/www/us/en/docs/intrinsics-guid...

Intel's docs are unfortunately spartan, but the guarantees around program order is a hint that this is what it does.

m0th87··on Going faster than memcpy
I see, thanks. I had assumed incorrectly that NT writes operated the same as NT accesses, where there is no dedicated cache.
m0th87··on Going faster than memcpy
There are no guarantees even if everything operates on the same core. Rust docs have some details: https://doc.rust-lang.org/stable/core/arch/x86_64/fn._mm_sfe...
m0th87··on Going faster than memcpy
I had interpreted GP to mean that you don’t slap on NTs for correctness reasons, rather you do it for performance reasons.
m0th87··on Going faster than memcpy
I work on optimizations like this at work, and yes this is largely correct. But do you have a source on this?

> or (more likely) go into just some special small subsection of it reserved for non-temporal writes only.

I hadn’t heard of this before. It looks like older x86 CPUs may have had a dedicated cache.

m0th87··on Building an AI server on a budget
That’s what I hope for, but everything that isn’t bananas expensive with unified memory has very low memory bandwidth. DGX (Digits), Framework Desktop, and non-Ultra Macs are all around 128 gb/s, and will produce single digits tokens per second for larger models: https://github.com/XiongjieDai/GPU-Benchmarks-on-LLM-Inferen...

So there’s a fundamental tradeoff between cost, inference speed, and hostable model size for the foreseeable future.

m0th87··on Lilygo T-Deck: 2.8-inch IPS LCD display, mini keyboard, and ESP32 processor
This is almost perfect for my needs (communication and location sharing in areas without phone signal.) But it's missing GPS/GNSS. I'm not sure how niche that use case is, so more broadly I wish Lilygo offered something akin to Raspberry Pi hats -- i.e. some way to add extensions.
m0th87··on BeagleV-Ahead RISC-V board
I’ve heard Beaglebone Blacks are great (never used them), but have to say the experience with Blue was awful. I had a hardware defect that’s apparently commonplace. It gave me the feeling (maybe unjustified) that there’s a low bar for slapping the Beaglebone label on a product. In contrast, none of my several RPi’s have had any hardware issues, and I’m pretty brutal with them.
m0th87··on Freakwan: A MicroPython driver for the SX1276 LoRa chip
I’m definitely interested! Was just looking over this code and wishing it were in rust or C.
m0th87··on Glassdoor not so anonymous
That's interesting, I didn't know they did that. But it could be better:

1) This alert doesn't show up at all on mobile.

2) IMO this should either affect the overall score or be displayed in search results as well, which is not currently the case: https://www.glassdoor.com/Search/results.htm?keyword=ZURU

m0th87··on Virgil: A fast and lightweight programming language that compiles to WASM
For what it’s worth, the person you’re replying to is one of the heavyweights of the rust community.
m0th87··on Adversarial Wordle
Just whipped up a (naive) solve in rust: https://gist.github.com/ysimonson/01a1dee41b1b5990c30568fd25...

It usually solves this in under 6 guesses. The guessing could be improved; at the moment it's random, but it could select for words with non-repeating letters to narrow down the search space faster.

m0th87··on AWS S3? Cloudflare R2? We think we know what's coming next
R2 is marketed as "one less than S3!"

I used the exact same tagline for a project open sourced in 2019: https://github.com/pachyderm/s2/

So there you go VCs, I can market as well as cloudflare. Money please!

m0th87··on Ketos: Lisp dialect scripting and extension language for Rust programs
I messed around with and contributed to this project a bit. The biggest challenge I saw in day to day usage was that line numbers aren't included in error messages: https://github.com/murarth/ketos/issues/11
m0th87··on Ketos: Lisp dialect scripting and extension language for Rust programs
I wrote up some rust low-level bindings for guile [1]. The problem is that Guile liberally uses setjmp/longjmp, which breaks rust destructors. It might be possible to fix this by wrapping every call the way rlua does [2], but I'm not familiar enough with Guile to know.

1: https://github.com/ysimonson/guile-sys

2: https://github.com/amethyst/rlua/issues/21

m0th87··on Show HN: Mongita is to MongoDB as SQLite is to SQL
For rust, I manage a graph database that can be embedded as a library: https://github.com/indradb/indradb/
m0th87··on Ask HN: Which book helped you understand the world?
Understanding Power by Chomsky had a big impact on me. I read it after this compelling blog post by Aaron Swartz (RIP): http://www.aaronsw.com/weblog/epiphany
m0th87··on Keeping your Go modules compatible
You're not alone. I've been writing go since before 1.0, and can handle modules/packages in _any other language_ fine, yet go's regularly leaves me stumped.

A little while ago we were hitting yet another issue with dependencies related to version pinning at work. I tried to divine what the disparate versions mean, and came up with this flow chart from a legalistic reading of stack overflow issues [1] and the go modules doc [2]:

  has the package opted into go modules (i.e. is there a go.mod?)
    yes
      does the repository use semver?
        yes
          is the major version <= 1?
            yes
              => normal versioning, e.g. github.com/stretchr/testify v1.3.0
            no
              => when importing, we need add /vN at the end, e.g., import "github.com/my/mod/v4", and in go.mod it will behave like github.com/my/mod/v4 v4.1.0
        no
          => pseudo-versioning will be used, e.g. github.com/kolo/xmlrpc v0.0.0-20190717152603-07c4ee3fd181
    no
      does the repository use semver?
        yes
          is the major version <= 1?
            yes
              => pseudo-versioning will be used, e.g. github.com/kolo/xmlrpc v0.0.0-20190717152603-07c4ee3fd181
            no
              => version will be marked as incompatible, e.g. github.com/zeromq/goczmq v4.1.0+incompatible
        no
          => ???
I still don't know if this is right. But that's not really the point. I think the go authors painted themselves into a corner with such an anemic initial release. Now that they're trying to address shortcomings, the complexity is blowing up to handle the very large/diverse ecosystem. It reminds me a lot of java around 1.4 when they added in generics. In the long-run it was the right move, but man was it painful.

1: https://stackoverflow.com/a/57372286 2: https://github.com/golang/go/wiki/Modules

m0th87··on Comparison of C++17, Go, and Java for a next-generation sequencing tool
It's not well known, because it's not true, at least not absolutely. Speed could either mean latency or throughput. Reference counting is almost always worse than GC at throughput, but is usually better for latency.
m0th87··on QUIC – Will It Replace TCP/IP?
Yes, though this is arguably a big reason why SCTP didn't take off, which is similar to QUIC in a lot of ways (there is SCTP over UDP, but it was a second class citizen until WebRTC.)
m0th87··on Writing an OS in Rust: Async/Await
Is it possible to context switch between userspace processes directly, without going through the kernel, i.e. a kind of fast, inter-process cooperative multitasking? I know earlier operating systems used inter-process cooperative multitasking, but I'm guessing they still went through the scheduler?

I was trying to figure out if QNX does this with `MsgSend`, as QNX is renowned for being a fast microkernel, but it wasn't clear to me. According to Animats, "There's no scheduling delay; the control transfer happens immediately, almost like a coroutine. There's no CPU switch, so the data that's being sent is in the cache the service process will need." [1] According to wikipedia, "If the receiving process is waiting for the message, control of the CPU is transferred at the same time, without a pass through the CPU scheduler." [2]

It seems like `MsgSend` circumvents the scheduler, but does it circumvent context switching to the kernel entirely too?

1: https://news.ycombinator.com/item?id=9872640

2: https://en.wikipedia.org/wiki/QNX#Technology

m0th87··on Protobuffers Are Wrong
I maintain a couple of protobuf-based libraries, and the issue I've seen with its anemic type system is that it inevitably creates an impedance mismatch between itself and the host language's type system. To make the library usable, you end up having to wrap the autogenerated code in a bunch of boilerplate, which defeats one of the major selling points of gRPC/protobuf in the first place.
m0th87··on The Essential Guide to Electronics in Shenzhen (2016) [pdf]
You can also just use a phone plan with roaming, as they aren't affected by the firewall. The guide says it's pricey, but Google Fi doesn't charge extra for roaming. I got around China last year with it, including some fairly remote parts.
m0th87··on Hammerspoon – macOS automation with Lua
In case it's helpful, here's how I use hammerspoon:

* As a replacement for the classic caffeine app. [1]

* To provide shortcuts for window managements. [2]

* To shutdown bluetooth on sleep. Otherwise, devices I have setup to pair with both my mac and phone will tend to pair with the mac, even though it's asleep. [3]

1: https://gist.github.com/heptal/50998f66de5aba955c00

2: https://github.com/miromannino/miro-windows-manager

3: https://gist.github.com/ysimonson/fea48ee8a68ed2cbac12473e87...

m0th87··on Americans Greatly Overestimate U.S. Gay Population
4.5% self-report as LGBT. That's an important distinction to make, and I too would be surprised if it's accurate.
m0th87··on The Collapsing Crime Rates of the ’90s Might Have Been Driven by Cellphones
Meanwhile, the economists behind Freakonomics argue that it was caused by the legalization of abortion: http://freakonomics.com/2005/05/15/abortion-and-crime-who-sh...

I don't have a strong opinion on whether cell phones or abortion or anything else caused the collapse in crime, but do feel like the theories you'll read about the most (assuming you're not an academic in the social sciences) are the ones that make for the most interesting headlines.

m0th87··on For Better Computing, Liberate CPUs from Garbage Collection
The point with weakrefs, though, is that they still require developer intervention.

Also, you can use most memory management facilities in Rust (including reference counting) without `unsafe`.

m0th87··on Janet – A dynamic language and bytecode VM
It looks like it uses setjmp/longjmp for error handling. Is there a way to ensure Janet never calls setjmp/longjmp? If not, it won't be embeddable in Rust (and maybe C++?) due to RAII.
m0th87··on YC Interviews in NYC
I remember going to YCNYC nearly 10 years ago, and pg made the argument that anyone starting a company should just move to the Bay Area because it was that much better. I guess NYC has come a long way, or YC has, or both :)
m0th87··on Show HN: Bon – programming language designed for simplicity, performance, safety
Rust's borrow checker is zero-cost because it's not doing runtime analysis. But it's not a garbage collector, unless you're using Steve Klabnik's "static garbage collector" terminology [1]. Reference counting is definitely not zero cost. It reduces GC runtime latency for most workloads, but not to zero, and it does so at the cost of reduced bandwidth.

1: https://words.steveklabnik.com/borrow-checking-escape-analys...

Page 1 of 21Next →