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
jao has quit ["ERC v2.93 $Revision: 1.305 $ (IRC client for Emacs)"]
graydon has joined #ocaml
smklsmkl has joined #ocaml
smkl has quit [Remote closed the connection]
graydon has quit ["xchat exiting.."]
graydon has joined #ocaml
graydon_ has joined #ocaml
graydon has quit [Read error: 60 (Operation timed out)]
Dr3n has joined #ocaml
<Dr3n> hi
<Dr3n> can I use ur topic
<Dr3n> to use in another channel?
graydon_ is now known as graydon
Dr3n has left #ocaml []
mrvn has joined #ocaml
mrvn_ has quit [Read error: 110 (Connection timed out)]
yangsx has joined #ocaml
yangsx has quit ["Client Exiting"]
graydon has quit ["xchat exiting.."]
smklsmkl is now known as smkl
Yurik has joined #ocaml
lam has quit ["leaving"]
Yurik has quit [Read error: 60 (Operation timed out)]
karryall has joined #ocaml
smkl has quit [Read error: 104 (Connection reset by peer)]
smkl has joined #ocaml
smkl has quit [Read error: 60 (Operation timed out)]
smkl has joined #ocaml
pk5 has quit [Read error: 104 (Connection reset by peer)]
systems has joined #ocaml
systems has quit ["Client Exiting"]
gl has joined #ocaml
graydon has joined #ocaml
ayrnieu has joined #ocaml
ayrnieu` has joined #ocaml
ayrnieu has quit [Read error: 60 (Operation timed out)]
nkoza has quit [Read error: 110 (Connection timed out)]
Dalroth has joined #ocaml
malc has joined #ocaml
karryall has quit []
hdaume has joined #ocaml
<hdaume> anyone alive in here?
<malc> yes
<hdaume> nm, i figurd out my problem :)
<hdaume> actually no, i didn't ;)
<malc> uh, make up your mind
<hdaume> hold on...i might be able to figure this out...i'll ask again in a little bit if i can't
<malc> k
Dybbuk has left #ocaml []
malc has quit ["no reason"]
graydon has quit [Read error: 104 (Connection reset by peer)]
graydon has joined #ocaml
<hdaume> if i have a module ArrayGraph in arrayGraph.ml and I have another module Hmm in hmm.ml which "open"s ArrayGraph, do I need to have a corresponding .mli file for ArrayGraph?
<mrvn> nope
<hdaume> hrm....when i try to compile ('ocamlc arrayGraph.ml hmm.ml') it gives me an error "Unbound value labNodes" from hmm.ml which is defined in arrayGraph.ml
<ayrnieu`> from a guess, try compiling compiling arrayGraph.ml to arrayGraph.cma (?) and then 'ocamlc arrayGraph.cma hmm.ml'
gl has quit [Read error: 54 (Connection reset by peer)]
<whee> you need to refer to labNodes as ArrayGraph.labNodes in hmm.ml
<whee> unless you put 'open ArrayGraph' at the top of hmm.ml
<hdaume> at the top of hmm.ml, i have "open ArrayGraph;;"
<hdaume> ayrnieu`: .cma? if i just use ocamlc, i get a .cmo file
<whee> how is labNodes defined in arraygraph?
<ayrnieu`> hdaume - sorry, that's what I meant.
<hdaume> arrayGraph.ml looks like "...module ArrayGraph = struct ... let labNodes (ne, ea) = let rec label i l = match l with [] -> [] | (x::xs) -> (x,i) :: label (i+1) xs in label 0 (to_list ne);;"
<hdaume> and then there's an "end;;" at the end
<whee> that's your problem
<whee> you neede to ArrayGraph.ArrayGraph.whatever with that structure
<whee> a file is automatically put into a module, then any internal structures get their own
<hdaume> whee: huh? (i'm obviously new to ocaml)
MegaWatS has joined #ocaml
<hdaume> so i should have 'module ArrayGraph = struct...' 9in arrayGraph.ml?
<hdaume> just have my definitions?
<whee> you could do that
<whee> this is one of the areas I'm kind of fuzzy on too, trying to find something heh
<hdaume> :) okay
<whee> butif you want to define a module for the sole purpose of using it in other files, you usually don't want to put the explicit 'module ssomething = struct blah blah" in the .ml
<hdaume> okay cool...thanks
<whee> ooo okay I found a good example if you have the ocaml source
<hdaume> i do
<whee> filename.mli and filename.ml in ocaml/stdlib/ is something to look at
gl has joined #ocaml
Yurik has joined #ocaml
<Yurik> re
<whee> hola
<Yurik> whee: how are you ?
* Yurik is discussing ocaml-based project w/ another participant ;))
<whee> I'm incredibly bored
<whee> heh
<whee> all my projects are pretty much done :|
* Yurik is tired developing project alone
Yurik_ has joined #ocaml
Yurik has quit [Read error: 54 (Connection reset by peer)]
<Yurik_> re
<Yurik_> got disconnected
<Yurik_> the most bad think that most of OSS developers even didn't hear about ocaml
<Yurik_> and seeking developers is pretty complex
Yurik_ is now known as Yurik
<Yurik> s/think/thing
<whee> most 'developers' I've interacted with just dismiss ocaml as being not ready for real programming
<Yurik> heh
<whee> they're just afraid to give up c++ :P
<Yurik> however, seeking developers for non-standard project is quite hard, especially for ocaml
<Yurik> so our project still has quite small team. I hope it will increase when we'll release first prototype
<whee> there just needs to be more programs written using ocaml and released on places like freshmeat and sourceforge
<whee> all it'll really take is some super elite program that everyone wants to use :P
<mrvn> And a proper compiler that actually optimizes and unboxes.
* Yurik had released ocamlbdb and ocamlgettext to freshmeat yesterday
<whee> I doubt that'll be a major factor in anyone's decision
<whee> heh
<mrvn> A speed factor of 10-100 is a decision factor.
<Yurik> i know
<whee> but ocaml is already plenty fast
<Yurik> that was just my 2 cents to contribution
<mrvn> Not on non i386
<mrvn> I doesn't unbox floats at all and allways untags/tags ints.
<whee> have you complained to people who can do something about it?
<mrvn> Which would be who?
<whee> the compiler writers? heh
<whee> http://caml.inria.fr/bin/caml-bugs check here, submit a bug report if it's not already in
<whee> that'll force someone to at least look at it
<mrvn> I think they know that let c = a+.b gets compiled into lda a,r0; lda b,r1; fadd r0,r0,r1; sta c,r0
<whee> maybe they don't think it's really a problem
<mrvn> It isn't, its just incredible slow.
<whee> I'd still file a report just to see what they say
<whee> it wouldnt hurt
<whee> maybe someone would actually do something with it :P
<mrvn> maybe. But how many developer have an alpha?
<Yurik> mrvn: you may donate alpha to caml team (kidding :)
<whee> if they have a native code compiler for it I'm sure someone has access to an alpha
<Yurik> sure
Yurik_ has joined #ocaml
<Yurik_> re
<Yurik_> got disconnected again
<whee> heh
* Yurik_ is tired
<Yurik_> (globally)
Yurik has quit [Read error: 54 (Connection reset by peer)]
Yurik_ has quit [Remote closed the connection]
ayrnieu` has quit [Read error: 110 (Connection timed out)]
<whee> mrvn: do the Int32 and Int64 modules address your unboxing problem at all?L
<whee> I think they do get some unboxing optimizations applied
<MegaWatS> nope
<MegaWatS> only floats do
<MegaWatS> afaik
<whee> hrmf http://caml.inria.fr/archives/200211/msg00171.html says otherwise, not sure though
<whee> there's the Nativeint module too
<MegaWatS> nativeint`s are boxed as well... but it may be that the newer version do some unboxing on int32`s / nativeint`s
<whee> yeah that's what I'm thinking
<whee> I think they're working on getting more performance with unboxing out of those
gl has quit [Read error: 110 (Connection timed out)]
gl has joined #ocaml
<whee> Take a break from studying for finals and join us in Erdle Commons for some
<whee> FREE popcorn on Friday, Nov. 15 from 1:30 to 3
<whee> ahahhaha
<whee> they have the lamest things here sometimes :|
<mrvn> Do they have "After Earthquake Parties" or "The day ends in y parties"?
<whee> I believe they do
<whee> :D
<whee> today for example was "Reading Day" (no idea)
<whee> so we had today off
<whee> except we have finals starting tomorrow so it's really not that big of a deal
<hdaume> dumb question: i want to have a 3d matrix of zeros. saying 'create_matrix n n (make n 0)' doesn't work because the 'make n 0' will be shared and i don't want it to be...how can i do this?
<mrvn> There is a make that uses a function int -> value
<mrvn> makei I think
<mrvn> makei n (fun _ -> makei n (fun _ -> make n 0))
<hdaume> you mean 'init : int -> (int -> 'a) -> 'a array'?
<hdaume> yup, that worked. thanks :)
<mrvn> yep. init
<mrvn> Too bad you can't write a funtion that takes a size and dimension and makes a hypercube matrx of size and dimension
<whee> mvrn: you can't?
<whee> it looks like standard recursion to me :|
<MegaWatS> yes, but you couldn`t type it
<MegaWatS> or rather, the ocaml couldn`t type it
<whee> oh
<MegaWatS> int -> 'a array? 'a array array? or what?
<whee> 'a array list :D
<whee> or wait nevermind
<whee> heh
<whee> actually now that I think about it I think it's still doable
<whee> probably could pull it off with some camlp4 preprocessing
<MegaWatS> how should it be doable?
<MegaWatS> you can`t even express the type such a function should have in caml`s type system
<MegaWatS> so, what do you suppose camlp4 could do about it? it can only change syntax
<whee> exactly
<whee> handle it like a template proble
<whee> camlp4 would go and create a function that does nothing but create 3d matrices, another that creates nothing but 4d, etc etc
<whee> it'd look like you have the ability to have a function that does nd matrices, but it's just camlp4 handling it
<MegaWatS> hmm ok
<MegaWatS> but that`s not exactly the same
<MegaWatS> a FUNCTION would be able to create arrays with a different number of dimensions at run-time
graydon_ has joined #ocaml
<whee> close enough :P
graydon has quit [Read error: 110 (Connection timed out)]
<mrvn> You can difine a N-Array that doesn't take a integer as index but an array itself.
<mrvn> fun at: 'a NArray -> int Arrays -> 'a
<mrvn> But you would loose the dimension in the type and would have to check it at runtime.
<mrvn> Why can arrays only be 4 million elements big?
<whee> that's the size of an unsigned int
<mrvn> No, unsigned int is 4 billion
<whee> oh, million
<whee> oops
<mrvn> Its 22 bit for the size of an array it seems.
<mrvn> And I need like 200,000 more elements.
<whee> odd, there's the bigarray library if you need unlimited size though
<whee> and it does handle the multidimensional stuff ha ha
<mrvn> It uses an "int array" to select what element you want to use/change.
<mrvn> And unless ist a specific dimension you loose the info about the number of dimentions from the type.
<mrvn> # Big arrays are multi-dimensional. Any number of dimensions between 1 and 16 is supported. In contrast, Caml arrays are mono-dimensional and require encoding multi-dimensional arrays as arrays of arrays.
<mrvn> I see support for 1, 2 and 3 and any dimension. Why 1-16?
<whee> why not :D
<mrvn> The generic Bigarray takes a int array as index. What does it care how many dimensions? As long as its <= 4194303 so it fits into an array.
<mrvn> You would have to explicitly check for dimensions <= 16 everywhere.
<whee> yep pretty much heh
<whee> there's a MAX_NUM_DIMS #define in the source for this
<mrvn> But why? Its easier to not limit it and doesn't improve anything.
<mrvn> So If I need a 17 dimensional array I have to copy Bigarray and remove all uses of MAX_NUM_DIMS?
<mrvn> (or change it to 17)
<whee> I'm guessing it was set that way because of memory problems
<mrvn> A 17 dimensional array would have to be pretty small in most dimensions :)
Dalroth has quit []
<mrvn> I used a 27 dimensional array for 3D Game of Life once. Each dimension had size 2 so that was just managable.
<whee> you're crazy :p
<mrvn> You have 3*3*3 cells, each can be alive or dead.
<mrvn> The array then contained alife or dead (1 Bit).
<whee> haha damn
<mrvn> Given that array I let a programm look for ways to compactify that array into a small function that takes the 27 cell states and says alife or dead.
<whee> a 16 dimensional array sure allocates a lot of memory
<mrvn> whee: 1 byte minimum.
<whee> *** malloc: vm_allocate(size=2289631232) failed with 3
<whee> :(
<whee> now you've got me interested in doing a 3d game of life :p
<whee> although I'm not exactly sure how I would display that heh
<mrvn> lablgl
<whee> using OS X, really can't :|
<whee> not sure if lablgl would work inside of Xdarwin
<mrvn> lablgtk with gl canvas?
<whee> hmmm apparentlyt there's software opengl support with hardware accel in cvs. may just work :D
<mrvn> O just write your own 3D support. Its just simple cubes you have to draw. Wireframe with flat shading.
<whee> I think I'll see how lablgtk and lablgl work later tonight, I can live with software acceleration until it's done
<mrvn> Try zoggy or its successor.
<mrvn> gotta cook. *wave*
<whee> or maybe going with sdl would be a better choice
<whee> nah
<whee> heh
malc has joined #ocaml
<whee> hmm oh well
<whee> sounds like a good time to learn opengl