Log inSign up
Andrew Healey
883 posts
Andrew Healey profile banner
@healeycodes

Andrew Healey

@healeycodes
software engineer @vercel β€’ I write about performance, compilers, puzzles, &more on my website β€’ @recursecenter alum
πŸ‡¬πŸ‡§
healeycodes.com
Joined January 2019
915
Following
1,375
Followers
RepliesRepliesRepostsRepostsMediaMedia

Log in or sign up for X

See what’s happening and join the conversation

Continue with phone
or
Log in with username or email
TermsΒ·PrivacyΒ·CookiesΒ·AccessibilityΒ·Ads InfoΒ·Β© 2026 X Corp.
  • @healeycodes
    Andrew Healey
    @healeycodes
    Sep 3
    the stronger the searcher, the more dangerous metadata about the existence of an answer becomes in security: "just a rumour of a bug is enough to find an exploit these days" in chess: Carlsen would be MUCH stronger with just one bit per game: "this position is critical"
  • @healeycodes
    Andrew Healey
    @healeycodes
    Sep 2
    I wrote about the performance of LLM tokenizers like most things you want to go fast, it's better to use compact contiguous state instead of complex data structures! healeycodes.com/what-makes-llm…
    Screenshot of blog post:

Below are the first four merges from the real goldshire trace. GPT-2 chooses the lowest-ranked valid adjacent pair (not the leftmost pair or the longest token). So r+e, which has rank 4, wins before the leading-space pair, even though it is near the end of the match.

The important bit to take away is that each merge can expose another candidate.

...
  • @healeycodes
    Andrew Healey
    @healeycodes
    Aug 16
    I wanted to write a blog post titled (provocatively) "We Could Have Had Coding Agents in 2019" I used the GPT‑2 XL weights (no post-training) and backported several later agent-design breakthroughs (action/observation loops, filesystem tools, etc.)
    screenshot of terminal:

 β†’ ./run.sh
GPT-2 XL CODING AGENT
Model: openai-community/gpt2-xl  Device: mps  Seed: 419

INITIAL PROMPT β†’ GPT-2
────────────────────────
You are a programmer controlling a tiny project. Choose one action at a time.
Use exact filenames from Computer. After a FAIL names a file, READ that file next.

Actions:
ACTION: LIST
ACTION: READ filename.py
ACTION: WRITE filename.py
CONTENT:
complete file contents
END
ACTION: RUN
COMMAND: python check.py
ACTION: FINISH

Example:
Task: Fix the project so all checks pass.
Programmer:
ACTION: LIST
Computer:
check.py
message.py
names.py
    1
  • @healeycodes
    Andrew Healey
    @healeycodes
    Aug 2
    I added πšπšŽπšπšŽπš› to the typescript compiler but along the way, I realised that what I want is different syntax for πšžπšœπš’πš—πš I just want to be able to write: πšžπšœπš’πš—πš πšŠπš πšŠπš’πš πšœπšŽπš–πšŠ.πšŠπšŒπššπšžπš’πš›πšŽ() but you can't ↧ healeycodes.com/adding-defer-t…
    Screenshot of blog post:

So the goal is to be able to write TypeScript code like this:

async function readFile(path: string) {
  await sema.acquire();
  defer sema.release(); // New!

  // ... use resource
}
The TypeScript Compiler
The TypeScript compiler (tsc) is mostly a static analysis engine. Its complexity lies in type-checking a fundamentally dynamic language, and supporting extremely incremental compilation to meet latency expectations in an IDE.

Lucky for us, we don't need to worry too much about types or other analysis in order to add our defer statement. tsc already has the machinery for "recognize syntax X, replace it with equivalent syntax Y."
  • @healeycodes
    Andrew Healey
    @healeycodes
    Jun 27
    two sum in lisp is actually really cute
    (defun two-sum (xs target)
  (let ((seen (make-hash-table)))
    (loop for x in xs
          for i from 0
          for need = (- target x)
          do (multiple-value-bind (j ok)
                 (gethash need seen)
               (when ok
                 (return (list j i))))
             (setf (gethash x seen) i))))
    3
Advertisement
Advertisement