vect changed the topic of #ocaml to: OCaml 3.07 ! -- Archive of Caml Weekly News: http://pauillac.inria.fr/~aschmitt/cwn, ICFP'03 http://www.icfpcontest.org/, A tutorial: http://merjis.com/richj/computers/ocaml/tutorial/, A free book: http://cristal.inria.fr/~remy/cours/appsem, Mailing List (best ml ever for any computer language): http://caml.inria.fr/bin/wilma/caml-list
<mellum> I did, but never with threads... I try to avoid them at all costs :)
<Smerdyakov> Use yummy Concurrent ML threads in SML/NJ!
<mellum> Well, they're a lot better, they don't carry the huge overhead o OS based threada
<Hadaka> module Vars = Map.Make(struct type t = string let compare = compare end)
<Hadaka> type vars = int Vars.t
<Hadaka> hrm...
<Hadaka> vars is typed as a map from strings to integers, right?
<chrisu> Smerdyakov: is concurrent ml a concurrency oriented language where the threads are very cheap and they communicate by message passing?
lus|wazze has quit ["If we don't believe in freedom of expression for people we despise, we don't believe in it at all -- Noam Chomsky"]
<Smerdyakov> chrisu, yup.
<chrisu> nice
<mellum> That's about the only thing I miss in Ocaml... but of course, it comes at a performance price
<Smerdyakov> chrisu, it's implemented as libraries for Standard ML. I think it might not even add any extra compiler support, since SML/NJ already has first class continuations. Not sure about it, though.
<chrisu> how do they implement preemtive tasking with only continuations?
<Smerdyakov> Oh yeah. I bet that's what needs to be added. Or there might be existing timer support. *shrug*
<Smerdyakov> mellum, the Concurrent ML interface is very efficiently implementable without continuations, though.
<Smerdyakov> mellum, it just requires more special handling in the compiler.
<mellum> Smerdyakov: really? I never really looked at it
<mellum> although I have a book about it I found in a grab bin for 5¤ :)
<Smerdyakov> There's also John Reppy's PhD thesis on it online.
<simon-> I'm trying to learn how to comprehend exceptions such as End_of_File
<simon-> in C I'd just check if my getchar() would return -1, though here is how far I got:
<simon-> let rec foo c = match c with n -> n :: foo (input_char stdin) ;;
<simon-> (this would probably look better with a 'function')
<simon-> how would I cope with EOFs? try foo (input_char stdin) with ...
<simon-> the example I'm looking at uses its own exceptions and defines them with a tuple.
<Hadaka> the o'reilly ocaml book has an example of a c function that "explores" the representation of ocaml values
<Hadaka> is this available somewhere readily usable?
malc has joined #ocaml
lament_ has joined #ocaml
lament_ has quit [Client Quit]
lament has joined #ocaml
lament has quit [Client Quit]
lament has joined #ocaml
mimosa has quit ["I like core dumps"]
lament has quit [Client Quit]
chrisu has quit ["Client exiting"]
lament has joined #ocaml
lament has quit [Client Quit]
lament has joined #ocaml
lament has quit [Client Quit]
malc has quit [Read error: 60 (Operation timed out)]
buggs is now known as buggs|afk
afx|sleep has quit [Read error: 104 (Connection reset by peer)]
<Defcon7> anyone can figure how to declare an external C function that returns an array of array of char ?
The-Fixer has quit ["Goodbye"]
The-Fixer has joined #ocaml
The-Fixer has quit ["Goodbye"]
Herrchen has joined #ocaml
The-Fixer has joined #ocaml
Herrchen_ has quit [Read error: 60 (Operation timed out)]
<simon-> why have both mutable and immutable strings/character arrays?
tzoompy has joined #ocaml
<tzoompy> test?
<tzoompy> hello
tzoompy is now known as foo
<foo> hello
foo has quit [Client Quit]
<simon-> hi there
<simon-> *sigh*
<Defcon7> hi :)
<Defcon7> do you know how i can declare in ocaml an external C function which returns an array of strings ?
<Defcon7> (which is an array of array of chars)
<simon-> I have not made it to C extensions yet
<Defcon7> o~simon-: simon.eggheads.org is yours ?
<simon-> Defcon7, sorry for not responding
<Defcon7> np :)
<simon-> Defcon7, more or less, yes
<Defcon7> kewl :)
<simon-> yeah, it is 'kewl' :-P
<Defcon7> i've seen your website's hostname on #tcl@undernet when i was talking with you here
<simon-> you are there?
<Defcon7> ops #tcl@efnet
<simon-> seriously? I'm not even on efnet
<simon-> actually I asked people to distribute it so that people could evaluate my vim syntax file, but nobody seems to be giving any response.
<Defcon7> undernet.
<Defcon7> im in both
<Defcon7> but the url is on undernet
<simon-> aha. TCL and O'Caml seem like an odd pair
<simon-> it's on a few networks
<Defcon7> you know any other ocaml related channel ?
<simon-> no, sorry.
<simon-> I would like a forum in which I can begin from scratch acting all newbie-ish... it's been some time.
<simon-> Defcon7, you wouldn't happen to be using Vim, would ya?
<Defcon7> hm nope :P
<Defcon7> i use *nix only as server
<Defcon7> my workstation is windows
<Defcon7> and on windows i use textpad
<simon-> I have no workstation
<simon-> but the thin clients I use are usually windows powered
<Defcon7> :)
<Defcon7> i started learn ocaml and now im learning C
<simon-> oh, that way around..
<Defcon7> because there are not too much ocaml libraries around
<Defcon7> so i have to use C libraries
<simon-> what were your intentions before learning ocaml?
<Defcon7> programming is the smallest part of my work
<Defcon7> iam a sysadmin
<Defcon7> sometimes i have to make some small programs
<simon-> I have seen your name before. I just have to figure out where
<Defcon7> for the servers i mantain
<Defcon7> and i was using tcl for that
<Defcon7> tcl/tclX
<simon-> Defcon7, nothing perl/ruby/python can't do?
<simon-> oh, I guess tcl belongs to that list.
<Defcon7> yes tcl is similar
<simon-> I know tcl.
<Defcon7> :)
<Defcon7> but i started learning ocaml
<Defcon7> because i wanted to reduce the load of the servers
<Defcon7> when i made the tcl scripts the servers had a small number of users
<Defcon7> but now we have a lot of users
<Defcon7> so im replacing these tcl programs with ocaml programs
<Defcon7> ocaml is a lot more fast
<Defcon7> and it is still an high level lang
<Defcon7> using C sounds like to lose time
<Defcon7> ocaml's performance is similar to C and the code needed is 1/3
<Defcon7> so thats why i choosen ocaml :P
<simon-> sounds fair.
<Defcon7> fair :?
<simon-> yeah. I know a little C myself, and I kill myself over the amount of memory management I have to go through.
<Defcon7> yes thats what im saying :)
<Defcon7> take a look :)
<simon-> ah yes, that's actually how I got to know of ocaml.
<simon-> does it make any sense to make a line/word/char counter that relied purely on immutable objects?
systems has joined #ocaml
systems has quit [Read error: 104 (Connection reset by peer)]
whee has quit ["Leaving"]
__buggs has joined #ocaml
buggs|afk has quit [Read error: 60 (Operation timed out)]
lus|wazze has joined #ocaml
eternite has joined #ocaml
<eternite> hello !
<lus|wazze> hi
Defcon7 has quit [Remote closed the connection]
__buggs is now known as buggs
avn has quit [Read error: 54 (Connection reset by peer)]
avn has joined #ocaml
mimosa has joined #ocaml
gim has quit [Read error: 104 (Connection reset by peer)]
smimou has joined #ocaml
gim has joined #ocaml
mimosa has quit [Read error: 54 (Connection reset by peer)]
joel_ has joined #ocaml
jrosdahl has quit [Read error: 110 (Connection timed out)]
joel_ has quit ["Client exiting"]
jrosdahl has joined #ocaml
Defcon7 has joined #ocaml
eno has joined #ocaml
eno has quit ["BitchX: it makes bathtime lots of fun!"]
smimou has quit ["I like core dumps"]
mimosa has joined #ocaml
Defcon7 has quit [Remote closed the connection]
Defcon7 has joined #ocaml
Herrchen has quit ["leaving"]
Herrchen has joined #ocaml
systems has joined #ocaml
Defcon7 has quit ["changing servers"]
systems has quit [Client Quit]
<simon-> I've got this code snippet I assumed would work, but it doesn't seem to
<simon-> let lix = (float_of_int !total_words) /.
<simon-> (float_of_int !total_sentences) +.
<simon-> (float_of_int !big_words) *. 100. /.
<simon-> (float_of_int !total_words) in ;;
<simon-> basically, those three references are integers
<simon-> and I'm looking to implement a shortening expression for the formula (x/y)+(z*100)/x
<simon-> can anyone point out why my ocaml interpreter catches an error in this?
<Riastradh> What error does it raise?
<simon-> syntax error at characters 4-7 (I indent by four spaces)
<simon-> just a sec.
<Riastradh> (by the way, the OCaml file extension is typically '.ml')
<simon-> Riastradh, I know, but I'm supposed to improve a file I have from a friend that's already named this :-P
<Riastradh> You missed an 'in' after the first 'let' bit.
<Riastradh> And. Um.
* Riastradh sighs and shakes his head.
<simon-> actually his version is called '.sml' and is, as the name, SML
<Riastradh> Why are you using references at all if you're going to assign constant values to them?
<simon-> Riastradh, oh, I'm just testing
<Riastradh> And even if you are using them, you can't initialize them _after_ the computation regarding them.
<simon-> Riastradh, better understand one code bit at a time.
<simon-> Riastradh, I'm supposed to analyse a channel and alter the values of these, but until I have code that can do this, I've just got some sample values.
<Riastradh> simon-, that's irrelevant.
<Riastradh> You can't compute something with some given inputs and _then_ initialize the inputs.
<Riastradh> lix will always be '0. /. 1 +. 0. *. 100. /. 0.'.
<simon-> Riastradh, but aren't ref 0 supposed to be mutable?
<Riastradh> They are.
<simon-> the := lines are supposed to be replaced with code that adjusts these mutable references according to input receifed from e.g. stdin
<Riastradh> But you assign them _AFTER_ the computation; lix is _already_ computed when you assign them; assigning them doesn't make the control flow just 'jump back' to the expression that is evaluated to get lix.
<simon-> Riastradh, ohh... lix is not a shorthand? *sigh*
<Riastradh> 'Shorthand?'
<simon-> sorry, expression
<simon-> thanks for pointing that out. I'll see that lix is assigned after the analyse-bit
Defcon7 has joined #ocaml
Etaoin has joined #ocaml
<Etaoin> hi
Defcon7 has quit [Remote closed the connection]
<Etaoin> has anyone ever had trouble with lablgtk setting a RGB foreground color on a drawable?
<Etaoin> is this polygon black for anyone else?
<Etaoin> (that's the drawable example with one additional line)
Defcon7 has joined #ocaml
noss has joined #ocaml
phubuh has quit [Remote closed the connection]
lus|wazze has quit ["If we don't believe in freedom of expression for people we despise, we don't believe in it at all -- Noam Chomsky"]
<eternite> by
eternite has left #ocaml []
noss has quit ["hej då"]