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
mourlo has joined #ocaml
docelic|sleepo is now known as docelic
lament has joined #ocaml
mourlo has left #ocaml []
Kinners has quit ["leaving"]
skylan has quit [Read error: 54 (Connection reset by peer)]
skylan has joined #ocaml
Kinners has joined #ocaml
sam_ has quit [forward.freenode.net irc.freenode.net]
polin8 has quit [forward.freenode.net irc.freenode.net]
kev has quit [forward.freenode.net irc.freenode.net]
exa-away has quit [forward.freenode.net irc.freenode.net]
docelic has quit [forward.freenode.net irc.freenode.net]
mattam_ has quit [forward.freenode.net irc.freenode.net]
lament has quit [forward.freenode.net irc.freenode.net]
Dybbuk has quit [forward.freenode.net irc.freenode.net]
smklsmkl has quit [forward.freenode.net irc.freenode.net]
whee has quit [forward.freenode.net irc.freenode.net]
Torquemada has quit [forward.freenode.net irc.freenode.net]
asqui has quit [forward.freenode.net irc.freenode.net]
xtrm has quit [forward.freenode.net irc.freenode.net]
lam has quit [forward.freenode.net irc.freenode.net]
thierry_afk has quit [forward.freenode.net irc.freenode.net]
Kinners has quit [forward.freenode.net irc.freenode.net]
skylan has quit [forward.freenode.net irc.freenode.net]
merriam has quit [forward.freenode.net irc.freenode.net]
gl has quit [forward.freenode.net irc.freenode.net]
Segora has quit [forward.freenode.net irc.freenode.net]
emu has quit [forward.freenode.net irc.freenode.net]
Kinners has joined #ocaml
skylan has joined #ocaml
lament has joined #ocaml
Dybbuk has joined #ocaml
merriam has joined #ocaml
lam has joined #ocaml
xtrm has joined #ocaml
whee has joined #ocaml
asqui has joined #ocaml
smklsmkl has joined #ocaml
Torquemada has joined #ocaml
thierry_afk has joined #ocaml
Segora has joined #ocaml
emu has joined #ocaml
polin8 has joined #ocaml
kev has joined #ocaml
exa-away has joined #ocaml
mattam_ has joined #ocaml
docelic has joined #ocaml
gl has joined #ocaml
sam_ has joined #ocaml
sam_ has quit [forward.freenode.net irc.freenode.net]
exa-away has quit [forward.freenode.net irc.freenode.net]
kev has quit [forward.freenode.net irc.freenode.net]
polin8 has quit [forward.freenode.net irc.freenode.net]
docelic has quit [forward.freenode.net irc.freenode.net]
mattam_ has quit [forward.freenode.net irc.freenode.net]
Segora has quit [forward.freenode.net irc.freenode.net]
emu has quit [forward.freenode.net irc.freenode.net]
gl has quit [forward.freenode.net irc.freenode.net]
sam_ has joined #ocaml
docelic has joined #ocaml
exa-away has joined #ocaml
polin8 has joined #ocaml
kev has joined #ocaml
mattam_ has joined #ocaml
asqui has quit [Excess Flood]
asqui has joined #ocaml
gl has joined #ocaml
emu has joined #ocaml
Segora has joined #ocaml
docelic has left #ocaml []
lament has quit ["mental mantle"]
asqui has quit [Read error: 60 (Operation timed out)]
thierry_afk is now known as thierry
<thierry> hi there
<xtrm> hi
Kinners has quit ["zzzz"]
thierry has quit ["[x]chat"]
xmkl has joined #ocaml
smklsmkl has quit [Read error: 54 (Connection reset by peer)]
mattam has joined #ocaml
mattam_ has quit [Read error: 60 (Operation timed out)]
mattam has quit [forward.freenode.net irc.freenode.net]
mattam has joined #ocaml
gl has quit [Read error: 104 (Connection reset by peer)]
exa-away is now known as exa
gl has joined #ocaml
gl has quit [Read error: 54 (Connection reset by peer)]
gl has joined #ocaml
<exa> how do we use Unix.read?
<exa> how does it read into a string I was confused
<sam_> exa, let a = Unix.openfile "foo.txt" [Unix.O_RDONLY] 0 in let buf = String.make 1000 ' ' in let count = Unix.read a buf 0 1000 in Unix.close a; buf
<sam_> ...and add the needed error checks
<sam_> or if you want stream type io, there are Unix.in_channel_of_descr and Unix.out_channel_of_descr, and after that you can use the io functions from pervasives
asqui has joined #ocaml
<exa> sam_: okay thanks
<exa> sam_: So you have to build the string before, like in C/C++
<sam_> if you want to do raw io, yes, you need to have allocated a buffer where the input will store the data.. if you want to read stuff in line by line, you can create in in_channel out of the descriptor (or just use open_in), and read using input_line, which will return you the lines as strings, with no allocation needed
<exa> blackstar:install$ make
<exa> ocamlc -I +getopt getopt.cmo -c gnuargs.ml
<exa> ocamlc -I +getopt getopt.cmo -c gnuargs.cmo installargs.ml
<exa> File "installargs.ml", line 3, characters 0-12:
<exa> Unbound module GnuArgs
<exa> I'm having some problems with separate compilation, too :)
<exa> I just define a module GnuArgs = struct ... end in gnuargs.ml
<exa> And use "open GnuArgs" in installargs.ml
* exa takes a look at
<exa> "common errors" section in manual, had to be somewhere
<sam_> why do you have all these .cmo files in the compile lines?
<exa> I don't know this is the first time I'm trying to do separate compilation
<exa> Let me remove them
<sam_> oh, and a likely problem is that gnuargs.ml will create a module "Gnuargs", not a module "GnuArgs"
<exa> hm, why's that?
<sam_> if you have "module GnuArgs = ..." inside the file gnuargs.ml, then you have a module "Gnuargs" which has a module "GnuArgs" inside it (and accessable as "Gnuargs.GnuArgs"
<sam_> that is, an .ml file defines a module implicitly, so normally you would not have a "module Foo = ..." inside the source file, unless you wanted to made an inner module (or whatever term you want to use for them)
<exa> I think that solves it, thanks
<exa> That doesn't seem to be the way it's documented in the manual, though
<exa> I have to read that
merriam has left #ocaml []
<exa> 8.3 Modules and filenames
<exa> 8.3 Modules and the file system
<exa> sorry
<exa> OK, I don't have to write a module construct in a file
<sam_> seems they haven't mentioned the implicitness in 8.3, but still the section seems right to me
systems has joined #ocaml
<exa> it compiles but it doesn't run right now
<exa> great
<exa> no it does
<exa> hmmm
<exa> how does one specify the entry point in ocaml?
<exa> you have to write a function main() and call it?
* exa upgrades his ocaml system
merriam has joined #ocaml
<sam_> you don't have a 'specific' entry point in ocaml, instead it evaluates all expressions, so you could define your main program under 'let main () = ...', and then have 'let _ = main ()' after it.. the latter would be evaluated when the program is loaded, starting the program..
<exa> what you say is a little confusing for a good reason
<sam_> yeah, it sounded a bit confusing to me too, after reading what i wrote ;-)
<exa> in case of multiple modules, i have to have some control on what's done first
<exa> that's the way it's done in haskell at least :)
<exa> I mean, there is a main() function in haskell
<sam_> when a program is started, the modules are initialized in the order they were fed to the linker
<exa> well, ok
<exa> i mean i use it like i saw in the manual
<exa> let main () = .... and then main();; somewhere
<sam_> also, the ocaml compiler enforces that you link the modules in an order that respects dependencies
<exa> Yes, I noticed that
TachYon26 has joined #ocaml
<exa> sam_: how do i detect EOF?
<exa> ouch, i really need to see some example unix code maybe
<sam_> using which functions?
<exa> like file ops
<sam_> using Unix.read, read returns 0 (0 chars read) in case of EOF.. if you are using stream io (input_*) they raise End_of_file exception, in case of EOF
<exa> OK :)
<exa> Mucking with ocaml to do a regular thing is fun, makes me feel like a newbie :)
<sam_> i've pretty much given up on looking into new programming languages, and come to the conclusion that there is none that i really like :-)
<exa> Hahaha
<exa> Me, too
<exa> But I also found out that I HATE C and C++
<sam_> I think both C and C++ have their good points.. hmm, although I think C++s good points are mostly Cs good points, plus a big bunch of new bad points :-)
<exa> C++ is a nightmare of design fallacies
<sam_> I like their zero overhead policy, and that they allow you to access the machine in the level of the machine, when needed.. I'd prefer a 'low overhead with programmer controller higher overhead' policy better, but i really dislike the haskell type policy of 'speed does not matter'
<sam_> and for low level access.. sometimes you just need to know the internal representations and other details.. and mostly all the 'high level' languages allow very poor (most of the time none) support at that level
<sam_> sure abstraction is cool, but the reason for abstaction is to make things easier and less error prone, not to make easy things harder, and require you to build kludges to go past the abstractions (or 'leaky abstractions' as seems to be the new word for it)
<systems> i was having a discussion few days ago with a comp. engineer student
<systems> i have a B.A in mis
<systems> so we were like heavens apart
<sam_> mis?
<systems> management information systems
<systems> anyway, we kind of reach the conclusion, that it's like a ladder
<systems> lower level comes with better speed and electrical engineers
<systems> higher level allow for more productivity and focus on program logic, and the need to know the internal fades
<systems> and the need for an engineer fades
<systems> and with time, we might see for example, python to c compiler, c optimizer, which might lead to ppl programming in high level, and other programs optimize for speed
<systems> did that make sense
<sam_> well, i tend to think that's now, and not 'sometime future'.. most companies are looking for domain specific programmers, and not interested in system programmers.. not quite following you on that python to c compiler/c optimizer though. i believe there already exists python to c compiler(s), and then the c compiler will do it's optimizations just like for any c program
systems has quit ["Client Exiting"]
mattam has quit [Read error: 113 (No route to host)]
j_bravo has joined #ocaml
xtrm has quit ["leaving"]
<TachYon26> sam_: As far I know (and I looked for it) there's no python to C translator..
<sam_> tach, just checked.. I was thinking on Psyco, but seems it doesn't go through C
<sam_> s/on/of
<TachYon26> sam_: psyco is in early dev stage, and it covers only little part of python .. and it's rather JIT compiler ...
nkoza has joined #ocaml
<whee> exa: you might also like using streams for file input/parsing
<whee> there's a bit of overhead if it's a simple structure, but they're fun.
<whee> I found doing work in camlp4 helps in understanding how streams work, if that's a problem
Dybbuk has quit ["[x]chat"]
TachYon26 has quit ["bez ki³y nie ma zaliczenia (z prawd studentek AM)"]
asqui has quit [Read error: 104 (Connection reset by peer)]
asqui has joined #ocaml
<exa> whee: thanks man
gl has quit [Read error: 104 (Connection reset by peer)]
gl has joined #ocaml
gl has quit [Read error: 54 (Connection reset by peer)]
gl has joined #ocaml
<exa> owwwww, debian upgrade fucked me up
Miwong has joined #ocaml
<Miwong> hello
<exa> hi
Miwong has quit ["BitchX-1.0c19 -- just do it."]
exa has quit ["using sirc version 2.211+KSIRC/1.2.4"]
aleksi has joined #ocaml
lament has joined #ocaml
gl has quit [Read error: 54 (Connection reset by peer)]
gl has joined #ocaml
graydon has joined #ocaml
lament has quit ["mental mantle"]
gl has quit [Read error: 104 (Connection reset by peer)]
gl has joined #ocaml
j_bravo has quit ["Trillian (http://www.ceruleanstudios.com)"]