Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
mcountryman
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
4 ms
·
1.
▲
by
mcountryman
6y ago
I had to picture someone opening a window and throwing it into orbit haha
2.
▲
by
mcountryman
6y ago
Not a financial expert however, Citadel is a market maker rather than just a hedge fund like Melvin. Money is lost when a retail investor holds onto their shares not just when the stock price rises.
3.
▲
by
mcountryman
6y ago
I'm a little short on time so I didn't read through all of it but, comptime generics sounds similar to how rust compiles generics and comptime parameters are similar to const fns although zig appears to have more control over what
4.
▲
by
mcountryman
6y ago
I completely forgot stdout handle is in the PEB! Thanks! After learning how the windows x64 syscall calling convention works I got it working on win10. https://i.imgur.com/ErHU7Kr.png https://github.com/mcou
5.
▲
by
mcountryman
6y ago
Very well optimized inlined functions? I didn't actually check the zig std source. I was referring to what I was seeing in radare2 :)
6.
▲
by
mcountryman
6y ago
Yeah my choice of words wasn't great. It seams as if the zig std acts as a macro rather than a wrapper. That could just be the aggressive optimization though
7.
▲
by
mcountryman
6y ago
@Edit2 I saw that, and that's pretty cool in regards to how the zig std is a wrapper rather than a rewrite. Although, if we were optimizing for size in this case it might be more optimal to have only one entry in the import table :D
8.
▲
by
mcountryman
6y ago
Between a 40b strcmp method (If I had/if it was more widely supported I could use sse4.2 strcmp) and ~74b of resolving said exports a couple syscalls sounds pretty nice provided the context switch isn't more expensive than resolvi
9.
▲
by
mcountryman
6y ago
I thought of that but couldn't figure out how to get the syscalls for my system and the assembly around it. Being on win10, kernel32 links to api-console-... and I haven't been able to find it on my system. A few online download
10.
▲
by
mcountryman
6y ago
In order to get that to 1Kb you would probably have to drop the `.idata` section and resolve syscalls from the PEB like I did.
11.
▲
by
mcountryman
6y ago
Ah, yeah, I wasn't trying to shrug off the usefulness of zig, sorry. I think when it comes to compile size zig does it a bit better due to it's smaller std although, when compiling rust with just a link to libc and a printf call
12.
▲
by
mcountryman
6y ago
Just for fun, the compiled rust exe has 480 non-zero bytes, the zig exe had 512 bytes.
13.
▲
by
mcountryman
6y ago
I couldn't get it working and was familiar with the `llvm_asm!` syntax. Although, I may have to go back and switch it around again.
14.
▲
by
mcountryman
6y ago
I linked these guys here https://github.com/pts/pts-tinype . They managed to do something similar with the PE headers, and I might have to try that next although I'm doubtful win64 exes are permitted to run if the
15.
▲
by
mcountryman
6y ago
This is my attempt at making the smallest exe with rust for windows using the msvc toolchain. If y'all have any pointers how to get it smaller let me know :)
16.
▲
Show HN: Tiny 1k Rust binary on Windows
(github.com)
99 points
by
mcountryman
6y ago
|
61 comments
17.
▲
by
mcountryman
8y ago
From 200+ comments "cancel" was listed 4 times in that reddit thread and "return" was listed 5 times. Some repeats in there.