Yurik changed the topic of #ocaml to: http://icfpcontest.cse.ogi.edu/ -- OCaml wins | http://www.ocaml.org/ | http://caml.inria.fr/oreilly-book/ | http://icfp2002.cs.brown.edu/ | SWIG now supports OCaml| Early releases of OCamlBDB and OCamlGettext are available
<hdaume> (based on changing my representation from foo to float, i got like a 20-fold speedup, so i guess it does use pointer-to-float...seems dumb to me)
<mattam> maybe needed for pattern matchin or something. Ask on the mailing list :)
<hdaume> will do :)
<emu> I don't see how you can avoid using boxed float in that case
<mattam> cause there's only one constructor, that could be an optimization
<emu> maybe
<emu> but why in the first place ...
<hdaume> for the same reason you'd use a strongly typed language at all: you want the typechecker to help you catch bugs
<emu> huh
<emu> this sounds like you need an abstract type
<emu> why would you use type foo = Foo of float?
<hdaume> ah, that's true...an abstract type would solve the problem too...i'm just not used to them (coming from the Haskell world)
<emu> Haskell does that stuff too, you know
<emu> maybe a bit better in some ways
<emu> you really do need to use an abstract type to properly take advantage of the static typing regime
<hdaume> i don't think you can do that in Haskell...if you say 'module M (T) where { type T = Double }' then everything which imports M can use the fact that a T is a Double (it's not "abstract")
<hdaume> the Haskell equivalent would be 'module M(T) where { newtype T = T Double }' in which case the T constructor will be optimized away, and you still get abstractness
<emu> the compiler should be able to take advantage of the fact that type foo = float if you put it in a module, but if you later change your mind you don't have to recode everything
<emu> I presume you were using a sum type because you wanted add further constructors later
<hdaume> no, i only want the one constructor
<hdaume> doing it as an abstract type is a better solution
<emu> but why, then?
<hdaume> but i still think it should be optimized away :)
<hdaume> why what?
<emu> seems like a rather unimportant optimization case
<mattam> you really mean generic for abstract type do you ? (i haven't encoundered the 'abstract type' yet)
<emu> I mean a type for which the implementation is hidden behind an interface
<mattam> ok
<hdaume> because it essentially mimicks the operation of floats, but with some extra overhead. if it weren't abstract, i might accidentally use *. on them or something. i wanted to prevent that from happening
<emu> but you'
<emu> re matching Foo f => do something to f
<emu> anyway
<hdaume> yeah...so the abstract type solution is better
hdaume has left #ocaml []
wkwk has joined #ocaml
wkwk has left #ocaml []
mattam has quit ["zZz"]
docelic is now known as docelic|sleepo
mattam has joined #ocaml
lament has quit ["Non sunt in celi quia fuccant uuiuys of heli"]
systems has joined #ocaml
systems has left #ocaml []
esabb has joined #ocaml
Yurik has joined #ocaml
xtrm has quit ["leaving"]
Yurik has quit [Read error: 104 (Connection reset by peer)]
mattam_ has joined #ocaml
Torquemada has joined #ocaml
docelic|sleepo is now known as docelic
mattam has quit [Read error: 110 (Connection timed out)]
gehel has joined #ocaml
esabb has quit [Remote closed the connection]
esabb has joined #ocaml
skylan has quit [Read error: 104 (Connection reset by peer)]
skylan has joined #ocaml
smkl has quit [Read error: 54 (Connection reset by peer)]
smkl has joined #ocaml
Dalroth has joined #ocaml
smkl has quit [Read error: 113 (No route to host)]
smkl has joined #ocaml
smklsmkl has joined #ocaml
smkl has quit [Remote closed the connection]
smklsmkl is now known as smkl
karryall has quit ["ERC vVersion 3.0 $Revision: 1.328 $ (IRC client for Emacs)"]
hdaume has joined #ocaml
<hdaume> how can i create an uninitialized array?
<smkl> arrays must always be initialized
smkl has quit [Read error: 113 (No route to host)]
smkl has joined #ocaml
smklsmkl has joined #ocaml
smkl has quit [Remote closed the connection]
xmkl has joined #ocaml
smklsmkl has quit [Read error: 104 (Connection reset by peer)]
xmkl is now known as smkl
graydon has joined #ocaml
<hdaume> wow that makes polymorphic arrays pretty useless
<hdaume> is there a way to get a default value of type 'a?
<hdaume> ...i guess there are GC issues at play here, though, so it makes some sense...
<smkl> nope, just safety
<hdaume> ...just seems to me that with the amount of stuff ocaml does behind the scenes (equality and ordering free for any type, hasing free for any type, etc...) that it could assign default values for me...
toadx has joined #ocaml
docelic is now known as docelic|away
merriam has quit [calvino.freenode.net irc.freenode.net]
merriam has joined #ocaml
gene9 has joined #ocaml
gene9 has quit [Client Quit]
smklsmkl has joined #ocaml
smkl has quit [Remote closed the connection]
merriam has quit [calvino.freenode.net irc.freenode.net]
merriam has joined #ocaml
<hdaume> is there a way to override the hash function for certain types? the internal hashing of arrays is ridiculously bad.
smklsmkl is now known as smkl
<smkl> use Hashtbl.Make
<smkl> for structural equality etc. the physical values can be used. obviously this doesn't work for default values
<hdaume> hrm...that doesn't really work for me because i wrote my own hash table module (Hashtbl wasn't sufficient because i needed things like map, etc.)
<hdaume> i just use Hashtbl.hash internally, but don't use the actually Hashtbl table impl.
two-face has joined #ocaml
<two-face> hi
<hdaume> is there a way to break out of a for loop (like 'break' in C)?
smklsmkl has joined #ocaml
smkl has quit [No route to host]
two-face has quit ["Client Exiting"]
smklsmkl is now known as smkl
karryall has joined #ocaml
Zadeh_ has joined #ocaml
docelic|away is now known as docelic
Zadeh has quit [Connection reset by peer]
Zadeh_ has quit [Read error: 104 (Connection reset by peer)]
Zadeh has joined #ocaml
esabb has left #ocaml []
Dalroth has quit []
lament has joined #ocaml
karryall has quit []
hdaume has quit ["using sirc version 2.211+KSIRC/981227-pre0.9"]