Mini-rust in Rust 017: Handling float literals

February 21, 2025 [Programming, Programming Languages, Rust, Tech, Videos] #mini-rust

We're still on a mission to do some type-checking, and our plan is to allow writing let x: i32 = 3.0;, then produce a type error because 3.0 is not an integer that can be stored in an i32. The last piece of the puzzle is to be able to handle the 3.0 bit - i.e. to be able to lex, parse and evaluate floating-point numbers.

You can find the source code at codeberg.org/andybalaam/milk and more of my stuff at artificialworlds.net