Glowstick – type level tensor shapes in stable rust
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…
Glowstick – type level tensor shapes in stable rust launched on June 9, 2025 with 53 votes, #538 of 7,999 launches that month and more than 90% of that year's launches. The site was still online in September 2026, 1 year on.
In plain words
Glowstick is a Rust library that uses type-level programming to track tensor shapes at compile time, enabling developers to catch shape-related errors before runtime. It integrates with machine learning frameworks like Candle and Burn, allowing developers to write ML code where tensor operations are validated during compilation rather than execution. This approach leverages Rust's type system to prevent dimension mismatch bugs early in development.
written from the facts on this page · September 2026
From the sources
Type-level tensor shapes in Rust. Contribute to nicksenger/Glowstick development by creating an account on GitHub.
This crate makes working with tensors in Rust safe, easy , and fun by tracking their shapes in the type system! use candle :: { DType , Device } ; use glowstick :: { assert_shape_type_eq , num :: { U1 , U2 } , Shape2 } ; use glowstick_candle :: Tensor ; let a : Tensor < Shape2 < U2 , U1 > > = Tensor :: zeros ( DType :: F32 , & Device :: Cpu ) . expect ( "tensor A" ) ; let b : Tensor < Shape2 < U1 , U2 > > = Tensor :: zeros ( DType :: F32 , & Device :: Cpu ) . expect ( "tensor B" ) ; let c = a . matmul ( & b ) . expect ( "matmul" ) ; assert_shape_type_eq ! ( c , Shape2 < U2 , U2 > ) ; Several operations are available: use candle :: { DType , Device } ; use glowstick :: { assert_shape_type_eq…from github.com
In the maker’s words, at launch
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…
Does a similar job
all alternatives →
Write generative fine art in Rust2020 · paytonturnage.gitbook.io · ▲306
Algorithm Cookbook in Rust2017 · github.com · ▲320Common data structures and algorithms in Rust. Contribute to EbTech/rust-algorithms development by creating an account on GitHub.
A Graphviz Implementation in Rust2022 · github.com · ▲182Layout is a rust library and a tool that renders Graphviz dot files. - nadavrot/layout
I built a tensor library from scratch in C++/CUDA2025 · github.com · ▲119Hi HN, Over the past few months, I've been building `dsc`, a tensor library from scratch in C++/CUDA. My main focus has been on getting the basics right, prioritizing a clean API, simplicity, and clear observability for running small LLMs locally. The key features are: - C++ core with CUDA support written from scratch. - A familiar, PyTorch-like Python API. - Runs real models: it's complete enough to load a model like Qwen from HuggingFace and run inference on both CUDA and CPU with a single line change[1]. - Simple, built-in observability for both Python and C++. Next on the roadmap is…
Tweening web visualisation, in Rust – (WASM)2024 · rustween.mtassoumt.uk · ▲94Using wasm-bindgen, and the tween-rs crate
- RWRust/WASM lighting data toolkit – parses legacy formats, generates SVGsDec 2025 · eulumdat.icu · ▲52
Hi HN, I'm Holger, a developer who worked in the lighting industry. I built this to scratch my own itch and put it on crates.io and PyPI where nothing like it existed. The old file formats (EULUMDAT from 1990, IES from 1991) still work fine for basic photometry. But the industry is moving toward spectral data – full wavelength distributions instead of just lumen values. The new standards (TM-33, ATLA-S001) are barely supported by existing tools. So this handles both: legacy formats for compatibility, spectral data for anyone who wants to work with the new standards. Stack: Rust core, then…
More ai this month
the category →



Paintings by AI models: programs run through a simulation of oil paint.
AI · 20d ago · stillwet.art

PixVerse R2▲381A real-time world model you can explore and change
AI · 28d ago · world.pixverse.video
Source: Show HN post ↗ · launch text quoted in part
Launched alongside, June 2025
the whole month →- IM
Hey HN! Pilots everywhere are required to keep a logbook of all their flying hours, aircraft, airports, and so on. Since I track everything digitally (some people still just use paper logbooks!), I put together some data visualizations and a few 3D globes to show my flying history. This globe is probably my favourite so far: https://jameshard.ing/pilot/globes/all If you’ve got ideas for other graphs or ways to show this kind of data, I’d love to hear them!
Life & fun · 2025 · jameshard.ing

Stunning presentations with AI. No design skills required.
AI · 2025 · chroniclehq.com

Build native mobile apps for iOS and Android without code.
Dev tools · 2025 · bble.io


All your connections, across all your socials.
AI · 2025 · pally.com

I was the main contributor to workout.lol, an open-source fitness app to easily build a workout routine. The project had traction (1.4k GitHub stars, 95 forks, ~20K visits/month), but was eventually sold due to video licensing hurdles. The new owner stopped maintaining it, and the repo went abandoned. Over the next 9 months, I sent 15 emails to try to save it : no replies. Feature requests & issues were ignored. The community was left with a "broken" tool let's say. I couldn't just let it die So I built the new version from scratch with the same open-source spirit, but a better…
Dev tools · 2025 · github.com