Show HN: Modeling the Human Body in Rust So I Can Cmd+Click Through It
Show HN (score: 40)Description
I was reading medical papers and textbooks, but kept getting lost jumping between topics. I thought: what if I could just Cmd+Click through this like code? What if "ALDH2 gene" was actually clickable, and took me to the variant, the phenotype, the population frequencies?
So I started modeling human biology in Rust with my Ralph agent (Claude in a loop, ty ghuntley). Turns out the type system is perfect for this. Every biological entity is strongly-typed with relationships enforced at compile time.
After 1 day of agent coding: - 277 Rust files, ~95k lines of code - 1,561 tests passing - 13 complete organ systems - Genetics with ancestry-specific variants - Clinical pathology models
Try it:
git clone https://github.com/lantos1618/open_human_ontology cd open_human_ontology cargo run --example ide_navigation_demo
Then open `examples/ide_navigation_demo.rs` and Cmd+Click through:
Understanding Asian flush:
AsianGeneticVariantsCatalog::get_metabolic_variants()
// Click through to:
// → ALDH2 gene on chromosome 12q24.12
// → rs671 variant (Glu504Lys)
// → 40% frequency in Japanese population
// → Alcohol flush reaction
// → 10x esophageal cancer risk with alcohol
// → Acetaldehyde metabolism pathway
Understanding migraines: Migraine { subtype: WithAura, triggers: [Stress, LackOfSleep, HormonalChanges], genetic_variants: ["rs2075968", "rs1835740"], ... }
// Click through to:
// → 17 migraine trigger types
// → 12 aura symptom types
// → Genetic risk factors
// → Why clusters happen (HormonalChanges → Menstruation)
Now I can actually navigate the connections instead of flipping through PDFs. Heart → CoronaryArtery → Plaque. VisualCortex → 200M neurons → NeuralConnection pathways. It's like Wikipedia but type-checked and with jump-to-definition.
This isn't production medical software - it's a learning tool. But it's way more useful than textbooks for understanding how biological systems connect.
The agent keeps expanding it. Sometimes it OOMs but that's part of the fun.
Tech: Rust, nalgebra, serde, rayon, proptest
I am not a dr or medical professional this is for my education you can commit to it if you want to or review and open some PR's if you find wrong information or want to add references.
More from Show
Show HN: A PSX/DOS style 3D game written in Rust with a custom software renderer
Show HN: A PSX/DOS style 3D game written in Rust with a custom software renderer So, after years of abandoning Rust after the hello world stage, I finally decided to do something substantial. It started with simple line rendering, but I liked how it was progressing so I figured I could make a reasonably complete PSX style renderer and a game with it.<p>My only dependency is SDL2; I treat it as my "platform", so it handles windowing, input and audio. This means my Cargo.toml is as simple as:<p>[dependencies.sdl2] version = "0.35" default-features = false features = ["mixer"]<p>this pulls around 6-7 other dependencies.<p>I am doing actual true color 3D rendering (with Z buffer, transforming, lighting and rasterizing each triangle and so on, no special techniques or raycasting), the framebuffer is 320x180 (widescreen 320x240). SDL handles the hardware-accelerated final scaling to the display resolution (if available, for example in VMs it's sometimes not so it's pure software). I do my own physics, quaternion/matrix/vector math, TGA and OBJ loading.<p>Performance: I have not spent a lot of time on this really, but I am kind of satisfied: FPS ranges from [200-500] on a 2011 i5 Thinkpad to [70-80] on a 2005 Pentium laptop (this could barely run rustc...I had to jump through some hoops to make it work on 32 bit Linux), to [40-50] on a RaspberryPi 3B+. I don't have more modern hardware to test.<p>All of this is single threaded, no SIMD, no inline asm. Also, implementing interlaced rendering provided a +50% perf boost (and a nice effect).<p>The Pentium laptop has an ATI (yes) chip which is, maybe not surprisingly, supported perfectly by SDL.<p>Regarding Rust: I've barely touched the language. I am using it more as a "C with vec!s, borrow checker, pattern matching, error propagation, and traits". I love the syntax of the subset that I use; it's crystal clear, readable, ergonomic. Things like matches/ifs returning values are extremely useful for concise and productive code. However, pro/idiomatic code that I see around, looks unreadable to me. I've written all of the code from scratch on my own terms, so this was not a problem, but still... In any case, the ecosystem and tooling are amazing. All in all, an amazing development experience. I am a bit afraid to switch back to C++ for my next project.<p>Also, rustup/cargo made things a walk in the park while creating a deployment script that automates the whole process: after a commit, it scans source files for used assets and packages only those, copies dependencies (DLLs for Win), sets up build dependencies depending on the target, builds all 3 targets (Win10_64, Linux32, Linux64), bundles everything into separate zips and uploads them to my local server. I am doing this from a 64bit Lubuntu 18.04 virtual machine.<p>You can try the game and read all info about it on the linked itch.io page: <a href="https://totenarctanz.itch.io/a-scavenging-trip" rel="nofollow">https://totenarctanz.itch.io/a-scavenging-trip</a><p>All assets (audio/images/fonts) where also made by me for this project (you could guess from the low quality).<p>Development tools: Geany (on Linux), notepad++ (on Windows), both vanilla with no plugins, Blender, Gimp, REAPER.
No other tools from this source yet.