frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

Show HN: Glowstick – type level tensor shapes in stable rust

https://github.com/nicksenger/glowstick
31•bietroi•5h ago
Hi HN,

In the past few years I've become more interested in machine learning. Since I'm sure the same is true for many here, I wanted to share this project I've been working on: glowstick uses type-directed metaprogramming to keep track of tensor shapes in Rust's type system and determine which operations are permitted or not at compile time.

I find Rust has a lot of strengths when it comes to ML applications, but waiting until runtime to find shape related issues feels a bit strange since normally I don't run the code all that often while developing. Given Rust has fancy types available, I figured I'd try my hand at using them to address this.

I've added integration crates for the two ML frameworks I use most frequently, candle and burn, and included examples of implementing llama 3.2 in each using typed shapes for much of the model internals and inference loop. Mixtures of static and dynamic dimensions should be supported well enough for most applications at this point, though there are of course still improvements to be made.

Any feedback is appreciated!

Comments

bee_rider•2h ago
I wonder… I know Eigen has some tricks it can do when the size of a matrix is known beforehand. The obvious example, 4x4 matrix inverse gets special treatment. I assume they also be smart about loop unrolling, that sort of stuff.

Anything similar in here?

If not—actually, optimizing compilers are pretty okay nowadays anyway. I wonder if you’ve tried just seeing what Rust will do automatically with different optimization levels?

srean•2h ago
Could you take a look at Barry Jay's shape theory.

https://web.archive.org/web/20111015133833/http://www-staff....

This was used in his shape aware language FiSh, for dealing with multidimensional arrays. Shape compatibilities were statically type checked, if I recall correctly. Shapes were also used to optimize the loops.

[Programming in FISh] https://link.springer.com/article/10.1007/s100090050037

[Towards Dynamic Shaping] https://www.researchgate.net/publication/265975794_Towards_D...

raphaelty•1h ago
Very interesting work! Starred the project. Would love to see such features integrated into the compiler itself Anyway, fully agree with you on the complementarity of ML and Rust

Tell HN: Help restore the tax deduction for software dev in the US (Section 174)

1153•dang•5h ago•451 comments

Containerization is a Swift package for running Linux containers on macOS

https://github.com/apple/containerization
113•gok•1h ago•26 comments

Apple announces Foundation Models and Containerization frameworks, etc

https://www.apple.com/newsroom/2025/06/apple-supercharges-its-tools-and-technologies-for-developers/
397•thm•4h ago•249 comments

Show HN: Munal OS: a graphical experimental OS with WASM sandboxing

https://github.com/Askannz/munal-os
133•Gazoche•4h ago•51 comments

Apple introduces a universal design across platforms

https://www.apple.com/newsroom/2025/06/apple-introduces-a-delightful-and-elegant-new-software-design/
336•meetpateltech•4h ago•526 comments

What methylene blue can (and can’t) do for the brain

https://neurofrontiers.blog/what-methylene-blue-can-and-cant-do-for-the-brain/
61•wiry•3d ago•28 comments

Launch HN: Chonkie (YC X25) – Open-Source Library for Advanced Chunking

84•snyy•5h ago•29 comments

Domains I Love

https://www.ahmedsaoudi.com/blog/domains-i-love/
22•ahmedfromtunis•1h ago•13 comments

Go is a good fit for agents

https://docs.hatchet.run/blog/go-agents
84•abelanger•5d ago•66 comments

Show HN: Somo – a human friendly alternative to netstat

https://github.com/theopfr/somo
60•hollow64•4h ago•19 comments

Doctors could hack the nervous system with ultrasound

https://spectrum.ieee.org/focused-ultrasound-stimulation-inflammation-diabetes
107•purpleko•7h ago•11 comments

Bruteforcing the phone number of any Google user

https://brutecat.com/articles/leaking-google-phones
397•brutecat•8h ago•127 comments

Hokusai Moyo Gafu: an album of dyeing patterns

https://ndlsearch.ndl.go.jp/en/imagebank/theme/hokusaimoyo
118•fanf2•7h ago•13 comments

Pi in Pascal's Triangle

https://www.cut-the-knot.org/arithmetic/algebra/PiInPascal.shtml
35•senfiaj•3d ago•2 comments

Algovivo an energy-based formulation for soft-bodied virtual creatures

https://juniorrojas.com/algovivo/
48•tzury•6h ago•3 comments

The new Gödel Prize winner tastes great and is less filling

https://blog.computationalcomplexity.org/2025/06/the-new-godel-prize-winner-tastes-great.html
85•baruchel•7h ago•23 comments

Why quadratic funding is not optimal

https://jonathanwarden.com/quadratic-funding-is-not-optimal/
87•jwarden•7h ago•69 comments

How do you prototype a nice language?

https://kevinlynagh.com/newsletter/2025_06_03_prototyping_a_language/
7•surprisetalk•3d ago•0 comments

A bit more on Twitter/X's new encrypted messaging

https://blog.cryptographyengineering.com/2025/06/09/a-bit-more-on-twitter-xs-new-encrypted-messaging/
89•vishnuharidas•3h ago•58 comments

Show HN: Most users won't report bugs unless you make it stupidly easy

134•lakshikag•6h ago•73 comments

Myanmar's chinlone ball sport threatened by conflict and rattan shortages

https://www.aljazeera.com/gallery/2025/6/5/myanmars-chinlone-ball-sport-threatened-by-conflict-and-rattan-shortages
11•YeGoblynQueenne•4d ago•0 comments

A man rebuilding the last Inca rope bridge

https://www.atlasobscura.com/articles/last-inca-rope-bridge-qeswachaka-tradition
54•kaonwarb•2d ago•14 comments

Finding Shawn Mendes (2019)

https://ericneyman.wordpress.com/2019/11/26/finding-shawn-mendes/
325•jzwinck•14h ago•50 comments

Astronomers have discovered a mysterious object flashing signals from deep space

https://www.livescience.com/space/unlike-anything-we-have-seen-before-astronomers-discover-mysterious-object-firing-strange-signals-at-earth-every-44-minutes
51•gmays•2h ago•28 comments

Show HN: Glowstick – type level tensor shapes in stable rust

https://github.com/nicksenger/glowstick
31•bietroi•5h ago•3 comments

Maypole Dance of Braid Like Groups (2009)

https://divisbyzero.com/2009/05/04/the-maypole-braid-group/
32•srean•6h ago•3 comments

LLMs are cheap

https://www.snellman.net/blog/archive/2025-06-02-llms-are-cheap/
279•Bogdanp•10h ago•250 comments

RFK Jr. ousts entire CDC vaccine advisory committee

https://apnews.com/article/kennedy-cdc-acip-vaccines-3790c89f45b6314c5c7b686db0e3a8f9
31•doener•32m ago•1 comments

Potential and Limitation of High-Frequency Cores and Caches (2024)

https://arch.cs.ucdavis.edu/simulation/2024/08/06/potentiallimitationhighfreqcorescaches.html
18•matt_d•3d ago•10 comments

Google battling 'fox infestation' on roof of £1B London office

https://www.theguardian.com/uk-news/2025/jun/09/google-foxes-roof-london-kings-cross-office
14•pseudolus•37m ago•9 comments