On Jul 1, 2013, at 5:32 AM, Corey Richardson <[email protected]> wrote:

> This is a copy of https://github.com/mozilla/rust/issues/7525, here
> for broader discussion.
> 
> I propose to remove the float type from the language.
> 
> [snip]
> Variable width floating point code is also dangerous - frequently code
> has implicit assumptions about accuracy. Using floating point
> correctly is already hard enough, introducing variable width types
> makes it even harder.
> 
> I would remove float entirely, instead using f32 and f64 exclusively,
> also removing the f suffix for float literals. This allows user code
> to typedef float to what they want.
> _______________________________________________
> Rust-dev mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/rust-dev
> 

It's very common to typedef u8,u16, etc to the correct C type when doing 
embedded work. While there are reasons why C's int length is variable, having 
the variability can be confusing and can cause bugs..  

I would reckon tightening up Rusts floating point types to  have a obviously 
specific FP width to be a good thing. It also linguistically allows for f80 or 
f128 if so desired.

I suppose I should point out that some modern chips don't have a FP unit. 
Pretty sure that's not relevant in this thread, but it might be worth taking up 
elsewhere( what to do when your chip betrays you).

-paul
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to