zack (in SF) Profile Banner
zack (in SF) Profile
zack (in SF)

@zack_overflow

7,207
Followers
1,362
Following
130
Media
835
Statuses

"this guy's all boners for Rust" — @ThePrimeagen baking bread at @bunjavascript i like compilers/FP/Rust/graphics/wasm/etc

SF / Toronto / Saudi
Joined November 2020
Don't wanna be here? Send us removal request.
Pinned Tweet
@zack_overflow
zack (in SF)
8 months
Documenting here the projects/hacks I've posted so anyone who stumbles upon my profile can see what I've built! Ordered by amount of likes: 1. An IDE + GUI for writing ffmpeg commands
@zack_overflow
zack (in SF)
2 years
I got fed up writing FFmpeg commands. Its unintuitive, and can get ugly and complicated quickly A couple of months ago, I built this GUI to help me write complex ffmpeg filtergraphs that we have been using internally and decided to launch today.
Tweet media one
113
1K
7K
7
28
430
@zack_overflow
zack (in SF)
8 months
Added gratuitous explosions and particle effects to the code editor I'm building
422
2K
12K
@zack_overflow
zack (in SF)
2 years
I got fed up writing FFmpeg commands. Its unintuitive, and can get ugly and complicated quickly A couple of months ago, I built this GUI to help me write complex ffmpeg filtergraphs that we have been using internally and decided to launch today.
Tweet media one
113
1K
7K
@zack_overflow
zack (in SF)
7 months
I wrote a 2D game, entirely in type-level Typescript. Yes, you read that right. This is flappy bird, written only in Typescript types. How did I do it? It involves a lot of type magic, and a new type-level Typescript runtime I made in Rust + Zig. Let me walk you through it:
80
442
3K
@zack_overflow
zack (in SF)
2 years
Got tired of tsc taking forever to type check my code so I made a Typescript type checker in Rust for fun For a small Typescript file it's 500x faster than tsc taking ~0.002s vs ~1.3s (using SWC for compilation). It supports only a small subset of Typescript (for now).
Tweet media one
Tweet media two
49
242
2K
@zack_overflow
zack (in SF)
7 months
It's not Zig vs Rust... its Zig and Rust An unexpected power combo for a project I'm working on. Doing the high-level things in Rust, and the hardcore low-level stuff in Zig
Tweet media one
56
83
1K
@zack_overflow
zack (in SF)
11 days
Whenever someone says they think Rust is a very low-level language I show them this:
Tweet media one
136
68
2K
@zack_overflow
zack (in SF)
8 months
@WebdevsShaik no, it is required
10
10
839
@zack_overflow
zack (in SF)
5 months
Update: I'm joining the @bunjavascript team But I won't be writing Zig code, I quit programming several months ago to pursue my passion in artisan baking My role will be ensuring that the Bun team is well-fed with pastries, breads, and, naturally, buns
Tweet media one
34
21
790
@zack_overflow
zack (in SF)
1 year
When Zig is safer and faster than Rust: I recently wanted to compare Rust vs Zig, so I wrote a garbage collected bytecode interpreter in both languages It turned out that the Zig version was actually faster AND safer than the Rust version How come?
24
89
775
@zack_overflow
zack (in SF)
4 months
So happy everyone's excited about the project I've been working on! I build interpreters for fun, building a shell might be the hardest one I've built yet It took me ~20k lines and 2 months, but was so fun Maybe one day I'll write a blog post on the process
@bunjavascript
Bun
4 months
Introducing the Bun Shell Cross-platform shell language & interpreter for shell scripting with JavaScript
Tweet media one
185
451
4K
36
26
669
@zack_overflow
zack (in SF)
7 months
Web dev terminology converted to traditional terminology: bundler => compiler/linker transpiler => source-to-source compiler engine => interpreter treeshaking => dead code elimination code splitting => dynamic linking source maps => symbolication
17
65
655
@zack_overflow
zack (in SF)
3 months
Initial thoughts: 1. Copilot is terrible for systems programming, I actually have it turned off for Rust and Zig. Most problems you solve just aren't represented well in the training data, so copilot just suggests absurd shit. Supermaven seems to be slightly smarter, I guess…
@jbfja
Jacob Jackson
3 months
Five years ago I created TabNine, the first commercial code completion tool to use deep learning. Today I'm releasing Supermaven, the first code completion tool with a context window exceeding 100,000 tokens.
108
210
2K
17
17
457
@zack_overflow
zack (in SF)
7 months
Most people think Rust is a low-level language, but writing in it actually feels very, very high-level Rust gives you: - type-directed metaprogramming (traits) - operator overloading - generics - algebraic data types + pattern matching - FP-style functions (.map, .filter, etc)
16
27
437
@zack_overflow
zack (in SF)
1 year
playing around with force-directed graphs in rust and webgpu
5
26
411
@zack_overflow
zack (in SF)
7 months
Let's learn how Zod works internally, and exercise our type-level Typescript skills, by making our own Zod from scratch:
4
30
378
@zack_overflow
zack (in SF)
11 days
Rust has features people associate with "low-level", namely the ability to manipulate memory on the level of bits and bytes But the Rust experience is mostly about high level interactions with the borrow checker or constructing abstractions within the type system, etc.
0
4
346
@zack_overflow
zack (in SF)
6 months
Are you sick of Go's inflexible type system and its lack of sum types (tagged/discriminated unions)? I'm going to show you how to hack Golang and add sum types to the language:
13
20
335
@zack_overflow
zack (in SF)
8 months
when this goes over 9000 likes i will make a small announcement
@zack_overflow
zack (in SF)
8 months
Added gratuitous explosions and particle effects to the code editor I'm building
422
2K
12K
17
7
284
@zack_overflow
zack (in SF)
8 months
6 months ago i got nerd sniped into cloth simulation and made this in WebGPU + rust
6
9
284
@zack_overflow
zack (in SF)
7 months
An e-book reader and a terminal emulator both use more memory than running a full-fledged video game on my m1 max
Tweet media one
22
10
275
@zack_overflow
zack (in SF)
6 months
Programming just hits different when you write a class in Zig that schedules a task on the event loop, add it to the Bun global, and then call and await it from JS It feels like you're a sorcerer with the ability to bend javascript to your will
Tweet media one
Tweet media two
@zack_overflow
zack (in SF)
6 months
Working on adding glob matching support to Bun Bun.Glob is 6.54x faster than "fast-glob" at matching all js files in node_modules (~80ms vs ~550ms) I think this is also my first legit open-source contribution ever
Tweet media one
7
9
245
5
15
274
@zack_overflow
zack (in SF)
2 years
Got tired of nvim/VSCode being slow so I made the code editor I'm building with Rust + OpenGL run at ~100 FPS. This is a more than 2x improvement over nvim/VSCode which run around ~45 FPS (or worse when scrolling).
16
11
263
@zack_overflow
zack (in SF)
8 months
@spyzilla what about a lightning strike on the cursor on the newly placed line, with glow effect and everything?
8
1
261
@zack_overflow
zack (in SF)
2 years
Rambling about why WASM web frontend frameworks can't be faster than vanilla JS frontend frameworks (at least right now):
11
35
257
@zack_overflow
zack (in SF)
7 months
OOP really disillusioned generations of programmers into thinking the way to do polymorphism is to construct overly complex class hierarchies instead of just using sum types (tagged/discriminated unions)
18
14
245
@zack_overflow
zack (in SF)
6 months
Working on adding glob matching support to Bun Bun.Glob is 6.54x faster than "fast-glob" at matching all js files in node_modules (~80ms vs ~550ms) I think this is also my first legit open-source contribution ever
Tweet media one
7
9
245
@zack_overflow
zack (in SF)
1 year
Every video editing software I've used has always felt clunky and hindered my creativity. So we're hacking on a crazy idea - "an infinite canvas timeline", a space that gives you the freedom to experiment, where collaboration is a core primitive and iteration can happen quickly.
15
21
222
@zack_overflow
zack (in SF)
1 year
Hey @gather_town i reverse engineered your websocket protocol and am spawning infinite gokarts onclick at the @buildspace demo day event cant believe they paid 6k for this :P
21
7
214
@zack_overflow
zack (in SF)
2 years
Here's a video of me using it to use FFmpeg's video and audio trim filters. It generates the complex filter string for me:
2
11
207
@zack_overflow
zack (in SF)
8 months
Using bun's "bundle-time evaluation" macros to make it so I have to get a score of 10 or higher on flappy bird for it to finish bundling my code
5
16
182
@zack_overflow
zack (in SF)
11 days
@wileycwj well to be honest it's very rare that you have to write out a type like this but typescript is no stranger to big ass confusing types, it would look like this in typescript:
Tweet media one
5
1
172
@zack_overflow
zack (in SF)
2 years
It also has autocomplete with documentation embedded right in the UI, my goal was to make this feel somewhat like an IDE for FFmpeg filters This is my favorite feature, helps me maintain flow state and never have to waste time flipping to FFmpeg documentation
Tweet media one
1
4
148
@zack_overflow
zack (in SF)
8 months
@roszczt there are only vim bindings
4
0
146
@zack_overflow
zack (in SF)
2 years
It's using SWC to parse Typescript, then it type checks the returned AST. Right now it supports a subset of TS's type system with the end goal of reaching feature parity with Typescript and possibly making an LSP server that goes brrr
2
0
143
@zack_overflow
zack (in SF)
1 year
In the end, the Zig version was not only safer and faster than the Rust version, but also much easier to write. I talk more in depth on why in my new blog post:
5
12
138
@zack_overflow
zack (in SF)
2 years
It does analysis on your graph and filters to make sure they're correct. For example you've properly connected nodes, your filter arguments are correct, etc.
5
4
132
@zack_overflow
zack (in SF)
4 months
This is huge, a lot of cool tech written in Rust to explore and learn from The CRDT implementation and GPU accelerated UI framework are probably most exciting
@zeddotdev
Zed
4 months
Zed is now open source! Our mission is to revolutionize developer collaboration, building the world's best code editor in the process. After working together in Zed as a small team, it's time to scale up to transform Zed into a collaboration platform.
Tweet media one
138
553
3K
3
5
132
@zack_overflow
zack (in SF)
4 months
I'm thinking of making a "Zig for Rustaceans" guide/blog post/etc Should I? As a big Rust fanboy, it wasn't clear what Zig gave me that I couldnt get out of Rust. Turns out, its a lot, and I wanna share that Learning Rust at least 5x'ed my coding skill, and Zig 5x'ed it again
Interested
807
Not interested
66
Show results
142
21
5
132
@zack_overflow
zack (in SF)
26 days
How noisy a programming language's syntax is plays a big role in detecting bugs and errors in code It's a subtle reason why raw manipulation of memory in Zig feels way less error prone than C or C++ or Rust. Zig code is just easier to scan and read
6
5
133
@zack_overflow
zack (in SF)
8 months
@AndreyHihlovski only 100x developers can understand why
1
2
132
@zack_overflow
zack (in SF)
8 months
over 9000 likes later and i have made the best domain purchase of my life thus far: stay tuned
@zack_overflow
zack (in SF)
8 months
Added gratuitous explosions and particle effects to the code editor I'm building
422
2K
12K
6
2
127
@zack_overflow
zack (in SF)
11 days
@luciascarlet might scare the imperative pleb, but my FP homies eat this shit up
7
0
123
@zack_overflow
zack (in SF)
1 year
Fundamentally, Zig is a language that understands you are going to do memory-unsafe things and is designed around making that experience better and less error-prone.
1
4
118
@zack_overflow
zack (in SF)
1 year
Shout out to @munificentbob 's Crafting Interpreters book (the Rust and Zig interpreters are based on the second one from his book)
3
3
118
@zack_overflow
zack (in SF)
2 years
I'm aware that SWC is making a type checker, but it still isn't clear if it was going to be open source or commercially licensed, so I decided to make my own for personal use and fun
3
0
111
@zack_overflow
zack (in SF)
8 months
We wrote a lil experimental compiler that desugars ts-pattern match expressions into regular if statements! The way it's done is cool if you're interested in compilers:
@aidenybai
Aiden Bai
8 months
Introducing 🎂 pattycake An optimizing compiler for ts-pattern for 10x faster performance Now, you have your cake (expressive pattern matching), and eat it too (zero runtime overhead). Setup in <5 minutes:
Tweet media one
14
72
830
2
7
109
@zack_overflow
zack (in SF)
7 months
A benchmark showing that ts-pattern is surprisingly faster than you'd think. It takes ~0.88 ms for it to match 1k random objects. pattycake removes the runtime overhead so it runs in 0.01ms, but for most usecases that perf boost is negligible "JIT happens"
Tweet media one
@GabrielVergnaud
Gabriel Vergnaud
7 months
This is cool. TS-Pattern is faster than most people think, and it's unlikely for code branching to be the perf bottleneck of your app, but compiling its runtime away is an interesting idea for perf critical code. Thank you for exploring this path @aidenybai & @zack_overflow !
1
3
90
2
4
92
@zack_overflow
zack (in SF)
7 months
But that's not all. By creating this runtime, I also accidentally created probably the fastest and most complete type-checker for Typescript, but types only.
3
5
95
@zack_overflow
zack (in SF)
6 months
This was a terrible idea. We didn't really solve any of our original problems. We kind of implemented sum types but it ended up being not worth it in terms of performance or ergonomics. Blog post goes in more detail with other attempts too:
6
5
93
@zack_overflow
zack (in SF)
4 months
I'm going to write a game engine that uses Bun as the scripting language I'm calling it Bunreal Engine
6
1
93
@zack_overflow
zack (in SF)
1 year
Here are some benchmarks. Zig was 1.56-1.76x faster than Rust. The important takeaway is not that Zig was faster, but it was far easier to write.
Tweet media one
Tweet media two
Tweet media three
Tweet media four
2
5
90
@zack_overflow
zack (in SF)
7 months
@TythosEternal I consider Rust to be a pretty high level language. Most of my time in the language is dealing with high level abstractions, which are zero-cost and compile to very efficient machine code, but are nonetheless quite high level. The language also lets you do low level things if…
1
0
90
@zack_overflow
zack (in SF)
6 months
@jarredsumner yes, what i’ve always wanted! php introp in Bun!
0
0
85
@zack_overflow
zack (in SF)
1 year
Rust's language design is optimized around making it so you never need to do memory-unsafe things. I had a difficult time because almost everything I was doing was breaking the borrow checker's rules and treading in territory Rust wasn't designed for
1
4
87
@zack_overflow
zack (in SF)
1 year
So to compete with Zig (and also for for fun), I decided to practice the dark arts and use unsafe Rust. It turns out that unsafe Rust is hard. There are a lot of complicated rules about undefined behaviour. It's super easy to violate them and cause subtle bugs
2
4
87
@zack_overflow
zack (in SF)
7 months
I then compile the runtime to Wasm, and each frame it takes the draw commands from the game and executes them using the web canvas API. And that's the basic overview of how I made flappy bird in type-level Typescript! More detail in this blog post:
1
6
86
@zack_overflow
zack (in SF)
7 months
So each frame, we pass the game state through a series of updates that need to happen each frame: handling jumps, applying gravity to the bird, moving the pipes. The end result looks something like this, and its a surprisingly elegant, linear, pipelining of functions:
Tweet media one
1
2
84
@zack_overflow
zack (in SF)
4 months
I forgot to delete a file that wasn't used so I accidentally made jarred review 2k lines of code for no reason
@jarredsumner
Jarred Sumner
4 months
this will be fun to review
Tweet media one
26
13
770
2
1
83
@zack_overflow
zack (in SF)
3 months
Bun is at TreeHacks
Tweet media one
5
2
84
@zack_overflow
zack (in SF)
1 year
Garbage collection is a hard problem to solve in Rust, it fundamentally is something that doesn't play nicely with the borrow checker. It's possible to write one in safe Rust, typically using refcounting or arenas+handles, but those seem to be slower than a typical mark/sweep gc
2
4
81
@zack_overflow
zack (in SF)
2 months
In the next version of Bun Bun Shell errors stacktraces point to the right line
Tweet media one
4
4
81
@zack_overflow
zack (in SF)
7 months
First off, type-level Typescript can be thought of as a purely functional programming language, where everything is immutable. So we can't have some global game state (bird position, pipes, etc.) and mutate it What we can do is use functions to return a new, updated game state
1
4
78
@zack_overflow
zack (in SF)
6 months
Cool thread-safe triple buffering approach made lock-free by atomically swapping the pointers to the buffers Thinking about using this for my code editor when I add LSP support The main render thread needs to get data from the second thread which manages the LSP server process
Tweet media one
1
5
73
@zack_overflow
zack (in SF)
2 years
At @modfydotvideo we wrote our own test runner because we hate Jest. It's: - 12x faster than Jest - 11x faster than Vite Here's a basic benchmark (take with a grain of 🧂) comparing it w/ other test runners. We're thinking of releasing it, pls let us know if you would want this
Tweet media one
10
3
77
@zack_overflow
zack (in SF)
8 months
@devshogun relative line numbers to make jumping to lines with vim movements easier
4
1
75
@zack_overflow
zack (in SF)
8 months
The recent Unity debacle has inspired me to build my own game engine for fun and completely from scratch in C So far I've implemented loading glTF models, vertex skinning, skeletal animations, and crossfading smoothly between animations
6
4
75
@zack_overflow
zack (in SF)
8 months
@ChaseMc67 great idea!!
0
0
73
@zack_overflow
zack (in SF)
7 months
And here is the final Typescript code for the game, if you wanna check out my unholy type-level trickery. It's actually not that bad, just the moving pipe logic and the collision with pipe logic is unsightly because it needs to do iterative recursion
2
5
73
@zack_overflow
zack (in SF)
2 months
some people ask about the quote in my bio: "this guy's all boners for Rust" — @ThePrimeagen that's an actual quote, he said that about me on stream while reading my blog post here's the clip:
6
0
70
@zack_overflow
zack (in SF)
7 months
My hope is that by focusing on nailing down type-checking type-level Typescript first, which is a way easier task than all of Typescript, the runtime can be useful very quickly. Check out the source here: And play the game here:
1
2
71
@zack_overflow
zack (in SF)
7 months
Yes, you can do low-level things in Rust. But 95% of the time you don't need to, you can stay in the realm of high abstractions and get good perf because of the borrow checker and zero-cost abstractions
1
1
69
@zack_overflow
zack (in SF)
4 months
Some of my most productive days are when I wake up and code in bed for 8 hours straight Or when I'm laying in bed about to fall asleep, but get a wind of energy and code until 8 am the next morning
4
1
68
@zack_overflow
zack (in SF)
7 months
The basic rundown is that I created a type-level Typescript runtime, allowing types to be run outside of the Typescript compiler/language server. It's made of two parts: 1. A compiler in Rust to convert Typescript types -> bytecode 2. A custom VM in Zig to execute that bytecode
2
2
66
@zack_overflow
zack (in SF)
3 months
Back in SF, serenaded by Bun merch
Tweet media one
8
0
65
@zack_overflow
zack (in SF)
3 years
So I saw a post on Reddit and made an Australian programming language...
Tweet media one
4
13
64
@zack_overflow
zack (in SF)
7 months
The next part is rendering. I drew inspiration from modern graphics APIs and added a command buffer to the game state: basically a list of drawing commands Each frame, we update the game state, and populate the draw command buffer. In the end even rendering becomes elegant too:
Tweet media one
Tweet media two
1
2
63
@zack_overflow
zack (in SF)
1 year
Do you like state machines and type-safety? I wanna share a wip library I'm building to make working with state machines easier and more type safe in typescript. It's like XState.js had a baby with Zustand lemme walk u thru how it works
4
4
60
@zack_overflow
zack (in SF)
5 months
While I'm waiting for the bread to bake I'll be writing and optimizing high-performance Zig code and contributing comically large PRs to the runtime:
@jarredsumner
Jarred Sumner
5 months
the pr
Tweet media one
14
5
293
1
1
59
@zack_overflow
zack (in SF)
3 months
Tweet media one
3
1
60
@zack_overflow
zack (in SF)
2 years
This is the sample.ts, basically everything is supported except for complex types (generics, conditionals, recursive) right now
Tweet media one
2
0
58
@zack_overflow
zack (in SF)
7 months
@UrataSyndicate @mitchellh Rust is trying to be the better C++ Zig is trying to be the better C
3
2
54
@zack_overflow
zack (in SF)
7 months
Okay, that's the type-level logic. But in the video, the game is running in the browser, how does that work? This where some hardcore programming comes into play.
1
1
48
@zack_overflow
zack (in SF)
11 days
@rhesus_kato it's not a real field, but a marker type to tell the compiler to treat ListIter<'a, T, N> as if it were borrowing a reference to List<T, N>
4
0
47
@zack_overflow
zack (in SF)
7 months
@officiallyninja great idea, probably gonna use @Remotion or @fframes_rust for making the visuals!
1
4
46
@zack_overflow
zack (in SF)
8 months
@learn_charles thats my secret, im always insane while coding
0
1
44
@zack_overflow
zack (in SF)
1 year
1/ Starting my journey on learning CRDTs seriously and more in-depth and going to be documenting it for others and for fun. If you don't know about CRDTs they're the data types that power collaborative features in multiplayer apps like Figma
1
2
45
@zack_overflow
zack (in SF)
1 month
changed my github profile picture to one with my feet so everytime someone links a PR in bun that I made you'll see my feet in the og image my feet now watch over all my commits
Tweet media one
8
1
45
@zack_overflow
zack (in SF)
7 months
Always thought the name WebAssembly is super misleading. Wasm has nothing to do with "assembly" in the traditional sense. It's really a specification for a bytecode format, and an accompanying virtual machine that can interpret that bytecode. But WebBytecode sounds less cool.
7
1
45
@zack_overflow
zack (in SF)
2 months
@FFmpeg and anyone interested: should we open source this GUI tool for building complex ffmpeg commands? poll below
@zack_overflow
zack (in SF)
2 years
I got fed up writing FFmpeg commands. Its unintuitive, and can get ugly and complicated quickly A couple of months ago, I built this GUI to help me write complex ffmpeg filtergraphs that we have been using internally and decided to launch today.
Tweet media one
113
1K
7K
6
1
46
@zack_overflow
zack (in SF)
2 years
There is always an overhead from copying/serializing/deserializing data from WASM -> JS and vice-versa and it can be bad for perf. For WASM to outperform JS you kinda have to minimize how frequently data crosses the JS/WASM boundary, to reduce this redundant copying/computation
1
1
43
@zack_overflow
zack (in SF)
8 months
@cpojer I've wanted to make a babel/swc/bun transform pass that desugars ts-pattern api calls into regular switch cases so you there is no or at least minimal runtime overhead incurred from the lib
3
0
44
@zack_overflow
zack (in SF)
4 months
I also think Rust + Zig is not explored enough I tried it and it worked really well for me, using Rust for the high-level things and Zig for hardcore low-level programming
@zack_overflow
zack (in SF)
7 months
It's not Zig vs Rust... its Zig and Rust An unexpected power combo for a project I'm working on. Doing the high-level things in Rust, and the hardcore low-level stuff in Zig
Tweet media one
56
83
1K
3
0
43
@zack_overflow
zack (in SF)
7 months
@sacsbrainz I learned Rust by building a compiler and I learned Zig by building a VM My trick is to pick hard projects that fascinate me so I'm motivated to keep going
3
0
43
@zack_overflow
zack (in SF)
4 months
Still don't believe it's impossible
@mattpocockuk
Matt Pocock
4 months
stc, the effort to rewrite TypeScript in Rust, has been abandoned. All in all, I'd say fair enough - it proved to be an impossible goal. Here's the interview I did with @kdy1dev back when he was in full swing working on it.
18
30
395
3
2
42
@zack_overflow
zack (in SF)
5 months
If you're interested in baking bread or writing hard-core & high-performance Zig/C++ with me, check out our open roles: And feel free to DM me if you have any questions: the process, or the type of work we do, etc.
1
1
41
@zack_overflow
zack (in SF)
4 months
@t3dotgg @jarredsumner this is utterly disgusting and i love it
0
1
40
@zack_overflow
zack (in SF)
7 months
@Fly1ngT0a5t3rs @acemarke in a way @GrugBrainedDev would explain it: compiler/linker => compiler turn source code into machine code. linker combine pieces machine code together, make runnable program. transpiler => take source code one language, produce source code another language. interpreter => read…
2
2
38
@zack_overflow
zack (in SF)
2 years
Nice work typescript
Tweet media one
@zack_overflow
zack (in SF)
2 years
Nice work typescript
Tweet media one
3
1
15
4
13
39