Andrej Karpathy's microgpt.py translated into the D programming language

Danny Arends Danny.Arends at gmail.com
Sat Feb 21 10:56:39 UTC 2026


I've finished on a port of Andrej Karpathy's microgpt.py to the D 
programming language. For those unfamiliar, it is a minimal, 
educational GPT implementation, great for understanding 
transformer architecture.

The D port stays faithful to the original: same architecture, 
same training logic. Just D instead of Python. D's operator 
overloading and struct semantics make it a surprisingly natural 
fit for this kind of low-level ML work.

Find it here: 
https://gist.github.com/DannyArends/12704c9207797a64338a5be4f1010bcf


More information about the Digitalmars-d-learn mailing list