Tom retweeted
I've got an agent in a loop optimizing a renderer with the goal to minimize frame times (and tests to measure). It got times down from 88ms to 2ms and allocations down from ~150K to 500. Sounds good, right? Wrong. This is exactly why agent psychosis is a big fucking problem.
As an experiment, I rewrote the Ghostty core render state in Go, with access to identically laid out data structures as Ghostty and the exact same validation tests. I made a purposely naive renderer (simple, correct, but slow). 88ms per frame with 150,000 allocations (horrendous, lol)!
I then kickstarted a Ralph loop to bring the frame times down. I told it it can't modify input data structures or the public API or tests (they're correct), but it can do anything else it wants. It got to work.
It has worked for about 4 hours. I've spent around $350 on this experiment so far. The results?
88ms => 1.5ms
150K allocs => ~500 allocs
Incredible right? Nope.
My hand-written renderer I ported has frame times (same benchmark) of ~20us (0.020ms) and 0 allocations in the update path.
This is the problem with psychosis and lacking systems understanding. If you don't understand the system, you're going to accept that this is an incredible result. If you understand the system, you'll see better solutions immediately and can do roughly 75x better on throughput.
The people who blindly trust agent output are in the former camp. They're sheeple, overdrinking from a fountain of mediocrity.
Standard disclaimer: I use AI all the time. I like AI. The point I'm making is to not blindly accept results. Think. Analyze. Learn.
Tom retweeted
Finally did it. I wrote down how to build a code-editing agent.
In 315 lines of code. And yes, it works. Very well.
There is no moat.
Tom retweeted
It’s 2027. Every web library is now part of @tan_stack. Nothing else survived. We spent so long asking “tanstack start wen?” we forgot to ask “tanstack stop wen?”
Tom retweeted
For those who haven't seen, I kicked off a hackathon today for my community. Be sure to join now if you want a chance to win some prize money. Here is the video describing the hackathon event.
youtu.be/lBR8o1JpSrc
Tom retweeted
Build & Deploy a Full Stack App to the Edge with Next.js, @neondatabase & @Vercel youtu.be/_LF-IvJsr5Y
Tom retweeted
🚨 BIG ANNOUNCEMENT 🚨
I am hosting a charity event! The charity is Girls Who Code and it is a raffle based charity. 3 winners will be selected to receive SIGNED copies of Writing an Interpreter in Go, Writing a Compiler In Go & The Pragmatic Programmer.
I hope you all take a chance to buy some tickets. Big shout out to the authors of these incredible books for making this possible.
Winners will be announced next Saturday, July 15th on my stream.
It is LIVE NOW + More information can be found here:
melkey.betterworld.org/givea…
Tom retweeted
Learn how to build a multi-tenanted, role-based access control system using TypeScript, @drizzleorm, and Neon. ⬇️
youtu.be/b6VhN_HHDiQ
By @tomdoes_tech
Tom retweeted
New video: this one covers three of the most common questions we get on Discord:
- How to call a @trpcio procedure from another procedure
- How to use gSSP with tRPC
- How to organize a bigger app
youtube.com/watch?v=G2ZzmgSh…
Tom retweeted
We are live for 90 minutes! Come hang out and learn all about @trpcio from core members!
Tom retweeted
My first video is live now. Everything you need to know about data flows in @trpcio
youtube.com/watch?v=x4mu-jOi…
Tom retweeted
THE FIRST EVER T3 AWARDS ARE LIVE NOW COME THRU twitch.tv/theo #t3awards
Tom retweeted
Y'all know we'll happily send you some $$$ if you contribute to tRPC? 💰
github.com/trpc/trpc/issues/…
Tom retweeted

MrBeast@MrBeast26 Sep 2022
United States
United StatesConnected via United States App StoreAccount-level information, not a live location or per-post device.
Replying to @MagnusCarlsen
They should do a tsa body scan before a match to check for anal beads
Tom retweeted

ThePrimeagen@ThePrimeagen13 Sep 2022
United States
United StatesConnected via United States Android AppAccount-level information, not a live location or per-post device.
Big Announcement
The Algorithms Course is going to free for _everyone_
frontendmasters.com/courses/…
No membership? No problem. Extremely kind of Frontend Masters to take their material and make it free
Tom retweeted
Another day another instance of me begging y'all to please use React Query for stuff like this.
You're writing 3x the code and throwing away all your errors and loading states for no reason.
Here's a React hook that checks if the user's device has a rear facing camera.
Technique: Use the browser's getUserMedia API to check if facingMode="environment", which means a camera exists that faces away from the user. 😎
(Use the image's alt tag to copy the actual code).
![import { useEffect, useState } from "react";
/** Returns true if the user's device has a rear-facing camera */
export default function useHasRearFacingCamera() {
const [hasRearFacingCamera, setHasRearFacingCamera] = useState<boolean | null>(null);
useEffect(() => {
const detectRearCamera = async () => {
try {
const hasRearCamera = await navigator.mediaDevices.getUserMedia({
video: { facingMode: { exact: "environment" } },
});
if (hasRearCamera) {
setHasRearFacingCamera(true);
}
} catch {
setHasRearFacingCamera(false);
}
};
detectRearCamera();
}, []);
return hasRearFacingCamera;
};](https://pbs.twimg.com/media/FTXD1A_XEAEzHFZ.jpg?name=small&format=webp)
ALT import { useEffect, useState } from "react"; /** Returns true if the user's device has a rear-facing camera */ export default function useHasRearFacingCamera() { const [hasRearFacingCamera, setHasRearFacingCamera] = useState<boolean | null>(null); useEffect(() => { const detectRearCamera = async () => { try { const hasRearCamera = await navigator.mediaDevices.getUserMedia({ video: { facingMode: { exact: "environment" } }, }); if (hasRearCamera) { setHasRearFacingCamera(true); } } catch { setHasRearFacingCamera(false); } }; detectRearCamera(); }, []); return hasRearFacingCamera; };
Tom retweeted
❌ Still using [].join(', ') for your strings?
✅ Use Intl.ListFormat instead 👇
developer.mozilla.org/en-US/…

























