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

Sergey kornburn at yandex.ru
Sat Feb 21 12:09:52 UTC 2026


On Saturday, 21 February 2026 at 10:56:39 UTC, Danny Arends wrote:
> 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

Nice. Thanks
The 3rd one :) Will check for some improvements in mine

https://github.com/cyrusmsk/microDpt
https://github.com/denizzzka/microgpt_dlang (WIP)


More information about the Digitalmars-d-learn mailing list