flux changed the topic of #ocaml to: Yes, inria.fr is back up! | Discussions about the OCaml programming language | http://caml.inria.fr/ | 3.11.0beta1 available from http://caml.inria.fr/pub/distrib/ocaml-3.11/ | Or grab OCaml 3.10.2 from http://caml.inria.fr/ocaml/release.html
<Asmadeus> "B$l$s$i$/$$$?$@Bi BO"MmD:B"
<Asmadeus> sorry
GustNG has joined #ocaml
christo_m has joined #ocaml
<christo_m> flux: heres what i have thus far: http://pastebin.com/m32674d99
<christo_m> getting some error about "unbound length" or something
<christo_m> my function must be wrong
Axioplase has joined #ocaml
code17 has quit ["Leaving."]
<christo_m> top level semi colon bullshit
<vixey> don't type the ;;'s
<vixey> I think you don't need any of thema
<doy> also, the bodies of if/then statements are only one statement long
<doy> if you need more, they need to be grouped
<doy> either with parentheses or begin/end
Linktim has quit [Read error: 104 (Connection reset by peer)]
Linktim has joined #ocaml
Axioplase has quit ["Lost terminal"]
Axioplase has joined #ocaml
GustNG1 has joined #ocaml
christo_m has quit [Read error: 104 (Connection reset by peer)]
ulfdoz has quit ["deprecated"]
hsuh has joined #ocaml
GustNG has quit [Connection timed out]
hkBst has quit [Read error: 104 (Connection reset by peer)]
Axioplase has quit ["leaving"]
GustNG1 has quit [Read error: 110 (Connection timed out)]
christo_m has joined #ocaml
<christo_m> okay so
Linktim has quit ["Quitte"]
<christo_m> im trying to debug this
pango has quit [Remote closed the connection]
pango has joined #ocaml
<christo_m> Somebody, anybody
<christo_m> its always around line 25 with that else statmement
<christo_m> flux: ? :(
<christo_m> i just wanna get this bloody thing done
<vixey> what is the problem
<christo_m> vixey: im trying to eliminate the gratuitious use of semi colons in my code
<vixey> delete htem
<christo_m> i did..
<vixey> problem solved.
<christo_m> i know the semi colon is used a separater in ocmal correct?
<christo_m> its not solved
<christo_m> theres issues
<christo_m> vixey: http://pastebin.com/m46d2a0fd here they are deleted
<christo_m> i get a problem at 24.
<christo_m> line 24
<vixey> can't view pastes
<christo_m> sorry 23
<christo_m> well tihs is going to prove to be difficult
<christo_m> in an if statement, i shoudl seperate the instructions with ;
<christo_m> correct?
<christo_m> fuck it, ill do it live
<christo_m> thelema: ?
<vixey> have tried looking at some ocaml written by someone experienced?
<vixey> you can often learn from doing this
<christo_m> ocaml is very poorly documented
<christo_m> i think so at least
<vixey> I am talking about source code
<christo_m> i googled a lot of stuff and its always the same thing, basic tutorial
<vixey> not documentation
<christo_m> no
<vixey> don't google anything, download a real library or program written by someone experienced
tomh has quit ["http://www.mibbit.com ajax IRC Client"]
<christo_m> k that isnt helping
<christo_m> i need someone to tell mewhats wrong with MY code
<vixey> you can't figure this out on your own?
<christo_m> vixey: no
<vixey> well I can look at it tommorow if I am on
<christo_m> its due 10:30 am
<christo_m> tmw
<vixey> not that it means I will know how to fix it
<christo_m> its probably something real simple
<christo_m> can i just pm u with the source
<vixey> ok
<christo_m> vixey: ? pm
<vixey> well did you try deleting the comment
<christo_m> why would that matter
<vixey> ok don't try it
<vixey> don't bother, it's way too much effort
<christo_m> vixey: i just did, same problem
<christo_m> i was just wondering why it would matter, its omitted by the interpreter anyway
<christo_m> vixey: any ideas?
christo_m has quit ["leaving"]
christo_m has joined #ocaml
<christo_m> vixey: my bad, internets real bad here
<christo_m> vixey: did you have any other ideas
<vixey> yeah put lots of brackets around things
<christo_m> lmao
<christo_m> vixey: hows that any better than just having a bunch of semicolons everywhere
<vixey> it might tell you why
<christo_m> ..
<christo_m> okay if ur trying to teach me a lesson, please
<christo_m> ill just revert to all semi colons and hand that in instead..
<christo_m> because it was working before
<vixey> I'm just telling you what I would try
<Camarade_Tux> I only quickly took a look at your paste (and at the irc backlog) but I think you're missing semicolons between line 19 and 25
<christo_m> Camarade_Tux: that's apparent, im just not sure where
<christo_m> i was messing around with it, still wont work
<Camarade_Tux> vixey, if you can't see his paste, he is using if/then/else, with unit-returning statements :)
<christo_m> hmm..
<Camarade_Tux> also,
<Camarade_Tux> #
<Camarade_Tux> raise Queue_full
<Camarade_Tux> #
<Camarade_Tux> myq.back <- 0
<christo_m> i didnt use max_length even tho i defined it, i was using magic numbers again LOL, just noticed that now
<Camarade_Tux> first, you can't put it that way, then you're doing something after raising an exception...
<christo_m> Camarade_Tux: (sigh), i dont see where to put them..
<Camarade_Tux> christo_m, what is sure is you have a problem with lines 21 and 22 : once you've raised your exception, nothing that is written below your raise gets executed
<Camarade_Tux> also, I've put up a paste that is *syntactically* correct : http://pastebin.com/m47949019
<Camarade_Tux> when you're not sure about when to put semicolons, keep the let _ = ... in construct, it will usually be easier to spot errors and you are sure you're not messing with scopes (which is classical error when an if/then/else construct starts with an unit-returning statement)
<doy> christo_m: double semicolons are basically never necessary, single semicolons are, occasionally
<Camarade_Tux> off to bed now !
Camarade_Tux has quit ["Leaving"]
<christo_m> doy: ok its almost there
seafood has joined #ocaml
christo_m has quit ["it works!"]
jeddhaberstro has quit []
mfp has quit [Read error: 110 (Connection timed out)]
mfp has joined #ocaml
smimou_ has joined #ocaml
fatalerrorx has quit [Excess Flood]
fatalerrorx has joined #ocaml
threeve has joined #ocaml
christo_m has joined #ocaml
<christo_m> doy: yoo
<christo_m> i wan tto write test code lol
smimram has quit [Read error: 110 (Connection timed out)]
Jarvas has joined #ocaml
struktured_ has joined #ocaml
Axle has joined #ocaml
bering has joined #ocaml
struktured has quit [Read error: 110 (Connection timed out)]
jknick has joined #ocaml
vixey has quit ["Leaving"]
bering has quit ["Leaving"]
<christo_m> hello
<christo_m> anyone in here
<Axle> yes
<Axle> christo_m: yes
<christo_m> Axle: perfect
<christo_m> Axle: look i want to write some test code to test my queue function
<Axle> christo_m: I may or may not be able to help
<christo_m> Axle: im sure you can
struktured__ has joined #ocaml
<christo_m> Axle: http://pastebin.com/m557bb030 theres the code
<christo_m> i want to use that as a module for my test file
<Axle> christo_m: I'm fairly new to OCaml, but I'm willing to give it a shot
<christo_m> which is basically going to exercise the functions listed there
<Jarvas> Title: OCaml pastebin - collaborative debugging tool
<christo_m> so i want to instantiate a queue, and push it full of some dummy elements, then print out the result
<christo_m> im not sure how to iterate through a record type like that though
<christo_m> Jarvas: do you have any idea how to go about it?
<Jarvas> Hello, my response is limited. My brain has not been connected yet
<christo_m> my friend, who isn't online, did it with a stacks implementation, except the element field only had a string, not a string and an int
<Jarvas> Title: OCaml pastebin - collaborative debugging tool
<christo_m> Damn bot
<Axle> are you sure the queue works properly?
<christo_m> Axle: of course, test it yourself.
<Axle> what's wrong with the print code?
<Axle> looks pretty good to me
struktured_ has quit [Read error: 110 (Connection timed out)]
<Axle> well, so I tried your code
<Axle> it doesn't compile
<palomer> anyone here wanna test a memory leak?
<palomer> http://ocaml.pastebin.com/m53b8e76e <--could anyone run this and tell me what top says
<palomer> would be appreciated
<Jarvas> Title: ocaml private pastebin - collaborative debugging tool
<Axle> christo_m: first off, your queue record doesn't have a height value
<doy> palomer: it leaks here
<doy> from ~6mb to ~25mb in a minute
<doy> and still growing, although slowly
<palomer> hrmph
<doy> ~43mb in 3 minutes
<doy> should it not be leaking?
<palomer> of course not
<palomer> look at the code!
<doy> well, sure
<palomer> it's really simple
<doy> (:
<doy> i meant was it not expected
<palomer> all it does is add and remove 2000 text entries every 100ms
<palomer> well...
<palomer> I can reproduce the problem in vanilla gtk
<palomer> brb
palomer has quit ["Leaving"]
Palace_Chan has joined #ocaml
<Palace_Chan> im trying to write a function which returns unit and appends its argument to an accumulator list declared before the helper function as in: let a = [] in let helper t : unit = t :: a; ()
<Palace_Chan> but it wont let me semicolen the cons op...and if i dont semicolen it...it takes it as the return value
<Palace_Chan> is there a way to do this ?
<doy> well, the type of the function isn't unit
<doy> it's something -> unit
<doy> try removing the type annotation
<tsuyoshi> let helper = let a = ref [] in (fun t -> a := t; ())
<tsuyoshi> er
<doy> oh, and you should be using references, yeah
<tsuyoshi> let helper = let a = ref [] in (fun t -> a := t :: !a; ())
palomer has joined #ocaml
<palomer> willing to run/compile a C program?
<doy> sure
<Palace_Chan> tsuyoshi, and the next time i call that functioon itll still have that first t in it ? even though your saying a = ref [] every time ?
<doy> Palace_Chan: you aren't saying a = ref [] every time
<doy> you're saying that when you get to that statement, and then storing the resulting function in helper
<palomer> http://pastebin.com/m20da8dc1 <--anyone who wants to help out, please compile this
<Jarvas> Title: C pastebin - collaborative debugging tool
<palomer> gcc -Wall -g test.c -o test2 `pkg-config --cflags gtk+-2.0` `pkg-config --libs gtk+-2.0`
<ushdf> this language looks easy
<tsuyoshi> well.. if you add some formatting to make it easier to understand it's like:
<tsuyoshi> let helper =
<Palace_Chan> the helper function first let a = ref [] in (a is a local reference to an empty list), it then has fun t -> a := t :: !a; ()...what does calling helper do
<tsuyoshi> let a = ref [] in
<doy> palomer: no memleak in that one
<tsuyoshi> (fun t ->
<doy> oh wait
<doy> it plateaus
<tsuyoshi> a := t :: !a;
<tsuyoshi> ()
<tsuyoshi> )
<doy> yeah, definitely a memleak
<doy> it seems to be holding steady at ~15mb at the moment
<Palace_Chan> tsuyoshi, hmm but helper doesnt take an argument....essentially im trying to grab all the keys from a hashtbl and put them in a list...so i was thinking of calling iter with a function that just appends to a list every time its first argument
<doy> oh, now it's going up again
<doy> Palace_Chan: helper is being assigned the anonymous function
<doy> which does take an argument
<palomer> doy, yeah, it does that
<palomer> ok
<Palace_Chan> oh i see, helper = function from t to doing that
<tsuyoshi> oh if you want to call iter then there is a much better way
<Palace_Chan> tsuyoshi, is there ? i didnt find something in the Hashtbl library which seemed more immediate
<tsuyoshi> let hashtolist h = Hashtbl.fold (fun k d x -> k :: x) h []
<Palace_Chan> tsuyoshi, ohhhh the infamous folding, very nice (one of the things that is hard to get used to, im new to ocaml)
<palomer> yay for folding!
<Palace_Chan> i hope one day functional programming just clicks better - and these nice little constructs come to mind more often than battling the typechecker to death
* palomer is doing research on this
<palomer> if I could get this (*&(* memory leak fixed, id be one step closer to this goal
hudini has joined #ocaml
<hudini> how do i use if then else with multiple lines
<palomer> if foo then begin some;lines;baby end else begin some ; other; lines end
struktured__ has quit [Read error: 60 (Operation timed out)]
<tsuyoshi> I prefer to use parentheses.. if foo then (some; lines; baby) else (some; other; lines)
<hudini> ok
<palomer> I find that parens are prettier for one liners while begin ... end is prettier if you span many lines
<hudini> begin end
<hudini> it sasys syntax error
<palomer> paste it in a pastebin
<hudini> if x > 10 then
<hudini> is something wrong here ?
<hudini> should it be if (x > 10) ?
<palomer> nono
<hudini> ok
<hudini> im gona pastebin
<hudini> nevermind
<hudini> i found out whats wrong
<hudini> nothing to do with my ifelse
* palomer is off
bla has quit [Read error: 110 (Connection timed out)]
<christo_m> hudini: you go to mac?
<christo_m> Axle: it doenst need a height value, it uses front and back, and max_length btw
<Axle> christ_m: yes, but your print code says that the queue does have a height value, which is wrong, and which is why the compiler chokes on the print function
<Axle> christo_m:
threeve has quit []
bla has joined #ocaml
<christo_m> Axle: (sigh)..thats example code for a stack
<christo_m> im saying i have to implement somethign similar
<christo_m> except the element record has the data field and the id field
<christo_m> so a string and an int, as oppposed to just a string for the stack
<christo_m> 23:19 < christo_m> my friend, who isn't online, did it with a stacks implementation, except the element field only had a string, not a string and an int
<Jarvas> Title: OCaml pastebin - collaborative debugging tool
<hudini> whats wrong with that
<Axle> I would probably do something like
<fatalerrorx> Jarvas: QUIT
Jarvas has quit [Client Quit]
<hudini> http://pastebin.com/m6757c07d version 2 :P
<Axle> christo_m: I would probably do something like this: http://pastebin.com/d1aa9c15e
<hudini> that works
<hudini> thx tsuy
<Axle> christo_m: the code I posted there works, as long as you put Printf.printf instead of just printf
struktured__ has joined #ocaml
<hudini> ok
<hudini> another question
<hudini> how do i do a let inside another let
<hudini> for example
struktured__ is now known as struktured
<hudini> let func1 p1 = let p1 = 4;;
<hudini> so if i type func1 ab it will do let ab = 4;;
<hudini> it says syntax error
<doy> what are you trying to do
<hudini> set a value to an array of my choice
<hudini> or a record
<doy> well, which
<hudini> for example let func1 p1 = let p1 = { arg1 = "abc" ; arg2 = "def" };;
<hudini> the above
<doy> you either need to use references, like 'let func1 p1 = let p1 := { whatever }', or make the record fields mutable, and do something like 'let func1 p1 = p1.arg1 <- "abc"; p1.arg2 <- "def"'
<hudini> hmm
<hudini> so
<hudini> let func1 p1 = p1.arg1 <- "abc" ; p2.arg2 <- "def" ;; the p2 record is initialized automatically ?
<thelema> hudini: let bindings are local and immutable -- making a new binding just overrides the old one for the duration of its scope (usually to the end of the containing function)
<thelema> they do not work the same as variable declarations.
<doy> where did p2 come from
<thelema> hudini: no, you need a valid record to pass in as p1.
<hudini> what if i dont want to make the record mutable
<thelema> then the best you can do is create a new record using the old one as a template.
<hudini> ok
<hudini> back to my example let func1 p1 = let p1 = { arg1 = "abc" ; arg2 = "def" };;
<hudini> lol
<hudini> how would i fix that syntax
<thelema> what do you want func1 to do?
<hudini> create a record named p1
<thelema> return a record {arg1="abc"; arg2="def"}?
<hudini> return nothing;
<palomer> thelema, interested in running another test case?
<thelema> Palace_Chan: for lablgtk? It's late and I should go to bed.
<hudini> noo
<thelema> grr, I should fix autocomplete so it favors the person who spoke last.
<Palace_Chan> thelema, you can do that ?
<palomer> for vanilla gtk
<palomer> catch you tomorrow, then:P
<thelema> hudini: it can create a record, but it can't affect the environment in the calling function.
<thelema> such a capability would be... dangerous.
<hudini> i dont understand the second part
<thelema> palomer: yes, tomorrow.
<thelema> Palace_Chan: no, I can't, but I'd like to.
<thelema> Palace_Chan: maybe if I write an IRC client. how hard could it be? :)
<thelema> hudini: the "dangerous" part, or "affect the environment" part?
<doy> hudini: you can either use references/mutable things to modify what you're passing in, or you can return a completely new record
<hudini> affect the environemnt
<hudini> i just want funct1 to create a new record named p1 i dont want it to return anything
<palomer> let's make an irc client in ocaml
<palomer> ready, set, go!
<thelema> when a line of code is running, it runs in an environment that has all the bound values and the values they're set to. You want a function to modify the environment of the caller.
<doy> hudini: what do you mean by 'create a new record'
<doy> where should it go?
<doy> it has to go somewhere
<doy> otherwise what's the point
<hudini> it will be used
<hudini> eventually
<hudini> but for now its in p1
<hudini> or its called p1
<thelema> doy: I think the problem is that of namespaces / scope - different ones for each function.
<thelema> hudini: there's not just one set of variable names for the entire program.
<thelema> for example if I do:
<thelema> let f x = x + 1 and let g x = 2 * x
<thelema> those two functions refer to two different x values.
<hudini> yea
<thelema> if they were longer, I might use let to make a 'y' binding in both - these would be distinct.
<hudini> so if i type func1 record it will create a new record called record
<thelema> because they are in different scopes.
<Palace_Chan> can i do something like: try let a = Hashtbl.find x in with Not_found -> etc..
<Palace_Chan> it syntax errs me
<hudini> i understand you but i dont think you understand me
<thelema> ocaml doesn't allow that level of programming - camlp4 does, but that works on the syntax level.
<doy> hudini: so you have a variable p1, and you want to call func1 p1
<doy> and then have p1 be a record?
<thelema> Palace_Chan: the [let a] binding only exists inside the try block.
<hudini> doy: correct
<doy> hudini: why not just do let p1 = func1 ()
<doy> and have func1 return whatever you would be sticking in p1
<Palace_Chan> guess i just have to make the try bigger and do the work within it then
<thelema> Palace_Chan: you could do [let a = try Hashtbl.find x with Not_found -> value_for_a in
<hudini> doy: what if i want the record to be named something other than p1
<Palace_Chan> thelema, ah, yes that's better thanks
<thelema> good night.
<hudini> good night.
<doy> hudini: let p2 = p1 in
<doy> ?
<doy> i don't understand the issue
<hudini> lol
<hudini> ok
<hudini> i have a function
<hudini> and a parameter
<hudini> i want the function to create a record with the name = paramater
<doy> you can't do that with normal binding
<doy> it doesn't work like that
<hudini> oh
<hudini> how would i do it
<doy> you would use references
<doy> have p1 be a reference to a record
<doy> and then let func1 p1 = p1 := { whatever }
<hudini> im lost
<doy> there's really no reason to do it this way
* palomer just fixed a HUGE bug in his code
<doy> it's going to just be more complicated
<doy> you really do want your function to just return the record, and then assign that to something
<hudini> ok
<hudini> now how would i assign the record
<hudini> oh wait
<hudini> nvm
<hudini> i think i know what u mean
<christo_m> Axle: didnt work for me bro
<hudini> so
Palace_Chan has quit [Client Quit]
<hudini> let p1 = ref record;;
<christo_m> Axle: i get an error, on line 7
<hudini> is that how i would do it ?
<Axle> christo_m: paste bin what you've got
<christo_m> well, i should be more precise
<christo_m> i removed my offending lines
<christo_m> and strictly compiled yours, explicitly calling printf like you said
<christo_m> i get an executable, no compile problems, i run it, nothing happens
<christo_m> its not printing out stuf from the queue, i might be missing osmehting tho
<christo_m> ill find it
<Axle> hmm
<Axle> I don't know what to tell you, it worked when I ran the code in the interpreter
<doy> hudini: if you do it the way i said (just return a record), you won't have to touch references at all
<christo_m> you mean it gave you a list and everyhting?
<christo_m> mines showing nothing
<christo_m> here
<christo_m> i guess im doing somehting wrong
<Axle> well, since you open the Modules at the top of the file, you're being redundant when you then use them throughout the program
<Axle> also, are you sure your test code is working properly?
<Axle> what I did was put the print code into the queue file, did #use "queue.ml" in the interpreter
<Axle> and then typed let q = bottom();;
<Axle> print q;;
<christo_m> i did ocamlc queue.ml test.ml
<christo_m> u kno wha ti mean, test code and app code
<Axle> hmm
<christo_m> i think it needs to compile
<christo_m> not sure
<Axle> then compiled it into a binary?
<Axle> to be honest, sounds like the problem is in your test code, that or you're not compiling the program properly
<christo_m> Axle: correct
<christo_m> Axle: not sure about the mistake part yet, still looking at it
<doy> hudini: http://pastebin.com/md19c83 these are the three options you have (i'm not quite sure on the syntax, i don't use records much)
<palomer> hrmph
<christo_m> hm?
<palomer> hrmph.
<christo_m> lol
<palomer> looks like I'm gonna have to write a substring algorithm
<palomer> ie a is a substring of b if you can shorten b to a
<palomer> by removing characters anywhere
<christo_m> OMG
<christo_m> yo Axle
<christo_m> im not calling print anywhere..
<christo_m> i defined it but its not being called
<palomer> bummer
<christo_m> im so stoned i just realixed NOW
<palomer> that's pretty stoned
<palomer> that's usually a sign that it's bedtime
<christo_m> WOO
<christo_m> it works
<christo_m> palomer: i have a midterm for htis class tmw too
<christo_m> thing is i get it usually first try
<Axle> good, I thought it was a test issue
<Axle> good luck with the rest of the project
<Axle> sleep calls
Axle has left #ocaml []
<palomer> hrmphhrmph
<palomer> tough questions in front of me
_Jedai_ has joined #ocaml
Jedai has quit [Read error: 110 (Connection timed out)]
Jedai has joined #ocaml
|Jedai| has quit [Read error: 110 (Connection timed out)]
Associat0r has quit [Client Quit]
<jknick> bue
jknick has quit ["leaving"]
ulfdoz has joined #ocaml
det has quit [Remote closed the connection]
det has joined #ocaml
_zack has joined #ocaml
middayc has joined #ocaml
code17 has joined #ocaml
seafood has quit []
filp has joined #ocaml
<hudini> any1 still awake ??
christo_m has quit ["Lost terminal"]
<Raevel_> it's morning!
seafood has joined #ocaml
smimou_ has quit ["bli"]
mishok13 has joined #ocaml
smimou has joined #ocaml
_zack has quit ["Leaving."]
tomh has joined #ocaml
damg has joined #ocaml
<flux> man, using weak hash tables feels almost like dynamic typing :)
_zack has joined #ocaml
_zack has quit [Client Quit]
_zack has joined #ocaml
yziquel has quit [Remote closed the connection]
damg has quit [Remote closed the connection]
Camarade_Tux has joined #ocaml
damg has joined #ocaml
hsuh has quit [Remote closed the connection]
middayc has quit []
ulfdoz has quit ["deprecated"]
fatalerrorx has quit []
olgen has joined #ocaml
hkBst has joined #ocaml
GustNG has joined #ocaml
love-pingoo has joined #ocaml
flux has quit [Read error: 60 (Operation timed out)]
flux has joined #ocaml
bering has joined #ocaml
<bering> _zack,
tomh has quit ["http://www.mibbit.com ajax IRC Client"]
middayc has joined #ocaml
seafood has quit []
Linktim has joined #ocaml
Linktim_ has joined #ocaml
olgen has quit []
Linktim has quit [Read error: 110 (Connection timed out)]
Linktim_ has quit [Read error: 110 (Connection timed out)]
bering has quit ["Leaving"]
seafood has joined #ocaml
olgen has joined #ocaml
gim has joined #ocaml
Linktim has joined #ocaml
olgen has quit []
Linktim has quit [Read error: 110 (Connection timed out)]
seafood has quit []
middayc_ has joined #ocaml
middayc has quit [Read error: 110 (Connection timed out)]
Linktim has joined #ocaml
Camarade_Tux has quit [Read error: 110 (Connection timed out)]
Camarade_Tux has joined #ocaml
<Smerdyakov> Anyone want to help me compare an ML-like web application language against competition like Rails and Django? I'm having trouble figuring out which applications to implement.
willb has joined #ocaml
<flux> wiki, blog ;-)
<flux> oh right, and social networking site..
middayc_ has quit []
<Smerdyakov> A wiki is too much work for right now, because of text processing.
<Camarade_Tux> minesweeper, bouler dash ? :D
<Smerdyakov> No AJAX, either
<Smerdyakov> Web 1.0 stuff
<Camarade_Tux> it's getting so far away :p
<Camarade_Tux> or, a shop, something like amazon/ebay ?
<flux> chat site?
<Smerdyakov> flux, probably can't be done nicely in Web 1.0 style.
<flux> actually that needs ajax too
<flux> and something like reddit is one application
<flux> but many of these need some ajax for finishing touches
<flux> I'm guessing you're planning to generate javascript in a type-safe fashion, but that can't be a trivial task :)
Linktim_ has joined #ocaml
Snark_ has joined #ocaml
Amorphous has quit [Read error: 110 (Connection timed out)]
Linktim has quit [Read error: 113 (No route to host)]
Amorphous has joined #ocaml
Linktim has joined #ocaml
Linktim_ has quit [Read error: 113 (No route to host)]
Linktim_ has joined #ocaml
Linktim has quit [Read error: 113 (No route to host)]
bering has joined #ocaml
Axle has joined #ocaml
<mfp> Smerdyakov: the "pet store" app has often been used for those purposes (it became infamous when Microsoft rigged some benchmarks to claim that AST.NET was 20x faster than J2EE IIRC)
<Smerdyakov> mfp, yeah, I looked at that a bit. Do you have a link to the Web 1.0 tutorial version of it?
<Smerdyakov> mfp, I only found the Web 2.0 version online.
<mfp> I understand the Pet Store was first introduced in some Java documentation, so maybe if you look for older JDKs...
<mfp> maybe http://tw-commons.rubyforge.org/svn/petstore/trunk/ ? (inspected some code for 30s, doesn't seem to have a lot of JS, unlike petstore2 on that same server)
<Smerdyakov> I'll take a look; thanks.
* mfp pukes
<mfp> --> <td><b><a href="/shop/viewItem.shtml?item=<%= item.string_id %>"><%= item.string_id %></a></b></td>
<Smerdyakov> Is that unusually bad for Rails?
<mfp> I think they're using some method to generate the URLs now
<mfp> still unsafe
<mfp> link_to :view_item or something like that
* Smerdyakov finds what looks like the mother lode: http://java.sun.com/blueprints/code/jps132/docs/index.html
<mfp> (but I don't know, I don't do Rails)
<mfp> looks like it
<mfp> ah, the other 100%-meaningless but still (ab)used by everybody benchmark is the 'how many "hello world" reqs/sec' thing
<Smerdyakov> ...which has almost nothing to do with languages or frameworks. :)
<mfp> I found some pages comparing PHP frameworks floating around. They had ridiculously low figures in the 10s or reqs/sec, or low hundreds.
<Smerdyakov> Is there a standard tool I could use to get such stats for my "Hello world"?
<mfp> ab
<mfp> I guess "hello world" does tell you something: if you're not getting several hundred/thousand reqs/sec, either you're doing it wrong or the lang/frameword is utter crap (PHP)
longh has joined #ocaml
<mfp> *framework
<Smerdyakov> I get 4000 requests per second when I redirect logging to /dev/null (testing with 1000 hits).
<Smerdyakov> How does that compare with The State of the Art?
<Smerdyakov> Oo, I just had a lucky ran of ab where every one of the 1000 requests was served within 2 ms. :)
<mfp> don't know what is considered SOTA, but 4 Kreq/s sounds right; I got ~3.5 Kreq/s for lighttpd + trivial hello word through FastCGI some time ago
<xevz> mfp: link_to has existed for a long time. :)
<mfp> xevz: thought so, that petstore must be really old
<xevz> Well, there's nothing forcing you to use link_to...
<xevz> That URL doesn't look very Rails-like though. :P
<xevz> Furthermore, what's unsafe with that line? Unless item is something that represents the address field, which is a bit unlikely...
<mfp> hardcoded URI = breaks if you change your routing; didn't really mean unsafe but rather "fragile"
filp has quit ["Bye"]
<Camarade_Tux> anybody think the "GENERATIVE blablabla" message on the caml-list is not spam ?
tomh has joined #ocaml
<Smerdyakov> I can't seem to find the Java Pet Store 1.3.2 tarball to download from an official Sun site. :-(
pango has quit [Remote closed the connection]
pango has joined #ocaml
<Smerdyakov> I'm using the previous version for now.
bering has quit ["Leaving"]
love-pingoo has quit ["Connection reset by pear"]
<Camarade_Tux> well, if you ever need it, here is a page that should work from any computer : http://java.sun.com/developer/releases/petstore/petstore1_3_1_02.html
mishok13 has quit [Read error: 110 (Connection timed out)]
<Smerdyakov> That's the old version. I want 3.1.2.
<maxote> mfp, Microsoft claimed that no enterprise can claim performance numbers using Microsoft products, now Microsoft claim performance numbers against J2EE of Sun/JRockit/...
<maxote> Microsoft did the trap
<maxote> I remember that the performance's improvement of M$ products is not an issue for M$
<maxote> and now he claims that it's an issue
<fremo> I'm looking for links or advices for writing lib's API...
alexyk has joined #ocaml
<alexyk> can I use "function" to match more than one argument? this works:
<alexyk> let x = function | (1,2) -> "a" | (2,3) -> "b" | _ -> "other";;
<alexyk> this doesn't:
<alexyk> let rec minlist = function | x::xs, m -> if m > x then minlist xs x else minlist xs m | _, m -> m;;
<alexyk> no matter how I try to syntaxize after |
<alexyk> | a b, or | (a,b)
<doy> what are you trying to do
longh has quit [Read error: 104 (Connection reset by peer)]
<alexyk> I just want to prettify my functions, instead of writing let f a b = match a b ... writing let f = function | a b -> ...
<alexyk> so I wonder how "match" and "function" are different for subsequent pattern matching
<alexyk> seems that function allows only a single thingy
<Smerdyakov> That's right.
<doy> yeah, i believe you'd have to use function twice
<doy> that or make your function take a tuple rather than multiple arguments
code17 has quit [Remote closed the connection]
<alexyk> ok... now I'm translating an F# prog into OCaml and it sucks that OCaml doesn't have a poolymorhic Set just like List
<alexyk> F# has Set<'a> which is exactly like a List
code17 has joined #ocaml
<alexyk> no need for stupid modules with redundant compare in them
<alexyk> so I wonder is there a normal Set for OCaml somewhere?
<alexyk> which I don't need to instantiate all the time for all kinds of things I want to keep unique?
* Smerdyakov is glad that there are no polymorphic-compare data structures packages with OCaml.
<doy> could fake it with Hashtbl maybe?
<Smerdyakov> s/packages/packaged
<Smerdyakov> Or maybe [Hashtbl] is a counterexample. Darn.
<doy> i'd imagine the redundant compare is just because Set is implemented with binary trees
<alexyk> doy, Smerdyakov: that's right, just doesn't feel like a Set
<doy> same reason c++ maps require a compare function
<alexyk> you can create ad hoc lists and should be able to have same Sets
<alexyk> now when writing the darn compare's, I need to refer to int compare which is occluded
<alexyk> how do I refer to the default compare for ints from my T.compare?
<Smerdyakov> alexyk, no, because list operations are implemented parametrically. Set operations are type-dependent.
Linktim has joined #ocaml
<alexyk> hmm -- is there a default compare op?
<alexyk> I'm confused as I redefined compare for int*int
<alexyk> now I can't get a default if it existed... or does it?
<alexyk> Ruby's 1 <=> 2 gives -1, same for ints in OCaml -- is there a default one?
<doy> not sure what you're asking
<alexyk> is there a default function for integers which returns -1,0,1 depending on their comparison?
<doy> compare
<doy> ?
paracetamolo has joined #ocaml
<alexyk> right, now I redefined it for tuples and can't access the original
<Smerdyakov> Pervasives.compare
<alexyk> Smerdyakov: thank you! :)
<alexyk> in the same vein: F# folk refers to :: as List.Cons, allowing to give it to things like fold
<alexyk> can we refer to it in prefix notation?
<Smerdyakov> No OCaml constructor may be treated as a function automatically.
<alexyk> so I can't write fold with (::), have to say fun e l -> e::l :(
<alexyk> let cons x xs = x::xs;; List.fold_right cons [1;2;3] [];;- : int list = [1; 2; 3]
<alexyk> might as well have a List.Cons
<alexyk> wouldn't hurt anybody...
<doy> does seem sort of strange that it doesn't exist
<alexyk> that's why I find F# refreshing -- Don Syme cleared up a few annoyances of OCaml
<alexyk> just take // comment :)
Linktim_ has quit [Read error: 110 (Connection timed out)]
paracetamolo has left #ocaml []
Linktim has quit ["Quitte"]
alexyk has quit []
ygrek has joined #ocaml
blue_prawn has joined #ocaml
Snark_ has quit ["Ex-Chat"]
middayc has joined #ocaml
_zack has quit [Read error: 110 (Connection timed out)]
Linktim has joined #ocaml
<Camarade_Tux> about obrowser, has anyone seen a way to benchmark it ? I'm under the impression it is much faster in webkit with the jit compiler enabled
Linktim has quit [Read error: 113 (No route to host)]
ulfdoz has joined #ocaml
<mfp> Camarade_Tux: you could take programs from the shootout?
<Camarade_Tux> mfp, right, good idea, I'll spend some time to set them up
<mfp> the latest batch (x64 ubuntu Intel Q6600 quad-core) also has "JavaScript TraceMonkey" programs
Linktim has joined #ocaml
<mfp> so the interpretative overhead can be measured
<mfp> it's a matter of wrapping those standalone programs in some JS function to time them & write the results to the page, I guess
<Camarade_Tux> I'll probably take a look at how sunspider does it
longh has joined #ocaml
ygrek has quit [Remote closed the connection]
ygrek has joined #ocaml
<Camarade_Tux> ok, I thought webkit with its jit was 30% slower than without on sunspider but was faster on obrowser, actually it's 40% *faster* on sunspider, that might explain why it's so much faster than yesterday (jit was broken until today)
vixey has joined #ocaml
jeddhaberstro has joined #ocaml
Linktim_ has joined #ocaml
Associat0r has joined #ocaml
Linktim has quit [Read error: 113 (No route to host)]
det has quit [Remote closed the connection]
yziquel has joined #ocaml
<yziquel> hi. i want to compile an ocaml application of windows... with mingw. However, i have no clue at all at how to compile on windows. (I do not even know where to find the "command line"...) Any links or pointers?
* Camarade_Tux wishes yziquel good luck
<yziquel> yeah, thanks...
<yziquel> it's a huge pain...
<Camarade_Tux> yziquel, I think there is a README.win32 file at the root of the source (not sure of the name), you can read it
<doy> yeah, following the readme got things working for me
<yziquel> I'll look for it... <irony> what's "locate" on windows? </irony>
middayc has quit []
_JusSx_ has joined #ocaml
code17 has quit ["Leaving."]
ulfdoz has quit ["deprecated"]
ulfdoz has joined #ocaml
seafood has joined #ocaml
ygrek has quit [Remote closed the connection]
willb has quit [Read error: 60 (Operation timed out)]
m3ga has joined #ocaml
m3ga has quit [Read error: 54 (Connection reset by peer)]
det has joined #ocaml
det has quit [Remote closed the connection]
_JusSx_ has quit ["leaving"]
seafood has quit []
alexyk has joined #ocaml
seafood has joined #ocaml
hkBst has quit [Remote closed the connection]
Camarade_Tux is now known as Camarade_Tux|bed
GustNG has quit [Read error: 110 (Connection timed out)]
Linktim_ has quit [Read error: 104 (Connection reset by peer)]
Linktim has joined #ocaml
ulfdoz has quit [Read error: 113 (No route to host)]
<yziquel> hi. sorry to be back again on this windows problem. I've read the README.win32 file, but i do not see in it any explanation on how to compile an ocaml application on windows using mingw... Do you guys just use cygwin to compile "as if" you were on a linux system? How do you get a native mingw+win32 application this way? I would like to have something i can run on another computer that has windows but not cygwin nor any other unix-like apps...
det has joined #ocaml
<doy> yeah, you do it through cygwin, just using the mingw toolchain
det has quit [Client Quit]
det has joined #ocaml
det has quit [Read error: 54 (Connection reset by peer)]