HNHacker News
TopNewBestAskShowJobs

evmar

6,887 karma · joined June 7, 2011

https://neugierig.org

evan.martin@gmail.com

My posts on HN: https://news.ycombinator.com/from?site=neugierig.org

submissionscomments
evmar··on Theseus, a Static Windows Emulator
[post author] I went down some similar paths in retrowin32, though 32-bit x86 is likely easier.

I was also surprised by how much goop there is between startup and main. In retrowin32 I just implemented it all, though I wonder how much I could get away with not running it in the Theseus replace-some-parts model.

I mostly relied on my own x86 emulator, but I also implemented the thunking between 64-bit and 32-bit mode just to see how it was. It definitely was some asm but once I wrapped my head around it it wasn't so bad, check out the 'trans64' and 'trans32' snippets in https://github.com/evmar/retrowin32/blob/ffd8665795ae6c6bdd7... for I believe all of it. One reframing that helped me (after a few false starts) was to put as much code as possible in my high-level language and just use asm to bridge to it.

evmar··on Theseus, a Static Windows Emulator
It depends on what results you’re expecting! Relative to an interpreter, even the simplest unoptimized translation of that code is already significantly more efficient code at runtime.

In the post there is a godbolt link showing a compiler inlining a simple add, but a real implementation of x86 add would be much more complex.

I have read other projects where the authors put some effort into getting exactly the machine code they wanted out. For example, maybe you want the virtual regs.eax to actually exist in a machine register, and one way you might be able to convince a compiler to do that is by passing it around as a function parameter everywhere instead as a struct element. I have not investigated this myself.

evmar··on How to make Firefox builds 17% faster
I see, I might be confused by the terminology. "clobber" to me suggests intentionally trying to throw away cached results (clobbering what you have), but it sounds like you might just use it to mean builds where you don't have any existing build state already present.
evmar··on How to make Firefox builds 17% faster
I’m not too familiar with Firefox builds. Why are clobber builds common? At first glance it seems weird to add a cache around your build system vs fixing your build system.
evmar··on Ninja is a small build system with a focus on speed
To be honest, it's not clear to me why other systems are not faster. Ninja is relatively straightforward but also not too clever.

Now that I think about it, I did write more about some of the performance stuff we did here: https://aosabook.org/en/posa/ninja.html Looking back over that, I guess we did do some lower-level optimization work. I think a lot of it was just coming at it from a performance mindset.

evmar··on Ninja is a small build system with a focus on speed
[ninja author] My first post about Ninja goes into this: https://neugierig.org/software/chromium/notes/2011/02/ninja....
evmar··on Ninja is a small build system with a focus on speed
[ninja author] I did some thinking about this problem and eventually revisited with what I think is a pretty neat solution. I wrote about it here: https://neugierig.org/software/blog/2022/03/n2.html
evmar··on Gzip decompression in 250 lines of Rust
I had a similar experience implementing simd instructions in my emulator, where I needed to break apart a 64-bit value into four eight-bit values, do an operation on each value, then pack it back together. My first implementation did it with all the bit shifts you’d expect, but my second one used two helpers to unpack into an array, map on the array to a second array, and pack the array again. The optimized output was basically the same.
evmar··on Wine 11 rewrites how Linux runs Windows games at kernel with massive speed gains
Hey thanks! I don't mean to hijack this great wine news with my own project, but since you asked, the top of the post has links to more. I will fix the link.
evmar··on Wine 11 rewrites how Linux runs Windows games at kernel with massive speed gains
I don't know the technical details, but the kernel docs say "It exists because implementation in user-space, using existing tools, cannot match Windows performance while offering accurate semantics." https://docs.kernel.org/userspace-api/ntsync.html
evmar··on Wine 11 rewrites how Linux runs Windows games at kernel with massive speed gains
If you're interested in technical notes on how the WoW64 thing works, I dug into Wine and implemented a similar thing in my (far inferior) emulator and wrote about it here, including some links to some Wine resources: https://neugierig.org/software/blog/2023/08/x86-x64-aarch64....
evmar··on We rewrote our Rust WASM parser in TypeScript and it got faster
By the way, I did a deeper dive on the problem of serializing objects across the Rust/JS boundary, noticed the approach used by serde wasn’t great for performance, and explored improving it here: https://neugierig.org/software/blog/2024/04/rust-wasm-to-js....
evmar··on Tailscale Peer Relays is now generally available
They wrote a blog post addressing this concern: https://tailscale.com/blog/free-plan
evmar··on Ghidra by NSA
Where can I learn more about the Windows decompilation community? (This is an area I kind of work in, and I am interested in participating!)
evmar··on The consequences of task switching in supervisory programming
The term he’s searching for is possibly “intellectual control”: https://www.georgefairbanks.com/ieee-software-v36-n1-jan-201...
evmar··on Toys with the highest play-time and lowest clean-up-time
Exact same for me! Just ten minutes ago my son opened his Xmas present, his first box of TubeLox. My expectations and hopes are high but he is currently distracted by the flashier presents.
evmar··on Pro-democracy HK tycoon Jimmy Lai convicted in national security trial
This comment feels in bad faith. There are ~340 million Americans and you draw evidence about all of them from this one thing? It's not even an insight into its single American author. It was a quick weekend hack.

The purpose of the thing is to try to put things into perspective, like "Portugal is about the size of Indiana", or "California's economy is about the size of Germany". It compares three numbers, two of which are not money!

evmar··on Pro-democracy HK tycoon Jimmy Lai convicted in national security trial
I took this morning to gather the data again and sanity check it further, so please try again!

(I guess Wikipedia and the UN call it "the Czech Republic" so my update also renamed it...)

evmar··on Pro-democracy HK tycoon Jimmy Lai convicted in national security trial
Since it's so germane, I'll share my little widget that compares EU countries to US states on various metrics: https://evmar.github.io/states/
evmar··on My Favorite Math Problem
From the title, I first imagined what my favorite math problem was, then clicked on the article -- and they had the same one!

For me, the reason this problem is cool is that it exemplifies mathematical thinking: superficially the problem is about placing individual dominos but the solution is about seeing the underlying structural properties. Similar to Euler realizing the bridges in Königsberg were a graph.

evmar··on Palantir Thinks College Might Be a Waste. So It's Hiring High-School Grads
My first job was a dotcom startup who heard via social connections I was a bright high school student who could program. I think I was paid $15/hr to write Windows GUI code. In retrospect I think they were just happy for the cheap labor and I didn’t know any better. There was no mentorship or any other useful growth to make up for the low pay.
evmar··on Apple will phase out Rosetta 2 in macOS 28
From the OP: "Beyond [the two-year] timeframe, we will keep a subset of Rosetta functionality aimed at supporting older unmaintained gaming titles, that rely on Intel-based frameworks."
evmar··on WASM 3.0 Completed
It looks like memories have to be declared up front, and the memcpy instruction takes the memories to copy between as numeric literals. So I guess you can't use it to allocate dynamic buffers. But maybe you could decide memory 0 = heap and memory 1 = pixel data or something like that?
evmar··on Bill Atkinson's psychedelic user interface
The state of Oregon is experimenting along these lines:

https://www.oregon.gov/oha/ph/preventionwellness/pages/psilo...

"A client may only access psilocybin at a licensed service center during an administration session in the presence of a trained, licensed facilitator."

evmar··on Dear High Schoolers, Time Is Precious
For this advice, that is the best place to share it from. They're saying even by age 20 it's already the case that the effort was wasted.
evmar··on (On | No) Syntactic Support for Error Handling
Most discussions of language features immediately fall into the politician's syllogism:

https://en.wikipedia.org/wiki/Politician%27s_syllogism

I appreciate the Go language's general sense of conservatism towards change. Even if you're not a fan of it, I think it's admirable that there is a project staking out a unique spot in the churn-vs-stability design space. There are plenty of other projects that churn as fast as they can, which also has its pros and cons, and it's great to be able to see the relative outcomes.

PS: it's kind of hilarious how the blog post is like "there are hundreds of proposals and miles of detailed analysis of these", vs the commenters here who are like "I thought about this for five minutes and I now have an idea that solve everything, let me tell you about it".

evmar··on Show HN: I486SX_soft_FPU – Software FPU Emulator for NetBSD 10 on 486SX
I noticed math_emulate.c comes from Linux (it even has a " * (C) 1991 Linus Torvalds" bit on it). I was wondering what the license on that code is. It looks like Linux adopted GPL in 1992 so maybe this copy predates that, but it was under some other non-BSD license before that.
evmar··on Mistral OCR
I added a pic to the original comment, sorry for not being clear!
evmar··on Mistral OCR
I am pretty sure it added a kasrah not present in the input on the 2nd to last line. (Not saying it's not super impressive, and also that almost certainly is the right word, but I think that still means not quite "perfect"?)
evmar··on Mistral OCR
I noticed on the Arabic example they lost a space after the first letter on the third to last line, can any native speakers confirm? (I only know enough Arabic to ask dumb questions like this, curious to learn more.)

Edit: it looks like they also added a vowel mark not present in the input on the line immediately after.

Edit2: here's a picture of what I'm talking about, the before/after: https://ibb.co/v6xcPMHv

← PreviousPage 2 of 27Next →