The arguments against changing are pretty strong, but I’d really like it if 
Julia did a bit less automatic promotion. For example, it would be great if 
sum(x::T…) returned a value of type T.

 — John

On Jan 15, 2014, at 5:32 AM, Stefan Karpinski <ste...@karpinski.org> wrote:

> We already provide all the necessary intrinsics for 32-bit arithmetic, so 
> it's pretty easy to write a module that redefines arithmetic operations on 
> integers to do this, but it's definitely some work that would need to be 
> done. I'd be in favor of having this option. The biggest issue is that it 
> would only apply in lexical scope. I.e. even if Int16 + Int16 => Int16, you'd 
> still have sum(Int16[]) => Int, since sum is defined in Base. So to get the 
> full effect, this would probably need to be a global switch, at which point 
> you're really just talking about running in 32-bit mode on a 64-bit system.
> 
> 
> On Wed, Jan 15, 2014 at 5:32 AM, Miles Lubin <miles.lu...@gmail.com> wrote:
> Just to throw in my two cents, I don't think it's the right approach to brush 
> off a class of performance optimizations that has a valid use case in 
> practice and can lead to a 4x speedup. There should at least be *some* way to 
> access nonpromoting integer operations, even if the default operators do 
> promote.
> 

Reply via email to