> Personally I'd appreciate a type system that's able to express SI units, 
> which C++ and Haskell are powerful enough to do[1].

I agree. This is of huge importance when it comes to providing compile time 
safety guarantees. And if the language is powerful enough to express SI units, 
then it also demonstrates that it might be powerful enough to allow users to 
grow the language in other directions not anticipated by the language designers.

~Brendan

On 16 Nov 2013, at 3:26 pm, Isaac Dupree <[email protected]> 
wrote:

> On 11/15/2013 11:05 AM, Gábor Lehel wrote:
>> Like C++, types could be parameterized over constants. Again, the syntax
>> could mirror their declarations. For example, a function to construct a
>> fixed-length array:
>> 
>>     fn make_n<static N: int>(n: int) -> ~[int, ..N] { [n, ..N] }
>> 
>> Interesting questions here include what types to allow, how or whether
>> to handle literals of various types as type arguments, and the constant
>> expression sublanguage.
> 
> Personally I'd appreciate a type system that's able to express SI units, 
> which C++ and Haskell are powerful enough to do[1].  For example, if using 
> the right library,
>    let velocity = distance / time;
> would be a compile error if the dimensions do not match up properly.  I added 
> such a system to a C++ physics simulation and it caught some of our mistakes.
> 
> *scurries off to learn Rust properly*
> -Isaac
> 
> [1] C++: Boost.Units; Haskell: 
> http://www.haskell.org/haskellwiki/Physical_units
> _______________________________________________
> Rust-dev mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/rust-dev

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

Reply via email to