@ID_AA_Carmack
John Carmack
1 month
Numpy’s fromfile()/tofile() make me smile — no typing or byte order metadata, they just write/read the raw bytes. A joyful API! I wish PyTorch had them natively on tensors, so I wasn’t doing so many tensor.cpu().numpy() operations.
29
15
789

Replies

@morganlinton
Morgan
1 month
@ID_AA_Carmack Someone from @PyTorch should read this and make it happen, safe to say we’d all love it!
0
0
3
@tswain555
Tony Swain
1 month
@ID_AA_Carmack If Python does something I need I will at once rewrite it in C. I have a little side project I call NumC. Rewrite everything Numpy in C. Grok makes this cheesy easy now.
3
0
11
@stacktrackguy
Hollow Byte
1 month
@ID_AA_Carmack Direct tensor I/O would be huge, especially for fast checkpoints and interop with non python systems. Surprising PyTorch hasn’t baked in raw binary read/write yet.
0
0
10
@maximkulkin
Maxim Kulkin
1 month
@ID_AA_Carmack But you can use dtype argument to set its type and control endianness by prepending either ‘<‘ or ‘>’ to a type string: numpy.fromfile(path, dtype=‘>i4’)
0
0
5
@mehedi_u
Md. Mehedi Hasan Rakib
1 month
@ID_AA_Carmack Sometimes the simplest APIs are the most powerful and NumPy proves it every time. PyTorch could learn something here about not overengineering basic file operations.
0
0
3
@JonKakaley
Jon Kakaley
1 month
@ID_AA_Carmack Numpy one of the all time best apis ever created. Lightweight, fast, gets the job done
1
0
1
@StpVapor
Vapor
1 month
@ID_AA_Carmack The leap from strong types to "here's some data of some type" is jarring for me. I always feel like I end up negating the prototype speed with having to compensate for ambiguous types. I'm not saying I want to have main() entirely comprised of pointer logic, but Python irks me.
0
0
1
@Jonath4nH
J0nny🥳
1 month
@ID_AA_Carmack if only python allowed you to define a "def tofile(tensor): " function 🤔
0
0
1
@mlajtos_mu
mu
1 month
@ID_AA_Carmack safetensors for less joyful API
0
0
1
@TtheBC01
Todd Chapman
1 month
@ID_AA_Carmack Why didn’t the ML crowd adopt HDF5 files?
0
0
1
@doc_hex1337
Dochex
1 month
0
0
1
@SFunddude
I Find NPCs!
1 month
0
0
1
@ElliottChMiller
Elliott 🔜 Neurips 2025 San Diego.
1 month
@ID_AA_Carmack Moooood
0
0
0
@n3ro
nero
1 month
@ID_AA_Carmack Carmack is going to make me wanna go learn Python, for real this time . . .
0
0
0
@dumbletwit
dumbletwit
1 month
@ID_AA_Carmack Makes for a great dodgy AF state cache
0
0
0
@YodasRaytracing
Remastered Retro PC Games
1 month
@ID_AA_Carmack numpy sounds like grumpy. My man child woke up grumpy this morning. Its cute Mr. Carmack.
1
0
0
@BoganBits
Just zis guy, you know?
1 month
@ID_AA_Carmack There is this graphics library called Cairo that can export raw pixel data. You can feed a sequence of images to stdout, pipe that output into ffmeg, and tell it the format of the data, to turn it into a compressed video that you can play anywhere
0
0
0
@Hassan_Abedi
Hassan Abedi 📚🌿🦉🪬
1 month
@ID_AA_Carmack fromfile/to file is all you need?
0
0
0
@bloodfire
Mime
1 month
@ID_AA_Carmack Maybe ask Claude 4.5 to do a PR on tensors @ID_AA_Carmack If your lucky, it might just work :)
0
0
0
@BitValentine
Vincent Valentine (Daddy Said What)
1 month
@ID_AA_Carmack it’s great to see such enthusiasm for clean apis.
0
0
0
@_empty_exposure
Richard Jones
1 month
@ID_AA_Carmack Read that as Numpty, which means idiot in local Scots
0
0
0
@ivor_sicula
Ivor Sicula
1 month
@ID_AA_Carmack Dedicated hw is the curse of the dedicated SW engineer
0
0
0
@GGDA_ORG
GA Game Developers
17 days
@ID_AA_Carmack Hi John, we are putting on our second Game AI conference in Atlanta Feb. 21-22, 2026. Last year Luke Dicken, head of AI for Take-Two, was our industry keynote ( https://t.co/MrvgWfO8xc). Can we talk about what would be involved in having you as a speaker? president@ggda.org
0
0
0
@lcq24
lcq2
18 days
@ID_AA_Carmack numpy is awesome, I wrote 90% of the code for my thesis with it, together with opengl python bindings, and a few C libraries for performance oriented code...never going back 😁
0
0
0
@Frumpered
frumper
1 month
@ID_AA_Carmack If only more data types had this
0
0
0
@Drukp4K
Drukpa
1 month
@ID_AA_Carmack @__tinygrad__ lets you do raw byte tensors: Tensor(Path("weights.bin"), dtype=dtypes.float32) keeps the file as storage; https://t.co/GnID6s1XC0() gives the bytes; t.assign(...) overwrites in place.
0
0
0