Hacker Newsnew | past | comments | ask | show | jobs | submit | subset's commentslogin

Andrej Karpathy has a walkthrough blog post here: https://karpathy.github.io/2026/02/12/microgpt/

That is the article being discussed.

Gosh, tired brain moment apologies. I thought it'd linked to the original code gist.

It did before, link was changed.

I had good fun transliterating it to Rust as a learning experience (https://github.com/stochastical/microgpt-rs). The trickiest part was working out how to represent the autograd graph data structure with Rust types. I'm finalising some small tweaks to make it run in the browser via WebAssmebly and then compile it up for my blog :) Andrej's code is really quite poetic, I love how much it packs into such a concise program

Storing the partial derivatives into the weights structure is quite the hack, to be honest. But everybody seems to do it like that.

how did you do the transliteration/port?

Great work! Might do it too in some other language...

I got a convertion to Java. It worked (at least I think...) in the first try.

Then I want to convert this to my own programming language (which traspiles to C). I like those tiny projects very much!


how did you do the transliteration/port?

Zig, here.

Anything but Python


At least python can do this exercise without pulling 3rd party dependencies :)

What's missing from Zig and its std lib for this?

Zig version [0] doesn't need any external dependencies.

0. https://tangled.org/m17e.co/microgpt


Sweet! Presumably this one is even faster than the JS?

I think that web browsers only allow up to 4GB of memory per tab.


https://abstractnonsense.xyz/

My personal blog, I normally post about maths and computer science. But sometimes random design things, or bits about linguistics and words.


I recently wrote an eigenvalue solver for an interactive component on my blog with Rust compiled to WebAssembly. Being able to write-once and compile for the web and desktop felt like the future. But then, I'm no fan of JavaScript and wouldn't have attempted it if WASM didn't exist.


I've just recently done the same, turned Rust into WASM and it does feel great. Being able to compile mature and well-tested libraries into WASM instead of trying to find a JS equivalent is incredible value.


Thanks for writing this game! I came across it after seeing your Checkers written in Rust for WASM game[0], and thought it deserved an HN submission of its own.

[0] https://github.com/kevinAlbs/Checkers


Ooh, thanks for sharing that algorithm! Somehow, I didn't come across this and jumped straight into using the QR algorithm cited everywhere.

I found it hard to find a good reference that had a clean implementation end to end (without calling BLAS/LAPACK subroutines under the hood). It also wasn't easy to find proper convergence properties for different classes of matrices, but I fear I likely wasn't looking in the right places.


In particular, Hugo overhauled its templating system in [v0.146](https://gohugo.io/templates/new-templatesystem-overview/) which resulted in build fails for my blog when I upgraded.

As of today, the [docs](https://gohugo.io/templates/lookup-order/) still haven't been fully adjusted to reflect the new system:

> We did a complete overhaul of Hugo’s template system in v0.146.0. We’re working on getting all of the relevant documentation up to date, but until then, see this page.

I don't mind breaking changes, but it'd sure be nice if the documentation reflected the changes.


Location: Melbourne, Victoria, Australia Remote: Yes (preferably) Willing to relocate: Yes. Willing to to relocate to England.

Technologies: Python. Have also worked with Haskell, C, Prolog, Java, MATLAB, SAS to various degrees of proficiency.

Résumé/CV: Please check my LinkedIn from my profile.

Email: hello@abstractnonsense.xyz

Blog: https://abstractnonsense.xyz. I like to blog about mathematics and computer science.

Pitch: Currently working as a Data Scientist and early-careers AI researcher at a major Australian bank. Bachelor in mathematics & CS, looking to go back for a Masters in mathematics. I'm looking for challenging roles that ideally involve maths. I enjoy functional programming, reading books and papers, blogging about arcane things and learning new languages and algorithms.


I'm writing a toy eigenvalue solver in Rust using the QR algorithm. I didn't intend to, but I recently discovered the Gershgorin Circle Theorem and thought it'd be neat to create an interactive visualisation for my [blog](https://abstractnonsense.xyz).

I don't like JavaScript, and I've been meaning to learn Rust for a while, so I'm compiling the Rust algorithm to WebAssembly to run in the browser natively! It's been a fun trip back into the arcane world of numerical algorithms and linear algebra!


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: