<seafood>
I have an interesting question about style. How wide should your editor window be for OCaml code? I'm starting to think that 80 characters is too little.
<cypher23>
seafood, as a general rule I ususally use "as wide as my screen is"
<seafood>
cypher23: So do many people, but I think this doesn't work well on large projects with many people.
<cypher23>
however, if you write code that other people will look at, you shouldn't make it too wide
<seafood>
I'm trying to come up with a reasonable figure for a multi-person project.
pango_ has quit [Remote closed the connection]
<cypher23>
seafood, maybe a value around 100?
<seafood>
cypher23: That's what I've come to believe is a good number.
johnnowak has joined #ocaml
sponge45 has joined #ocaml
pango__ has quit [Excess Flood]
pango__ has joined #ocaml
batdog is now known as batdog|gone
b00t has joined #ocaml
b00t has quit [Read error: 104 (Connection reset by peer)]
Mr_Awesome has joined #ocaml
yondalf has joined #ocaml
Mr_Awesome has quit ["...and the Awesome level drops"]
yondalf has quit [Read error: 110 (Connection timed out)]
johnnowak has quit []
Smirnov has joined #ocaml
<Smirnov>
whats the difference between = and ==
<pingu>
Network programming under ocaml, is the standard to do it with the Unix library? Is that cross platform at all?
<Smirnov>
Unix library is, as you may have guessed, for *nix
<pingu>
Right, so is there a cross platform way of doing common networky things?
<Smirnov>
cygwin? :)
<pingu>
I'm not running windows, that isn't the issue.
<pingu>
So, the standard is to use the Unix library and socket related things it provides?
batdog|gone is now known as batdog
<Smirnov>
I'd tell you, but I only do academic things in ocaml :)
<Smirnov>
It's not really designed to do low level things like that afaik
<pingu>
I was under the impression one of it's major selling points was it's versatility.
<pingu>
Which was what made it the better choice over say, haskell for non-academic type things.
<Smirnov>
oh sure, its got oop for one :)
<Smirnov>
its just that i myself havent used it for anything industry, i have a class in programming languages (writing an interpreter in ocaml essentially)
<pingu>
Aah, so has anyone here touched sockets?
<Smirnov>
C sockets? :-D
<pingu>
No, ocaml sockets. I was kind of hoping for an abstraction layer :P
<pingu>
Ooh, looks like the Unix library does in fact emulate Windows.
<Smirnov>
cool
<pingu>
That's all I needed, thanks.
<Smirnov>
well, sockets are sockets.. if you want an abstraction layer you use a higher level library
<Smirnov>
either way it boils down to reading/writing a fd, not particularly hard
<Smirnov>
but i would imagine its not very functional since sockets ought to be persistent, unless you're doing some kind of infinite loop master thread
ramkrsna has joined #ocaml
<tsuyoshi>
in the documentation they list the parts of the unix module that don't work in windows
<tsuyoshi>
e.g. select only works with sockets
<pingu>
Yeah, that's where I got the assumption at least something works under windows.
<tsuyoshi>
oh.. you know what.. I did a berkeley db interface for ocaml
<tsuyoshi>
I should probably release it
yondalf has joined #ocaml
Smerdyakov has quit ["Leaving"]
Skal has joined #ocaml
johnnowak has joined #ocaml
sponge45 has quit ["zzzzzzzzzz"]
MisterC has joined #ocaml
DRMacIver has quit [Read error: 104 (Connection reset by peer)]
DRMacIver has joined #ocaml
Skal has quit [Read error: 110 (Connection timed out)]
danly is now known as doti
batdog is now known as batdog|gone
yondalf has quit ["leaving"]
doti has quit ["Leaving"]
rillig has quit ["exit(EXIT_SUCCESS)"]
<pango__>
Smirnov: = is structural equality (checks that two values are identical, recursively), == is physical equality (check that those value are the *same*, by comparing the address)
Smirnov has quit [Read error: 113 (No route to host)]
<pango__>
there used to be a very minimalistic mlim client in MLdonkey sources, but it was removed since it was really not finished (it can probably be found in the CVS repository)
<love-pingoo>
zmdkrbou: is poule using sam's IRC module ?
ikaros_ has quit [Read error: 110 (Connection timed out)]
velco has joined #ocaml
ikaros_ has joined #ocaml
<tsuyoshi>
love-pingoo: that looks like it might be what I need
<love-pingoo>
if you find missing features, feel free to contact the author
<love-pingoo>
he should advertise this on the hump, btw
love-pingoo has quit ["Connection reset by pear"]
rashnu has joined #ocaml
Leonidas has joined #ocaml
<rashnu>
http://nopaste.php-q.net/255491 -> can someone take a look and tell me why the first argument is passing (a' list * int) list list instead of (a' list * int) list ?
<rashnu>
nvm, found the problem :p
rashnu has quit []
Zeitgeist has joined #ocaml
love-pingoo has joined #ocaml
<zmdkrbou>
love-pingoo: nope, it doesn't (and sam's library is better :p)
<love-pingoo>
lol
<love-pingoo>
why this choice ? isn't sam's lib older ?
<zmdkrbou>
it is, but i don't like functors :) (but the point is : sam's one works :p)
pango__ is now known as pango
yondalf has joined #ocaml
slipstream has joined #ocaml
yondalf_ has joined #ocaml
Leonidas has quit ["Leaving"]
yondalf has quit [Read error: 60 (Operation timed out)]
slipstream-- has quit [Read error: 110 (Connection timed out)]
yondalf_ has quit [Read error: 54 (Connection reset by peer)]
yondalf has joined #ocaml
microcape has quit []
cmeme has quit ["Client terminated by server"]
cmeme has joined #ocaml
yondalf has quit [Read error: 54 (Connection reset by peer)]
yondalf has joined #ocaml
yondalf has quit ["leaving"]
jajs has joined #ocaml
malc_ has joined #ocaml
<love-pingoo>
do we have an equivalent of /usr/bin/which in the standard lib ?
<pango>
not afaik
<malc_>
love-pingoo: `ocamlc -where`/bin/moo is closest thing i'd guess
<pango>
I think he asked if there's a way to know the full path of the executable that would be run, knowing just the executable name
<love-pingoo>
otherwise I have to look for "which" at configure-time then call it, retrieve the output, etc... that's boring
<love-pingoo>
something standard and easy would be cool
<malc_>
pango: i joined after the actual question
<pango>
love-pingoo: what do you need the full path for btw ?
<love-pingoo>
I'm using Unix.create_process
<love-pingoo>
The executable file prog is searched in the path. << shit :)
<love-pingoo>
thanks for pointing that out :)
<pango>
yes
<love-pingoo>
mmm actually I think I still want to do that
<love-pingoo>
I have several plugins for downloading, wget/text2wave/ufetch/...
<pango>
do check early if external program(s) are present ?
<love-pingoo>
I may not want to try them all the time when I can guess at startup that one isn't available on the system
<pango>
checking whether they're present won't be less costly than trying to start them, and notice the failure
<pango>
(actually the latter may be more reliable)
<love-pingoo>
it's ok as long as they don't accept an empty argv
<love-pingoo>
which is fine :)
<malc_>
`let pathl = let s = Sys.getenv "PATH" in Str.split (Str.regexp_string ":") s' and then a simple fold with concatenated path element and program name + `Sys.file_exists'
<love-pingoo>
Unix.create_process returns a valid PID for an invalid program name
<malc_>
create_process is just a wrapper above /bin/sh invokation.. so no wonder
<pango>
looks like a bug
<love-pingoo>
I'll write my own "which" as malc_ suggests, that's easy
<love-pingoo>
no need to call which when one has Sys.gentenv and Sys.file_exists, stupid me
<malc_>
pango: no it's not
<malc_>
for the reasons explained above
<pango>
malc_: that's not mentionned in the description
<pango>
and I doubt it
<pango>
now only reading the sources will tell :)
<malc_>
huh.. i'm also telling you :)
<malc_>
erm
<pango>
it's more likely that after the fork() the original process gets the PID of the new process, without checking that in this one the execv*() call worked
<malc_>
s;huh;heh
<malc_>
sigh, color me a liar.. it does uses fork/execv
<malc_>
in open_process it does invoke /bin/sh though
<pango>
shell is used on open_process* yes
<pango>
s/on/in/
<pango>
actually I wonder how one could check that the execv*() worked
<malc_>
RETURN VALUE On success, execve() does not return, on error -1 is returned, and errno is set appropriately.
<pango>
yes, so in case of success, you can't notify parent process
<pango>
that's the problem with providing a function that does both fork() and exec() for you ;)
<malc_>
real coders use posix_spawn
<malc_>
oh well.. open_process is sexy and i'll stick with it
<pango>
I guess the only way to detect the failure is read/write problems with the pipes (like shell's "broken pipe")
<flux__>
can't you get the error from Unix.wait?-o
<malc_>
flux__: exec does not return and fork already succeeded
<pango>
flux__: isn't there a race here ?
<malc_>
so what you are saying does not make much sense
<flux__>
well it obviously would assume the error is not the same as what the child process would return
<flux__>
hopefully the other process would return 0?
<flux__>
what does create_process exit with when exec fails?
<flux__>
(the forked process that is..)
<pango>
the pid of the forked process
<flux__>
which is your argument to waitpid
<pango>
haven't tried
<flux__>
and the child process will terminate shortly
<flux__>
with some return code
<flux__>
doing it otherwise would be slightly complex, though.. it would require using pipes.
<flux__>
(one more thi ng to manage, because open fds aren't collected (?) by garbage collector)
<pango>
# Unix.waitpid [Unix.WNOHANG] pid ;;
<pango>
- : int * Unix.process_status = (11619, Unix.WEXITED 127)
<flux__>
((although you could assign a separate operation to perform cduring gc in that case)
<flux__>
using WNOHANG for that sounds racy
malc_ has quit ["leaving"]
descender has joined #ocaml
moulburne has joined #ocaml
moulburne has quit ["Chatzilla 0.9.76 [Firefox 2.0/2006101022]"]
Smerdyakov has joined #ocaml
love-pingoo has quit ["Leaving"]
velco has quit ["Ex-Chat"]
danly has joined #ocaml
ulfdoz_ has joined #ocaml
ulfdoz has quit [Read error: 54 (Connection reset by peer)]
_velco has quit ["I'm outta here ..."]
postalchris has joined #ocaml
smimou has joined #ocaml
love-pingoo has joined #ocaml
joshcryer has quit [Client Quit]
microcape has joined #ocaml
microcape has quit [Remote closed the connection]
jajs has quit [Remote closed the connection]
Zeitgeist has left #ocaml []
<tsuyoshi>
oh cool.. someone did "Purely Functional Data Structures" in ocaml
<tsuyoshi>
been trying to read that book but not really getting it all.. maybe if I see the examples in a language I actually use I'll get it
<tsuyoshi>
oh except the site is down
<tsuyoshi>
damnit
_fab has quit [Read error: 104 (Connection reset by peer)]
_fab has joined #ocaml
bluestorm has joined #ocaml
mbishop has joined #ocaml
jajs has joined #ocaml
jajs has left #ocaml []
malc_ has joined #ocaml
postalchris has quit [Read error: 110 (Connection timed out)]
menace has joined #ocaml
postalchris has joined #ocaml
love-pingoo has quit ["Connection reset by pear"]
bluestorm has quit ["Konversation terminated!"]
Mr_Awesome has joined #ocaml
Smerdyakov has quit [orwell.freenode.net irc.freenode.net]
descender has quit [orwell.freenode.net irc.freenode.net]
ikaros_ has quit [orwell.freenode.net irc.freenode.net]
Skal has quit [orwell.freenode.net irc.freenode.net]
ramkrsna has quit [orwell.freenode.net irc.freenode.net]
_fab has quit [orwell.freenode.net irc.freenode.net]
ppsmimou has quit [orwell.freenode.net irc.freenode.net]
mbishop has quit [orwell.freenode.net irc.freenode.net]
danly has quit [orwell.freenode.net irc.freenode.net]
jacobian_ has quit [orwell.freenode.net irc.freenode.net]
eradman has quit [orwell.freenode.net irc.freenode.net]
Oatmeat|umn has quit [orwell.freenode.net irc.freenode.net]
batdog|gone has quit [orwell.freenode.net irc.freenode.net]
Mr_Awesome has quit [orwell.freenode.net irc.freenode.net]
smimou has quit [orwell.freenode.net irc.freenode.net]
pango has quit [orwell.freenode.net irc.freenode.net]
jdev has quit [orwell.freenode.net irc.freenode.net]
DRMacIver has quit [orwell.freenode.net irc.freenode.net]
levi_home has quit [orwell.freenode.net irc.freenode.net]
triple_ has quit [orwell.freenode.net irc.freenode.net]
flux__ has quit [orwell.freenode.net irc.freenode.net]
ulfdoz_ has quit [orwell.freenode.net irc.freenode.net]
gunark has quit [orwell.freenode.net irc.freenode.net]
bebui has quit [orwell.freenode.net irc.freenode.net]
datrus has quit [orwell.freenode.net irc.freenode.net]
setog3 has quit [orwell.freenode.net irc.freenode.net]
haelix has quit [orwell.freenode.net irc.freenode.net]
pingu has quit [orwell.freenode.net irc.freenode.net]
seafood has quit [orwell.freenode.net irc.freenode.net]
zmdkrbou has quit [orwell.freenode.net irc.freenode.net]
Norgg has quit [orwell.freenode.net irc.freenode.net]
menace has quit [orwell.freenode.net irc.freenode.net]
slipstream has quit [orwell.freenode.net irc.freenode.net]
Amorphous has quit [orwell.freenode.net irc.freenode.net]
Ugarte has quit [orwell.freenode.net irc.freenode.net]
seafood_ has quit [orwell.freenode.net irc.freenode.net]
tsuyoshi has quit [orwell.freenode.net irc.freenode.net]
gim has quit [orwell.freenode.net irc.freenode.net]
ozzloy has quit [orwell.freenode.net irc.freenode.net]
Shimei has quit [orwell.freenode.net irc.freenode.net]
postalchris has quit [orwell.freenode.net irc.freenode.net]
cmeme has quit [orwell.freenode.net irc.freenode.net]
shawn has quit [orwell.freenode.net irc.freenode.net]
fremo has quit [orwell.freenode.net irc.freenode.net]
mellum has quit [orwell.freenode.net irc.freenode.net]
l_a_m has quit [orwell.freenode.net irc.freenode.net]
Hadaka has quit [orwell.freenode.net irc.freenode.net]
cypher23 has quit [orwell.freenode.net irc.freenode.net]
malc_ has quit [orwell.freenode.net irc.freenode.net]
Demitar has quit [orwell.freenode.net irc.freenode.net]
Demitar_ has quit [orwell.freenode.net irc.freenode.net]
TaXules has quit [Remote closed the connection]
mattam has quit [Read error: 131 (Connection reset by peer)]
TaXules has joined #ocaml
jacobian has joined #ocaml
Mr_Awesome has joined #ocaml
postalchris has joined #ocaml
menace has joined #ocaml
malc_ has joined #ocaml
mbishop has joined #ocaml
_fab has joined #ocaml
smimou has joined #ocaml
ulfdoz_ has joined #ocaml
danly has joined #ocaml
Smerdyakov has joined #ocaml
descender has joined #ocaml
cmeme has joined #ocaml
slipstream has joined #ocaml
ikaros_ has joined #ocaml
jacobian_ has joined #ocaml
Skal has joined #ocaml
DRMacIver has joined #ocaml
ramkrsna has joined #ocaml
pango has joined #ocaml
eradman has joined #ocaml
datrus has joined #ocaml
setog3 has joined #ocaml
gunark has joined #ocaml
Demitar has joined #ocaml
Demitar_ has joined #ocaml
Amorphous has joined #ocaml
ppsmimou has joined #ocaml
levi_home has joined #ocaml
triple_ has joined #ocaml
jdev has joined #ocaml
batdog|gone has joined #ocaml
Oatmeat|umn has joined #ocaml
shawn has joined #ocaml
bebui has joined #ocaml
seafood has joined #ocaml
cypher23 has joined #ocaml
Ugarte has joined #ocaml
flux__ has joined #ocaml
zmdkrbou has joined #ocaml
Norgg has joined #ocaml
haelix has joined #ocaml
pingu has joined #ocaml
Shimei has joined #ocaml
gim has joined #ocaml
ozzloy has joined #ocaml
seafood_ has joined #ocaml
tsuyoshi has joined #ocaml
Hadaka has joined #ocaml
fremo has joined #ocaml
l_a_m has joined #ocaml
mellum has joined #ocaml
mattam has joined #ocaml
<tsuyoshi>
has anyone here used ocaml with scgi or fastcgi?
<jacobian>
I'd like to know as well
<jacobian>
After my awesome success replacing a python app last week with ocaml, I've started wondering what else I can get rid of :)
<tsuyoshi>
all the ruby people seem to use this lighttpd with fastcgi
<tsuyoshi>
but I am not liking lighttpd.. it seems poorly written
<tsuyoshi>
I am thinking of plugging scgi support into thttpd