sponge45 changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/
malc_ has quit ["leaving"]
johnnowak has joined #ocaml
zarvok has quit ["BitchX-1.1-final -- just do it."]
zarvok has joined #ocaml
<fremo> vorago: still alive ?
<fremo> sorry but I also have a lot of conflicts, it doesn't bother me so I can work on other things :)
<fremo> for strings: '"' ('\\' '"' | [^'"'])* '"'
Smerdyakov has quit ["Leaving"]
gim_ has quit []
david_koontz has quit ["This computer has gone to sleep"]
yangsx has joined #ocaml
johnnowak has quit []
postalchris has quit ["Leaving."]
yangsx has quit [Read error: 110 (Connection timed out)]
david_koontz has joined #ocaml
Riesz has quit ["Leaving.."]
johnnowak has joined #ocaml
bogdano has quit ["sono"]
descender has joined #ocaml
johnnowak has quit []
jacobian has quit [Read error: 110 (Connection timed out)]
zarvok has quit ["BitchX-1.1-final -- just do it."]
dark_light has joined #ocaml
david_koontz_ has joined #ocaml
david_koontz has quit [Connection timed out]
JeffSmac has joined #ocaml
JeffSmac has quit [Client Quit]
pants1 has quit [Remote closed the connection]
Submarine has quit ["Leaving"]
benny_ has joined #ocaml
benny has quit [Read error: 110 (Connection timed out)]
cap__ has quit ["Leaving"]
zhllg has quit [Connection timed out]
pstickne has quit ["Leaving"]
jacobian has joined #ocaml
david_koontz_ has quit [Client Quit]
pstickne has joined #ocaml
david_koontz has joined #ocaml
david_koontz has quit ["Leaving"]
Mr_Awesome has quit ["...and the Awesome level drops"]
zhllg has joined #ocaml
bluestorm_ has joined #ocaml
ikaros_ has joined #ocaml
jacobian has left #ocaml []
diffbavis has quit [Read error: 54 (Connection reset by peer)]
love-pingoo has joined #ocaml
diffbavis has joined #ocaml
swater has joined #ocaml
danly_ has joined #ocaml
danly has quit [Read error: 110 (Connection timed out)]
Smerdyakov has joined #ocaml
<love-pingoo> I'm curious to see what the functional-reactive GUI and the OCaml editor Ocaml Summer Projects give...
<Smerdyakov> I made the mistake of interviewing for a job at Jane Street just before their self-imposed deadline for selecting the projects to fund, so I think it may take them longer to get back to me on their decision. :-O :D
johnnowak has joined #ocaml
<love-pingoo> Smerdyakov: you're finishing your phd soon and don't plan to keep researching ?
<Smerdyakov> I'm considering taking a full-time job that isn't research, but nothing is decided yet.
<Smerdyakov> Definitely finishing PhD before or shortly after starting such a job, if I go that route
<love-pingoo> I'm not a research extremist, but I wouldn't want to work at Jane St
<love-pingoo> I quite dislike finance
<Smerdyakov> I don't know much about finance, but I DO know I like OCaml. ;-)
<love-pingoo> lots of people go finance because they are strong in maths, or in prog... to me that's sad
<Smerdyakov> And they have some really shart people there.
<Smerdyakov> er, sharp
<love-pingoo> cause they don't serve anything good that way
<Smerdyakov> How is that? They certainly serve their own material interests.
<flux-> love-pingoo, is there a web for the functional-reactive gui?
<love-pingoo> flux-: nope, only threads on the caml list and lambda-the-ultimate
<love-pingoo> Smerdyakov: I understand that there isn't much choice, and that's the sad thing
<flux-> love-pingoo, any pointers? those are on the web ;-)
<love-pingoo> flux-: a few secs...
<Smerdyakov> love-pingoo, much choice for satisfying what criterion?
<love-pingoo> Smerdyakov: a well-paying job which makes use of one's skills in maths/prog
<Smerdyakov> love-pingoo, the thing about finance is that you don't expect to need to work until 65 to meet your material needs... you can bow out much earlier and then focus on things with higher social value.
<love-pingoo> I hope that's it's true
<love-pingoo> but that's still a very weird business to me
<Smerdyakov> Less weird than lambda calculus research ;-)
<Smerdyakov> love-pingoo, you are in France?
<love-pingoo> yes
<Smerdyakov> I expect laws there make it harder to succeed with a hedge fund kind of business model.
<Smerdyakov> (Compared to USA)
<love-pingoo> Dunno.
<love-pingoo> We do have a lot of people going finance too.
<love-pingoo> JPMorgan is aggressively hiring where I work.
<Smerdyakov> But I wonder how income of the people working in finance compares with the USA.
<Smerdyakov> If finance companies need to hire like the French national labs do, then I expect it would be very sluggish, waiting for a clueless committee to make bad decisions each time. :-D
<love-pingoo> :)
<love-pingoo> they don't hire us working at the lab but the engineering student from Ecole Polytechnique
<Smerdyakov> I'm talking about how J.P. Morgan would hire, not about from where they would hire.
<Smerdyakov> I know that France has many labor laws that seem ridiculous from a USA/free enterprise perspective.
<love-pingoo> sorry
<love-pingoo> I don't think it's so bad
<Smerdyakov> If finance companies face similar legislative restrictions on hiring processes to what the national labs do, that would be a serious crutch, IMO.
<love-pingoo> actually they may be asking students to move the UK/US to get the job, I don't remember
<Smerdyakov> Yes, that would make much more sense!
<Smerdyakov> I met a French PhD who had researched type theory, at my Jane Street interview.
<love-pingoo> the the hiring process for public research institutes is not enforced by general labor laws
<love-pingoo> it's just the public institutes that are a bit bureaucratic
<Smerdyakov> Are there laws about how many hours per unit time you can work in private industry?
<love-pingoo> yes, but there are also (much used) ways to bypass them
<Smerdyakov> Such as?
<love-pingoo> well, I'm not sure, it may be that you get paid more for the extra hours
<vorago> fremo, thanks. ;-)
<love-pingoo> but then the employer might lower the base salary
<mattam> Smerdyakov: who was that ?
<Smerdyakov> mattam, Pascal was his first name.
<vorago> fremo, I've resolved problems with error-handling. I've placed string ref in separate file, before rasing Parsing.Parse_error i set it, and then error is printed entirely in Main.ml (not like it was before - in parser) then i removed ERROR from some places in grammar and I've got no conflicts. ;-)
<Smerdyakov> (Maybe spelled differently!)
<vorago> fremo, also.. i think i understand why there were r/r conflicts. ;) I placed ERROR in lower rules, and on "higher rules". Like building statement, and building whole function definition... i guess this caused conflicts.
<vorago> fremo, strings works, global wars works, variable dereferencing works. ;-) But it's still a toy.
Smerdyakov has quit ["out on the town"]
<flux-> love-pingoo, the discussion on ocaml mailing list was cut short..
johnnowak has quit []
<love-pingoo> flux-: yeah, that's why I'm glad to see a summer project
<love-pingoo> it'd be fun to see how far one can go with such a toolkit
<love-pingoo> vorago: you mean global _vars_ I believe
<flux-> love-pingoo, oh, I originally thought you meant it was a ocaml summer project too
<love-pingoo> :)
<love-pingoo> flux-: it is one
<flux-> love-pingoo, there's a list other than this: http://osp2007.janestcapital.com/suggested-projects/ ?
<flux-> (has it already started and the list is no longer being maintained? I haven't really followed..)
<flux-> ah
<flux-> it's in the main page - google failed on me ;-)
<flux-> but yes, that'll be interesting to see
<flux-> the ocaml editor project doesn't interest me that much, but the potential side effects of it (easier way to access ocaml program structure) do - refactoring tools would emacs would interest me a bit :)
<flux-> (I'm thinking maybe some of the -d -switches already provides the required data, but I haven't really looked)
<flux-> hm, the 'erlang style concurrent and distributed programming' interests me too
<flux-> caml-shcaml might be of the most immediate practical use
<love-pingoo> do you understand what is that one ?
<love-pingoo> is it caml for embedded devices ?
<love-pingoo> I'm a bit sceptic on all the distributed/parallel computing projects... I'm afraid good work in that area takes more than a student summer
<flux-> oh, I thought it was about the 'shell like tools' for ocaml
<flux-> for writing 'ocaml scripts'
<flux-> but maybe it's not
<flux-> the 'sh' suggested that to me :)
<love-pingoo> possible
<love-pingoo> but there's already something like that
<love-pingoo> ocamlscript.. don't know what it's worth
<pango> tought you'd say cash (http://pauillac.inria.fr/cash/)
<flux-> hm "It has two main components: a process notation for running programs and setting up pipelines and redirections (not yet implemented in Cash)"
<flux-> but I think I've seen something similar
<flux-> the latest release is from Aug 2002
<vorago> love-pingoo, heh, yes sure.
<vorago> Is it possible to generate statically linked executables (elfs) with ocamlopt?
<flux-> probably not, but you could try statifier (.sf.net)
<pango> using a mix of -linkall and -ccopt -static ?
<pango> ocaml modules are always statically linked, so you just have to also force the static linking of foreign libs
<flux-> that's a ogod point
<flux-> it might even work :)
<vorago> Hm. ;-)
<vorago> There's only a warning.
<vorago> That there's dlopen used somewhere.
bebui has quit [Read error: 113 (No route to host)]
<pango> the wonders of glibc, maybe
<vorago> 903kb. Big one.
<vorago> Thanks pango, flux-.
bebui has joined #ocaml
pango has quit [Remote closed the connection]
pango has joined #ocaml
zarvok has joined #ocaml
Submarine has joined #ocaml
Z4rd0Z has joined #ocaml
rossberg_ has joined #ocaml
JeffSmac has joined #ocaml
JeffSmac has quit [Client Quit]
ikaros_ has quit ["Leaving"]
<flux-> hm, somehow I had imagine polymorphic variants could do this: match foo with `A | `B -> () | other -> do_something (); match other with `C | `D -> (), but apparently not
<flux-> s/imagine/imagined/
<flux-> however, I can do type a = [ `A | `B ] and b = [ `C | `D ] let f (o : [ a | b ]) = match o with `A | `B -> () | #b as other -> match other with `C | `D -> ()
<flux-> which isn't quite as nice..
<flux-> hmph, but I can't fit it into my current problem
<flux-> which would be declaring type a = [ `Compose of (c list) ] and b = [ `Constant of int ] and c = [ a | b ]
<flux-> "The type constructor a is not yet completely defined" at the definition of c
_JusSx_ has joined #ocaml
JeffSmac has joined #ocaml
diffbavis has quit [Read error: 54 (Connection reset by peer)]
JeffSmac has quit []
diffbavis has joined #ocaml
slipstream-- has joined #ocaml
slipstream has quit [Read error: 110 (Connection timed out)]
pango has quit [Remote closed the connection]
pango has joined #ocaml
swater has quit [Read error: 110 (Connection timed out)]
swater has joined #ocaml
<dark_light> flux-, you need the () to nest matches
<dark_light> i think this works: match foo with `A | `B -> () | other -> do_something (); (match other with `C | `D -> ())
<flux-> that is what I was doing?
<flux-> oh, you mean (), I don't think
<flux-> that matters in this case
<flux-> because this is not a precedency problem
<flux-> the error is This pattern matches values of type [< `C | `D ] but is here used to match values of type [> `A | `B ] The first variant type does not allow tag(s) `A, `B
<dark_light> ah...
swater_ has joined #ocaml
<dark_light> flux-, the same type of analysys seems not be done in type x = A | B | C | D;; let f x = match x with A | B -> () | other -> do_something (); (match other with C | D -> ());;
<dark_light> it says the second match isn't exaustive
<dark_light> actually it isn't, but the whole thing is..
<flux-> it is exhaustive with the type definitions..
<flux-> hm, I mean with polymorphic variants, not the regular kind
<dark_light> the match other actually is matching a "A | B | C | D type, without A and B values", but this idea doesn't exists in ocaml
<flux-> but, this does work: type a = [ `A | `B ] and b = [ `C | `D ] let f (o : [ a | b ]) = match o with `A | `B -> () | #b as other -> match other with `C | `D -> ()
<flux-> and I think the types could be induced
<dark_light> flux-, yes, but, if that worked with polymorphic variants, it would work with normal variants too, the analysys done to permit it seems to be the same
<dark_light> hmmm
<flux-> it's just that you cannot declare normal variants out of the blue, whereas you can do polymorphic variants
<flux-> I think that works without the [ a | b ] -part too, btw
<dark_light> yes
<flux-> all it would need to do is to think match a with A | B | ... | o -> .. that o is a type a without the A | B ..
<flux-> which is what I'm manually telling in that case
<dark_light> that is a good situation to declare a polymorphic variant
<dark_light> and still get its benefits
<flux-> but still I couldn't use the technique, as my types depend on each other
<dark_light> well, some of them
<dark_light> hmm
<flux-> and this fails: type a = [ `A of c ] and b = [ `B of c ] and c = [ a | b ]
<flux-> with -rectypes too
<flux-> or intermediate constructor types
<flux-> s/or/and/
benny_ has quit [Read error: 113 (No route to host)]
<dark_light> but why you need a pmorphic variant? if you has to declare the type, normal variants should be ok..
<dark_light> if you have
<flux-> well, this is purely academic. I don't like this: match a with A | B -> .. | other -> code_here (); match other with A | B -> failwith "imposible!" | C | D -> ...
<flux-> that I need to define the cases in both places
<flux-> but it's easily manageable :)
<flux-> although I actually do use polymorphic variants at the moment for some convenience reasons, which might not even be there.. I get more difficutl errors.
<flux-> (convenience reasons: no need to prefix constructors with module name)
<dark_light> let myfun x = let other() = do_things(); more_things() in match x with A|B -> other() | C|D -> code_here(); other()
<flux-> well actually all the cases I have do a different thing
benny has joined #ocaml
<dark_light> but there are something common to some cases? i think it does not hurt too much reproduce the same code in the places it occurs..
<dark_light> specially when wrapped by a local function
<flux-> match a with A a -> do_a a | B b -> do_b b | other -> if not (exists (other)) then let v = match other with C c -> do_c c | D d -> do_d d | A | B -> failwith "argh" in add other v; v else find other
<flux-> it's a function that constructs bitmaps and caches the results, except that certain bitmaps won't be cached (the A | B -cases)
<flux-> and the construction variants can refer to other bitmaps, which references are resolved by recursively calling the function
<flux-> and there are no functions in the variants, because I want to be able to reasonably use a hash table
<bluestorm_> hum
swater has quit [Read error: 110 (Connection timed out)]
<bluestorm_> why not "type bitmap = Uncached of ab | Cachable of cdef..." ?
<flux-> well, that'd be a reasonable approach, if I didn't construct the bitmaps with their constructors in other modules :). actually I might at some point change it to provide only a function interface, which would allow such a change to be easily implemented
<bluestorm_> :p
<flux-> (it would have some other advantages too)
<flux-> extensibility-wise
<dark_light> what's the problem with closures and hash tables?
<flux-> you can't compare a closure to another one, can you?
<flux-> and I would imagine a hash table would need to perform such comparison at some point
<dark_light> hmmm, i don't know, but...
<dark_light> ah
<dark_light> hmm
<flux-> but I'm off to sleep, nice to chat with you people
<dark_light> yeah. []s
* dark_light is actually playing with python
malc_ has joined #ocaml
Mr_Awesome has joined #ocaml
bluestorm_ has quit ["Konversation terminated!"]
SooW has joined #ocaml
<SooW> Hi
<SooW> I'm using an Array2 containing records.
<SooW> Each time, I do "matrix.(i).(j) <- x", every single part of matrix is referencing x
<love-pingoo> how did you create matrix ?
<SooW> I can't give you an exemple, but I hoped someone could give me an advice
<love-pingoo> could be that you used Array.create (Array.create _ _) _ instead of Array.make_matrix
<SooW> matrix is a mutable of an object
<love-pingoo> that's a typical mistake leading to this kind of probleù
<pango> make_matrix won't solve the problem
<SooW> I declared it as "val mutable matrix = Array2.make_matrix width height { my_field = -1 }
<pango> 'All
<pango> the elements of this new matrix are initially physically equal to e .'
<love-pingoo> I see. I don't know Array2 btw.
<SooW> physically means "e is somewhere in the memory and elements of the matrix points to it" ?
<pango> yes
<SooW> therefore, that's the problem :)
<SooW> how can I solve it ?
<pango> I don't know Array2 either... For arrays, the solution is to use Array.init
<SooW> I tried to do a loop in the initializer of the object, but it seems that didn't solve the problem
<SooW> ok
<SooW> I can do something like matrix.(y * width + x)
<love-pingoo> there's certainly a better answer
<pango> no need to, you can call Array.init inside Array.init function parameter, and keep your 2 dims matrix
love-pingoo has quit ["Connection reset by pear"]
<SooW> right
<SooW> it might work
<pango> # type r = { mutable x : int };;
<pango> # let m = Array.init 3 (fun _ -> Array.init 3 (fun _ -> { x = 0 })) ;;
<pango> # m.(2).(1).x <- 7;;
<pango> # m;;
<pango> - : r array array =
<pango> [|[|{x = 0}; {x = 0}; {x = 0}|]; [|{x = 0}; {x = 0}; {x = 0}|];
<pango> [|{x = 0}; {x = 7}; {x = 0}|]|]
<SooW> yay :p
<pango> as soon as you work with mutable values, you must be careful with sharing
<SooW> I guess I'm thinking as a C programmer
<SooW> another question : I'm using "method x : unit" but everywhere I go I see I should use "unit -> unit". Is there a real difference ?
_JusSx_ has quit [Connection timed out]
<SooW> as a method, it should be evaluated everytime, no ?
<pango> after almost 5 years, I still haven't used ocaml's OO...
<SooW> OK. Using "let", "unit -> unit" will be re-evaluated while "unit" won't ?
<SooW> Whoohoo ! Array.init woked ! Thnaks a lot.
<pango> I don't really see the point of requiring methods to get a unit parameter... as you said, they should always be evaluated
<malc_> the point might be passing them around
<SooW> That's only because I want to know how OCaml works. I know that any function should take at least an argument and a return value. Actually, "self#method" is much more sexy than "self#method ()", but who cares...
<tsuyoshi> it's annoying to have to wrap a method into a function in order to pass it
<tsuyoshi> or these are not methods but getters or something?
<pango> SooW: that's probably why methods have that inconsistency, "because it's sexy"
ikaros has joined #ocaml
<pango> C++ manuals have hundreds of pages of such sexyness ;)
david_koontz has joined #ocaml
swater_ has quit ["Quat"]
rossberg_ has quit ["Music sounds better offline"]
pstickne has quit [Connection timed out]
<SooW> Good{bye, night} everybody. Thanks again. You solved a 3-day brainfucking problem :)
SooW has quit ["Quitte"]
pstickne has joined #ocaml