And perhaps having FloatVector, Float64Vector, Float32Vector,
ComplexVector, Complex64Vector, Complex128Vector, UintVector,
Uint8Vector, Uint16Vector,. Uint32Vector etc seemed like a bit much?
David
--
David Roundy
We have mooted the idea of making float be 64 bits
and the idea of dropping it entirely. I don't remember
what the end result was other than that nothing happened.
We don't use floating point very much.
Russ
Actually, dropping float entirely sounds nice to me. It is nice to be
explicit, and (unlike int) I don't think there is ever a use where one
just wants a "reasonable" float type. On the other hand, it doesn't
greatly bother me either, even though I do use a lot of floating point
(albeit not all that much in go, so far).
--
David Roundy
David
--
David Roundy
> Actually, dropping float entirely sounds nice to me. It is nice to be
> explicit, and (unlike int) I don't think there is ever a use where one
> just wants a "reasonable" float type. On the other hand, it doesn't
> greatly bother me either, even though I do use a lot of floating point
> (albeit not all that much in go, so far).
If you're really wanting to let people achieve what they want in
numerical accuracy, it may be best to drop it entirely. It's not just
for the usual assume tradeoff of storage vs. accuracy: for some
algorithms. float64 is *less* accurate (yep) than float32. Yes, it's
counterintuitive, but it is a real effect.
OTOH, maybe people who care about that level of accuracy should not be using go?
ron
You've piqued my curiosity: in what sort of algorithm will float32 be
more accurate?
--
David Roundy
I'm trying to find the paper, and slides, but failing. It was
presented at the LACSI 2006 symposium in a workshop.
I'll try to get it.
ron
As someone who does, I ask that you please go ahead and do one or the
other. It doesn't matter very much which, so long as the type isn't left
up to the implementation. Keeping 'float' as implementation-defined
means that people will run into the situation where person A writes a
program expecting float to be 64 bits, and person B runs it in 32-bit
arithmetic and gets wrong answers, which in many cases will be wrong
enough to matter but not wrong enough to be obviously wrong. That's a
bad type of bug to deal with -- much worse than with integers, where
overflowing a 32-bit integer generally gets you into obviously-wrong
behavior.
Complete removal of 'float' would be my preference, but keeping it as an
alias for float64 would also be acceptable. (As an alias for float32,
less so; people who choose 'float' because they don't know what they want
probably should be given the higher precision, as they're less likely to
hurt themselves that way.)
--
Norman Yarvin http://yarchive.net
Not against go taking the HPC route, just saying that it doesn't seem to
be doing so.
> I think Go is very well-suited to HPC and scientific/mathematical
> programming, actually.
I think it might be, but is has a ways to go. Let us not forget Java Grande.
ron
> Java certainly is a major player in this area, although I think the
> JVM's memory consumption is an issue that's not acknowledged quite
> enough. I also personally find type hierarchies particularly
> frustrating with numerical programming--that's one of the things I
> like about Go in that regard--but that's more my personal preference
> probably.
What i was really trying to say -- I can't believe I was too subtle
:-) -- was that just because a language is wonderful, does not
necessarily mean it is wonderful for everything. Lots of cash got
thrown at Java to make it work for HPC as part of Java Grande, and the
conclusion in the end was that it did not represent any real
improvement over what was there, quite the contrary, it was a dog, in
part because some of those things that made it work well for its
intended use were not a good thing for HPC.
So, while Go is great, that does not imply that it is great for FPGAs
and HPC and whatever else happens to cross people's minds. Anytime a
new good language comes out there is a tendency to want to use it for
EVERYTHING, which can be detrimental to making it work well for its
intended uses.
ron
Which would then make operators a bit redundant...
Ellie
Eleanor McHugh
Games With Brains
http://feyeleanor.tel
----
raise ArgumentError unless @reality.responds_to? :reason
What happens when you override an int? Does the new type magically
have these built-in methods unless overridden? Or do you need to
define these for every type derived from a built-in that you don't
want to be at a disadvantage?
Also, this would be less efficient than the current implementation,
since it would require dynamic dispatch where no dispatch was
originally necessary.
PS - Go doesn't have classes. This may sound pedantic, but it isn't. I
find when people call types or structs "classes" in Go, even if
informally, they tend to unconciously introduce incorrect assumptions
into their reasoning about them.
I tend to agree, although I'd probably ditch the syntactic sugar altogether - parsing operators is an ugly wart on most language designs :)
I know, shocking isn't it ;)
graham