frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Show HN: StartupWiki – A Free Alternative to Crunchbase

https://startupwiki.tech/
76•shpran•3h ago•24 comments

Show HN: We post-trained a model that pen tests instead of refusing

https://www.argusred.com/cli
34•dk189•6h ago•12 comments

Show HN: Make PDFs look scanned (CLI or in the browser via WASM)

https://github.com/overflowy/make-look-scanned
17•overflowy•1h ago•8 comments

Show HN: Tiny – An interpeted dynamic langauge with inline Go native functions

https://github.com/confh/Tiny
7•confis•59m ago•0 comments

Show HN: My Windows XP portfolio with working Game Boy and iPod

https://mitchivin.com/
11•mitchivin•34m ago•7 comments

Show HN: Microcrad – Micrograd Reimplemented in C

https://github.com/oraziorillo/microcrad
41•oraziorillo•3d ago•11 comments

Show HN: An n8n alternative where coding agents build the workflows, not humans

https://velane.sh/
3•abhishekraj272•1h ago•0 comments

Show HN: Cody – Voice control for Neovim using its own commands, LSP

https://github.com/juancgarza/cody
3•jcgr•1h ago•0 comments

Show HN: Criterion Closet as a website – pull any of 1,247 films off the shelf

https://the-criterion-closet.vercel.app
8•olievans•6h ago•3 comments

Show HN: Metiq: a real time 3D globe for 100 public datasets

https://metiq.space
140•rakeda•4d ago•41 comments

Show HN: Talos – Open-source WASM interpreter for Lean

https://github.com/cajal-technologies/talos
99•mfornet•2d ago•25 comments

Show HN: Tiny.Place – AI Social network for orchestration, payments & jobs

https://github.com/tinyhumansai/tiny.place
3•enamakel•4h ago•3 comments

Show HN: Hi-shell – type commands in English, get ghost text in zsh

https://github.com/longyijdos/hi-shell
3•longyijdos•4h ago•0 comments

Show HN: Gerrymandle - Daily puzzle game where you redraw electoral districts

https://gerrymandle.cc/
222•realmofthemad•2d ago•77 comments

Show HN: Web-Based FPGA Viewer

https://edacation.github.io/nextpnr-viewer/
3•malmeloo•6h ago•0 comments

Show HN: Make every bug perfectly reproducible

https://workers.io/
13•chaitanyya•12h ago•0 comments

Show HN: Are You in the Weights?

https://www.intheweights.com/
454•turtlesoup•1d ago•241 comments

Show HN: AlphaVibe – AI that reads your DeFi wallet live via DeBank

https://quantarena.xyz/
3•denis4inet•7h ago•0 comments

Show HN: Pagecast – Publish Markdown/HTML Reports to Cloudflare Pages

https://github.com/Amal-David/pagecast
31•amaldavid•2d ago•8 comments

Show HN: An 8-bit live gamecast for baseball

https://ribbie.tv/watch
254•brownrout•3d ago•138 comments

Show HN: Aastro – Extendable API Gateway in Go

https://starwalkn.github.io/aastro-docs/
2•starwalkn•11h ago•2 comments

Show HN: We built an 8-bit CPU as 2nd year EE students

https://github.com/c0rRupT9/STEPLA-1
107•CorRupT9•4d ago•46 comments

Show HN: Music from every single country on Earth, generated in Esperanto

https://elevenexperiments.com/around-the-world?lang=eo&genre=de
13•ktoyame•1d ago•10 comments

Show HN: Autonomy – Self-Harness/Self-Directed AI Agent Core Under Development

https://autonomy-landing-page.vercel.app/
4•agentic_vector•13h ago•0 comments

Show HN: High-Res Neural Cellular Automata

https://cells2pixels.github.io/
204•esychology•3d ago•54 comments

Show HN: Pytest-tia – run only the tests your Git diff affects, with receipts

https://github.com/breadMSA/pytest-tia
2•BreadWasEaten•13h ago•1 comments

Show HN: NanoEuler – GPT-2 scale model in pure C/CUDA from scratch

https://github.com/JustVugg/nanoeuler
6•vforno•1d ago•0 comments

Show HN: Crawlie – Free open-source SEO audit tool for humans and agents

https://github.com/spronta/crawlie
19•seandotexe•1d ago•6 comments

Show HN: Rundown - Niche Intelligence for YouTube Creators

https://getrundown.xyz
5•razasaad92•16h ago•0 comments

Show HN: cuTile Rust: Safe, data-race-free GPU kernels in Rust

https://github.com/nvlabs/cutile-rs
106•melihelibol•3d ago•18 comments
Open in hackernews

Show HN: Microcrad – Micrograd Reimplemented in C

https://github.com/oraziorillo/microcrad
41•oraziorillo•3d ago

Comments

oraziorillo•3d ago
Hey HN, I'm Orazio. I built microcrad (with a 'c'), a tiny scalar-valued automatic differentiation engine, with a small multi-layer perceptron implementation on top. It's reimplementation of Andrej Karpathy's micrograd in C. For me, this was a learning project to revisit backpropagation from first principles, with the additional difficulties that come with programming in C.

The basic idea is the same as micrograd: each number is a `Value` node in a computation graph, ops connect nodes, and the `backward` function topologically sorts the graph before applying the chain rule in reverse. The C-specific parts are memory management and two simple data structures I needed to implement backprop: sets and vectors.

The source code is about 1,350 lines, MIT licensed, and well documented. Dependencies are just the standard library and libm. In addition, the repo contains two examples to showcase how the engine works: a toy regression and an MNIST task.

What this is not: a framework to build and train neural networks in production. Being scalar-valued makes it slow, and it wasn't built for numerical robustness or large datasets. There's no commercial aim here; it's a learning project.

If you read through it, I'd like to hear thoughts, both on the ML engineering aspect and on anything that reads as un-idiomatic C.

TituxDev•2d ago
I did a similar project, but my approach to the topology definition was declaring perceptron structs with inputs as pointer arrays and output as a regular variable. With this scheme, perceptrons can reference directly to the outputs from other perceptrons — or even their own output (I haven't implemented that yet).
smasher164•2h ago
Is there a reason you didn't go with something like Boehm for a library gc, instead of writing your reference counting implementation?
dgellow•2h ago
Learning, I presume?
toxik•1h ago
Also refcounting is not a very difficult thing to implement
smasher164•1h ago
I guess I interpreted this part of their README as implying that the author found RC too fragile

> Reference counting buys correctness and composability, but at a cost.

> Disadvantage #1: you must balance every reference. Each value_create, value_retain, and each operation's implicit retain of its operands has to be matched by a value_release. Forget one and you leak; do one too many and you free memory that is still in use. The training examples in examples/ are verbose precisely because they are scrupulous about this in their error paths; that verbosity is the price of leak-free C.

oraziorillo•26m ago
In general yes, but not if you are disciplined.

I’d put it this way: though the idea of ref counting felt very natural at the beginning for my use case, at some point I realized there were probably better techniques to achieve the same goal. I found myself multiple times writing nonsense like:

sum = value_add(v1, v2) mul = value_mul(sum, v3) [...] value_release(sum) value_release(mul)

so that later I could release the sum. When you only have one intermediate value it’s still acceptable, but at 3-4 it starts getting cumbersome.

After asking for feedback, someone rightfully pointed out that the better and faster approach for an autograd engine is using an arena allocator. My reason for saying “rightfully” is that arenas are ideal when you have many “objects” that have the same lifespan, such as the values involved in the forward/backward pass. RC is better when you have a lot of “objects” with independent lifespans.

uecker•41m ago
Two things stick out as un-idiomatic for C. First, the casts before malloc are unnecessary. This you do in C++ but not in C. Second, names with beginning underscore are reserved, and the underscore + capital letter is specifically problematic.

The rest looks fairly nice but there are a couple of things I would do differently: I would not have the tests for NULL, use signed integers for indices and dimensions, use a flexible array member to integrate the data into the vector type directly, and omit the capacity field (as long as benchmarking does not show it is really needed). I would also use variably modified types for bounds checking, and with C23 the include guards become largely unnecessary.

valleyer•15m ago
Names beginning with double underbar (or single underbar + capital letter) are reserved. Single underbar + lowercase is not. C23 §6.4.2.1.
megadragon9•17m ago
Interesting project. Do you think manual memory management help understand computational graph lifecycle better, or does it distract from backprop itself?

btw, I went down the micrograd path with numpy-primitives all the way to building a PyTorch clone that can pre-train and post-train LLMs (https://github.com/workofart/ml-by-hand). My learning focus was on the math/calculus <-> high-level APIs, instead of efficiency. I'm glad to see more people tackling this problem from different angles.

oraziorillo•49m ago
Mainly did it for learning, as dgellow correctly presumed, but also there’s something intrinsically beautiful in writing code with zero dependencies