00:25
Kinners has joined #ocaml
00:27
mattam has quit ["zZz"]
01:55
docelic has left #ocaml []
02:58
steele has joined #ocaml
02:59
rox is now known as rox|verdamte
03:08
Kinners has left #ocaml []
03:23
provid has joined #ocaml
03:25
lament has quit ["Did you know that God's name is ERIS, and that He is a girl?"]
03:55
skylan has quit [Read error: 104 (Connection reset by peer)]
03:56
skylan has joined #ocaml
04:10
steele_ has joined #ocaml
04:10
steele has quit [Read error: 104 (Connection reset by peer)]
04:39
provid has quit ["Client exiting"]
05:06
steele_ has quit [Remote closed the connection]
05:36
lyn has joined #ocaml
07:20
skylan has quit [Killed (NickServ (Ghost: skylan_!sjh@207.164.213.47))]
07:21
skylan has joined #ocaml
07:48
mattam has joined #ocaml
08:25
smkl has quit [Read error: 104 (Connection reset by peer)]
08:25
smklsmkl has joined #ocaml
08:57
xmkl has joined #ocaml
08:58
smklsmkl has quit [Read error: 54 (Connection reset by peer)]
09:46
rox|verdamte is now known as rox
10:42
Torquemada has quit [Remote closed the connection]
11:27
xmkl is now known as smkl
12:27
rox is now known as rox|peaceprotest
12:35
steele has joined #ocaml
13:06
esabb has joined #ocaml
13:54
mattam_ has joined #ocaml
14:10
mattam has quit [Read error: 110 (Connection timed out)]
14:14
<
mrvn >
moin. Anyone awake?
14:15
<
mrvn >
Well, when you guys wake up could yu try the following:
14:15
<
mrvn >
mrvn@dual:~% cat foo.ml
14:15
<
mrvn >
let _ = Unix.sleep 10 (* sleep 10 seconds *)
14:15
<
mrvn >
let _ = Graphics.open_graph " 100x100" (* open window *)
14:15
<
mrvn >
let _ = Unix.sleep 600 (* should sleep 10 minutes but doesn't *)
14:15
<
mrvn >
mrvn@dual:~% ocamlc -o foo unix.cma graphics.cma foo.ml
14:15
<
mrvn >
mrvn@dual:~% ./foo
14:19
<
mrvn >
64 bytes from 192.168.0.5: icmp_seq=0 ttl=64 time=1.2 ms
14:19
<
mrvn >
64 bytes from 192.168.0.5: icmp_seq=1 ttl=64 time=0.9 ms
14:19
<
mrvn >
64 bytes from 192.168.0.5: icmp_seq=2 ttl=64 time=0.9 ms
14:20
<
mrvn >
Ahh, someone awake.
14:20
<
mrvn >
Does the second sleep work for you?
14:22
<
karryall >
it doesn't
14:22
<
steele >
mrvn: returns immediately
14:23
<
karryall >
same thing with ocamlopt
14:24
<
karryall >
hum I see on the sleep(3) manpage:
14:25
<
karryall >
sleep() may be implemented using SIGALRM; mixing calls to alarm() and sleep() is a bad idea.
14:25
<
karryall >
maybe that's the problem
14:26
<
mrvn >
Or the graphics generates signals and the sleep doesn't go back to sleep after a graphics signal.
14:27
<
mrvn >
Time to report a bug.
14:27
<
karryall >
if think it has already been reported
14:29
<
karryall >
indeed, Unix.select also fails with a "Interrupted system call"
14:30
<
karryall >
Xavier posted once a solution about this:
14:31
<
mrvn >
Args. can't he write english?
14:32
<
mrvn >
Doesn't select return the number of seconds passed since sleeping somewhere?
14:32
<
karryall >
hum, no it just returns with an error (raises Unix_error)
14:33
<
mrvn >
The C sleep returns the number of seconds still to be slept but ocaml doesn't.
14:34
<
karryall >
I think that's not standard
14:34
<
karryall >
ie linux-specific
14:35
<
mrvn >
CONFORMING TO
14:36
<
mrvn >
In C some people write "unsigned int t = 60; while((t = sleep(t)) != 0);
14:40
<
karryall >
On Linux, the function select modifies timeout to reflect
14:40
<
karryall >
the amount of time not slept; most other implementations
14:40
<
karryall >
do not do this.
14:40
<
karryall >
Consider timeout to be undefined after select
14:40
<
karryall >
returns.
14:40
<
karryall >
(from select manpage)
14:41
<
mrvn >
Yes, select is tricky there.
14:41
<
karryall >
ar, you were speaking of sleep
14:41
<
karryall >
not select
14:42
<
karryall >
indeed Unix.sleep could return that
14:43
<
mrvn >
Should be two sleeps. One that returns int and gets interrupted and one that returns unit and handles signals internally.
14:43
<
mrvn >
sleep and deep_sleep or something
14:45
sproctor has joined #ocaml
14:54
<
karryall >
Xavier said there would be a Unix.really_sleep
14:55
<
mrvn >
not yet it seems but my ocaml is a few weeks old
15:38
Dalroth has joined #ocaml
15:44
sproctor has left #ocaml []
16:15
<
karryall >
mrvn: I have a quick fix for this Unix.sleep/select and Graphics problem
16:20
<
mrvn >
You check the time with gettimeofday and sleep again?
16:21
<
karryall >
no, in the source of Graphics there's another mecanism, not using signals but async IO
16:21
<
karryall >
it works on BSD
16:22
<
karryall >
it should work on linux too, the autoconfiguration test fails
16:22
<
karryall >
(it shouldn't)
16:22
<
karryall >
so you just have to add a line in config/s.h
16:23
<
karryall >
#define HAS_ASYNC_IO
16:23
<
karryall >
and recompile the graphics library
16:23
<
karryall >
then Graphics won't mess with the signals anymore !
16:24
<
mrvn >
Is there a way to get a signal when the size of the window changes?
16:27
<
karryall >
I don't think so
16:28
<
mrvn >
Was ich auch immer komisch finde ist wieviele files bei 99.9% nochmal haengenbleiben.
16:30
<
mrvn >
What does the test for async io look like?
16:30
<
karryall >
it's a C program
16:30
<
karryall >
but it tests the async io on a pipe and this fails on linux
16:31
<
mrvn >
if test -z `grep "OTHERLIBRARIES.*labltk" config/Makefile`; then\
16:31
<
mrvn >
echo "Error, labltk library was not built"; \
16:31
<
mrvn >
echo "Check your tcl/tk development packages"; \
16:31
<
mrvn >
echo "Aborting."; \
16:31
<
mrvn >
/bin/sh: line 1: test: too many arguments
16:31
<
mrvn >
Did you get that during configure/compile?
16:31
<
karryall >
hum, no are you using CVS ? I used ocaml-3.06
16:32
<
mrvn >
No, debian sources
16:46
<
mrvn >
What should the async_io test actually do?
16:46
<
mrvn >
It writes something to the pipe and the father should get a signal then?
16:50
<
karryall >
but linux doesn't support async io on pipes seeminlgy
16:50
<
karryall >
it works fine if you use a socketpair instead of a pipe
16:50
<
karryall >
and X11 uses sockets for communication anyway
16:51
lindril has quit ["Client Exiting"]
17:00
<
mrvn >
Doesn't just setting async_io break some io calls when using pipes if that doesn#t work under linux?
17:02
<
karryall >
HAS_ASYNC_IO is only used here (in Graphics) I think
17:04
<
mrvn >
Urgs, ocaml generates lots of warnings during compile. ugly.
17:22
<
mrvn >
Is there something like break or continue in C for ocaml (for for loops)?
17:22
<
whee >
doubt it, they probably want you to use exceptions
17:24
mattam_ is now known as mattam
17:25
budweiserbg has joined #ocaml
17:26
<
karryall >
Pervasives defines an Exit exception that I use for this
17:26
budweiserbg has left #ocaml []
17:48
karryall has quit ["Vacances !"]
18:03
asqui has quit [K-lined]
18:04
systems has joined #ocaml
18:04
systems has left #ocaml []
18:09
asqui has joined #ocaml
18:28
polin8 has quit [Read error: 104 (Connection reset by peer)]
18:43
polin8 has joined #ocaml
18:46
skylan has quit [Read error: 104 (Connection reset by peer)]
18:47
lament has joined #ocaml
18:55
skylan has joined #ocaml
18:55
rox|peaceprotest has quit ["Client Exiting"]
19:21
polin8_ has joined #ocaml
19:21
polin8_ has quit [Client Quit]
19:37
<
mrvn >
How do I make a reference to self in a class?
19:38
<
mrvn >
class root = object(self) val r = ref self end;;
19:38
<
mrvn >
The instance variable self
19:38
<
mrvn >
cannot be accessed from the definition of another instance variable
19:44
<
mrvn >
Segora: udp und tcp?
20:24
Dalroth has quit []
21:17
esabb has quit [Remote closed the connection]
21:35
intero has joined #ocaml
21:36
<
intero >
if you guys should spend 200 hours on a project about linux, what would it be?
21:43
<
steele >
kernel or userland?
21:43
<
intero >
well i am not a kernel hacker if i think i can do it...
21:43
<
intero >
try telling
21:43
<
intero >
both choices :P
21:44
<
steele >
i don't have any idea (yet) =)
21:45
<
intero >
you are not the first who suggest that option :P
21:47
lament has quit ["Did you know that God's name is ERIS, and that He is a girl?"]
22:02
systems has joined #ocaml
22:06
<
mrvn >
intero: You coul write some essential services for linux in ocaml
22:06
<
intero >
mrvn: like?
22:06
<
mrvn >
Like a dns proxy/server, ftp client/server/proxy, http proxy
22:06
<
intero >
my ocaml teacher would love me
22:06
<
mrvn >
dns would be most welcome.
22:07
<
intero >
anything ai related? i dont like nets much
22:07
<
mrvn >
You near linux does it have to be? Could you implement a MUD in ocaml under linux?
22:08
* steele
wonders what class that is
22:08
<
intero >
near linux just coz i'd like it to be useful for something after, but it's not a must
22:08
<
intero >
mrvn: what is a mud? ;)
22:08
<
mrvn >
Multi User Dungeon
22:08
<
intero >
steele: something you have to do here in italy to get first level bachelor (?). like a thesis, but it's a 200 hrs project
22:09
<
mrvn >
You have a server and people log on to it and sove small puzzles or games.
22:09
<
intero >
real-time text-based internet role playing game
22:09
<
mrvn >
with computer driven characters that interact with the players as well.
22:10
<
intero >
mrvn: you know me, i suck in ocaml, are you sure i could do that?
22:11
<
mrvn >
In ocaml its pretty easy to do because you have continuations.
22:11
<
intero >
continuations?
22:11
<
intero >
is it really easy?
22:12
<
intero >
i mean i know the basics of c/c++ and nothing else. a few ocaml but the hardest thing i did is a search in a graph
22:13
<
mrvn >
Maybe a IPv4/IPv6 translator library that makes it possible to use a programm supporting one of them on the other.
22:13
<
mrvn >
That would be down to earth C but quite some network stuff.
22:15
<
intero >
steele: thanks, of course i didnt know :P
22:15
<
mrvn >
Or a Peer2Peer system for small communities (your 5-100 friends) with RSA authentication and Forward Error Correction for transmissions.
22:15
<
mrvn >
With electronic cash and such.
22:16
<
intero >
mrvn: anything not net related?
22:17
<
mrvn >
I would love to have a electronic cash system where every user can print money, users can exchange money, users can barter money (one users money for another users money) and check the credibility of money.
22:17
<
mrvn >
That would be a bit nt and a lot of cryptographie.
22:17
<
intero >
btw is the continuation always a function or theres no restriction?
22:18
<
mrvn >
intero: Sincevalues can't be computed but are just thereit must be a function.
22:18
<
mrvn >
If a continuation would be a plain value it would have already been computed so it has nothing to continue.
22:19
<
intero >
ocaml really seems to kick ass
22:19
<
mrvn >
But of cause you can have a continuation function () -> 17
22:19
<
mrvn >
intero: With continuations you can realy easy simulate multitasking without all the kernel overhead.
22:20
<
mrvn >
Or do callbacks.
22:21
<
intero >
you see mrvn
22:21
<
intero >
university here
22:21
<
intero >
is so teorical
22:21
<
nkoza >
ocaml has continuations?
22:21
<
intero >
i really know nothing about it all
22:21
<
intero >
it sucks :(
22:22
<
mrvn >
nkoza: let cont = function () -> print_string "it coninues here"; something_else ()
22:22
<
mrvn >
nkoza: cont can be considered a continuation.
22:39
systems has quit [Read error: 110 (Connection timed out)]
22:51
<
intero >
night guys
22:51
<
intero >
thanks for the hints
22:51
<
intero >
i'll let you know
22:52
<
intero >
bye for now
22:52
intero has left #ocaml []
23:06
gene9 has joined #ocaml
23:06
gene9 has quit [Client Quit]
23:32
asqui has quit ["Now I am gone..."]
23:37
asqui has joined #ocaml
23:42
asqui has quit [Read error: 104 (Connection reset by peer)]
23:44
mrvn_ has joined #ocaml
23:47
lindril has joined #ocaml
23:51
mrvn has quit [Read error: 60 (Operation timed out)]