adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.02.2 announced http://ocaml.org/releases/4.02.html | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
jeffmo has quit [Quit: jeffmo]
ygrek has quit [Remote host closed the connection]
ygrek has joined #ocaml
jwatzman|work has quit [Quit: jwatzman|work]
ollehar has joined #ocaml
sailorswift has joined #ocaml
toomuchtvrotsurb has quit [Remote host closed the connection]
sailorswift has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jeffmo has joined #ocaml
jonludlam has quit [Ping timeout: 244 seconds]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
tennix has joined #ocaml
Algebr` has quit [Remote host closed the connection]
swgillespie has joined #ocaml
ygrek_ has joined #ocaml
paddymahoney has quit [Ping timeout: 244 seconds]
f[x] has joined #ocaml
ygrek has quit [Ping timeout: 252 seconds]
ygrek_ has quit [Ping timeout: 246 seconds]
jao has quit [Ping timeout: 264 seconds]
ollehar has quit [Remote host closed the connection]
<nullcatxxx_> how to print out utf-8 string in OCaml?
<nullcatxxx_> well.. nvm
linman16 has left #ocaml ["Leaving"]
sailorswift has joined #ocaml
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nullcatxxx_ has joined #ocaml
nullcatxxx_ has quit [Client Quit]
nullcatxxx_ has joined #ocaml
nullcatxxx_ has quit [Client Quit]
nullcatxxx_ has joined #ocaml
nullcatxxx_ has quit [Client Quit]
mea-culp` has joined #ocaml
malc_ has quit [Ping timeout: 246 seconds]
mea-culpa has quit [Ping timeout: 244 seconds]
malc_ has joined #ocaml
monoprotic has quit []
f[x] has quit [Ping timeout: 246 seconds]
tmtwd has quit [Ping timeout: 244 seconds]
sailorswift has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
igoroliveira has quit [Quit: Connection closed for inactivity]
tennix has quit [Ping timeout: 272 seconds]
tennix has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
darkf has joined #ocaml
divyanshu has joined #ocaml
kushal has quit [Quit: Leaving]
meteo has joined #ocaml
mcclurmc has joined #ocaml
jeffmo has quit [Quit: jeffmo]
jeffmo has joined #ocaml
teiresias has joined #ocaml
claudiuc has quit [Ping timeout: 240 seconds]
samrat has joined #ocaml
swgillespie has joined #ocaml
kushal has joined #ocaml
Bhavya has joined #ocaml
Algebr has joined #ocaml
jeffmo has quit [Quit: jeffmo]
MercurialAlchemi has joined #ocaml
<Algebr> I am trying to install libevent and I have the system dependency, but I get this error # event_stubs.c:16:10: fatal error: 'caml/mlvalues.h' file not found. Which is strange because everything else is correct.
<Algebr> Can I pass opam extra arguments?
malc_ has quit [Quit: leaving]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
shinnya has quit [Ping timeout: 265 seconds]
<Algebr> Drup: things like the IO from Pervasives, they just don't work with jsoo right?
<Drup> Algebr: depends which one
<Drup> opening files doesn't work, since it doesn't make sense in the browser
mcclurmc has quit [Remote host closed the connection]
MercurialAlchemi has quit [Ping timeout: 240 seconds]
<Algebr> Yea, I see its a no op, but I wonder why it doesn't just not compile
<Algebr> Drup: on the docs, there's this: jsnew constr (e1, ..., en) : u but jsnew isn't a syntax extension right?
<Algebr> I want to make an instance of the fileReader js object
<Drup> yes, it's a syntax extension
<Algebr> merlin stupidity understands the jsoo syntax extensions for like 3 seconds after I tell it to use js_of_ocaml.syntax, then its as if it forgets and stops understanding the syntax.
ggole has joined #ocaml
tmtwd has joined #ocaml
Algebr has quit [Ping timeout: 260 seconds]
kushal has quit [Quit: Leaving]
Algebr has joined #ocaml
tmtwd has quit [Ping timeout: 252 seconds]
MercurialAlchemi has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 260 seconds]
divyanshu has quit [Quit: Computer has gone to sleep.]
Algebr has quit [Remote host closed the connection]
chris2 has quit [Ping timeout: 244 seconds]
Kakadu has joined #ocaml
divyanshu has joined #ocaml
tmtwd has joined #ocaml
divyanshu has quit [Client Quit]
TheLemonMan has joined #ocaml
tmtwd has quit [Ping timeout: 240 seconds]
BitPuffin|osx has quit [Ping timeout: 240 seconds]
jonludlam has joined #ocaml
Haudegen has quit [Ping timeout: 244 seconds]
jonludlam has quit [Ping timeout: 255 seconds]
Haudegen has joined #ocaml
yomimono has joined #ocaml
sh0t has joined #ocaml
jonludlam has joined #ocaml
samrat has quit [Ping timeout: 272 seconds]
yomimono has quit [Ping timeout: 252 seconds]
Kakadu has quit [Remote host closed the connection]
lordkryss has joined #ocaml
ollehar has joined #ocaml
yomimono has joined #ocaml
chris2 has joined #ocaml
yomimono has quit [Ping timeout: 246 seconds]
yomimono has joined #ocaml
rand000 has joined #ocaml
sailorswift has joined #ocaml
yomimono has quit [Ping timeout: 255 seconds]
sailorswift has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Haudegen has quit [Ping timeout: 246 seconds]
Haudegen has joined #ocaml
samrat has joined #ocaml
yomimono has joined #ocaml
lobo has joined #ocaml
ollehar has quit [Ping timeout: 252 seconds]
yomimono has quit [Ping timeout: 256 seconds]
yomimono has joined #ocaml
nullcatxxx_ has joined #ocaml
lordkryss has quit [Quit: Connection closed for inactivity]
ollehar has joined #ocaml
sailorswift has joined #ocaml
ollehar has quit [Ping timeout: 272 seconds]
grouzen has joined #ocaml
nicoo has joined #ocaml
Bhavya has quit [Quit: Quit the channel]
lordkryss has joined #ocaml
jeffmo has joined #ocaml
sp0on has joined #ocaml
kolko has quit [Ping timeout: 244 seconds]
sailorswift has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nullcatxxx_ has joined #ocaml
nullcatxxx_ has quit [Client Quit]
xet7 has joined #ocaml
badkins has joined #ocaml
igoroliveira has joined #ocaml
rand000 has quit [Ping timeout: 240 seconds]
divyanshu has joined #ocaml
BitPuffin|osx has joined #ocaml
sp0on has quit [Ping timeout: 252 seconds]
ousado has quit [Read error: Connection reset by peer]
ousado has joined #ocaml
sp0on has joined #ocaml
tmtwd has joined #ocaml
ousado has quit [Changing host]
ousado has joined #ocaml
sailorswift has joined #ocaml
mort___ has joined #ocaml
BitPuffin|osx has quit [Ping timeout: 264 seconds]
sh0t has quit [Ping timeout: 240 seconds]
sailorswift has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sh0t has joined #ocaml
sailorswift has joined #ocaml
sh0t has quit [Ping timeout: 244 seconds]
tmtwd has quit [Ping timeout: 246 seconds]
tmtwd has joined #ocaml
AlexRussia has joined #ocaml
xet7_ has joined #ocaml
GeorgeHahn has joined #ocaml
xet7 has quit [Ping timeout: 272 seconds]
native_killer has joined #ocaml
xet7_ has quit [Remote host closed the connection]
xet7_ has joined #ocaml
The_Mad_Pirate has joined #ocaml
mort___ has quit [Quit: Leaving.]
ygrek has joined #ocaml
divyanshu has quit [Quit: Computer has gone to sleep.]
xet7_ has quit [Read error: Connection reset by peer]
xet7_ has joined #ocaml
<mrvn> I have a problem with ExtUnix: + /usr/bin/ocamlfind ocamlc -c -g -package bigarray -package extunix -I lib -o lib/Msg.cmo lib/Msg.ml
<mrvn> Error: Internal path ExtUnixSpecific is dangling. The compiled interface for module ExtUnixSpecific was not found.
<mrvn> What causes that?
ygrek has quit [Ping timeout: 260 seconds]
darkf has quit [Quit: Leaving]
xet7_ has quit [Read error: Connection reset by peer]
xet7_ has joined #ocaml
igoroliveira has quit [Quit: Connection closed for inactivity]
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
xet7_ has quit [Read error: Connection reset by peer]
xet7_ has joined #ocaml
xet7_ is now known as xet7
nullcatxxx_ has joined #ocaml
divyanshu has joined #ocaml
xet7_ has joined #ocaml
jprakash has joined #ocaml
xet7 has quit [Ping timeout: 256 seconds]
sailorswift has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sh0t has joined #ocaml
nullcatx_ has joined #ocaml
nullcatxxx_ has quit [Read error: Connection reset by peer]
tennix has quit [Ping timeout: 246 seconds]
yomimono has quit [Ping timeout: 265 seconds]
swgillespie has joined #ocaml
QuanticPotato has joined #ocaml
kolko has joined #ocaml
sgnb has quit [Ping timeout: 244 seconds]
sgnb` has joined #ocaml
mcclurmc has joined #ocaml
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
QuanticPotato has quit [Ping timeout: 250 seconds]
Haudegen has quit [Ping timeout: 246 seconds]
ollehar has joined #ocaml
jprakash has quit [Ping timeout: 244 seconds]
Haudegen has joined #ocaml
swgillespie has joined #ocaml
Algebr has joined #ocaml
<Algebr> Strange situation. I just started a new project, made _oasis file, run oasis setup -setup-update dynamic, this usually creates a makefile but this time isn't creating a makefile.
<mrvn> configure
<Algebr> i also did ocaml setup.ml -configure
<Algebr> still no make file
<mrvn> or no -setup-update dynamic
<Algebr> still no makefile
<mrvn> any errors?
<Algebr> no errors either.
<Algebr> this is 0.4.5, now going to downgrade to 0.4.4
<Algebr> opam feature request, show me when the upgrade of a package occured.
<Drup> Algebr: you forgot the DevFiles extension
<Algebr> Added it, still no makefile.
<mrvn> paste your file
ygrek has joined #ocaml
<Algebr> (ignore the bar/foo, just changed it for this pastebin)
<mrvn> Plugins: DevFiles (0.3), META (0.3)
<mrvn> note the ","
<Algebr> ......
<Algebr> that worked
<Algebr> What the hell man.
<mrvn> that should realy give a syntax error
ygrek has quit [Ping timeout: 250 seconds]
ollehar has quit [Ping timeout: 246 seconds]
<mrvn> *shiver* Evil code: let target = Obj.magic 3 in if sock_child != target then begin Unix.dup2 sock_child (Obj.magic 3); Unix.close sock_child; end;
<Algebr> What does that do
<mrvn> moves a file descriptor to use descriptor 3
malc_ has joined #ocaml
<mrvn> Slightly better: let fd = Obj.magic 3 in Unix.dup2 sock_child fd; Unix.set_close_on_exec sock_child; Unix.clear_close_on_exec fd;
<malc_> mrvn: wouldn't work on windows
Kakadu has joined #ocaml
<mrvn> malc_: yeah. don't care. :)
<malc_> mrvn: good!
<mrvn> Does Unix.execve even work on windows?
<mrvn> or Unix.fork?
<malc_> under cygwin version - yes
<Algebr> What are the things one ought to put in gitignore that are related to oasis files
<mrvn> Algebr: everything you didn't create yourself
Haudegen has quit [Ping timeout: 244 seconds]
Hannibal_Smith has joined #ocaml
<Algebr> Interesting that it keeps _tags, configure, myocamlbuild.ml, setup.ml
<mrvn> Algebr: you can put custom stuff in there that oasis won't overwrite
<mrvn> If I have sockets from Unix.socketpair() and I close one of the endpoints shouldn't Unix.select [other_endpoint] ... return and Unix.recv other_endpoint ... return 0?
Haudegen has joined #ocaml
<malc_> mrvn: you'll need shutdown for that i think
<mrvn> shutdown is a special way to close only a certain direction. close should close both directions.
<mrvn> I don't see the socket lingering in /proc/pid/fd/ anymore except for the pid that is stuck in select.
_whitelogger has joined #ocaml
jonludlam has quit [Ping timeout: 244 seconds]
jprakash has joined #ocaml
ygrek has joined #ocaml
<malc_> mrvn: erm.. really try to put a shutdown before closing
<malc_> not instead of
<malc_> in addition to
<mrvn> same problem with shutdown. Except when I shutdown the first endpoint in child after fork() the child gets: Fatal error: exception Unix.Unix_error(Unix.ECONNREFUSED, "write", "")
<malc_> man shutdown
<malc_> erm.. sorry
<malc_> man shutdown
<malc_> fsck
sh0t has quit [Ping timeout: 260 seconds]
<mrvn> man 2 shutdown even
native_killer has quit [Ping timeout: 255 seconds]
<malc_> yes yes
QuanticPotato has joined #ocaml
tennix has joined #ocaml
<malc_> mrvn: do you have small repro case?
ygrek has quit [Ping timeout: 250 seconds]
zpe has joined #ocaml
<mrvn> no. but this is how I fork the other process that hangs in select: https://gist.github.com/mrvn/870eef7fc6b4fc54862b
samrat has quit [Ping timeout: 240 seconds]
Algebr has quit [Ping timeout: 265 seconds]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
samrat has joined #ocaml
<malc_> mrvn: well.. as per exn someone is writing to the socket.. why?
<mrvn> huh?
<malc_> Unix.ECONNREFUSED, "write", "")
<mrvn> malc_: That's when I shutdown the socket inside the fork.
<malc_> mrvn: nope.. shutdown exn would have listed "shutdown" as the second exception argument
<malc_> not write
<malc_> if (shutdown(Int_val(sock), shutdown_command_table[Int_val(cmd)]) == -1) uerror("shutdown", Nothing);
<malc_> from otherlibs/shutdown/shutdown.c
<mrvn> When I shutdown the parent socket after fork then the kernel can't write to the child socket anymore because it's shutdown.
xet7_ is now known as xet7
<malc_> mrvn: you shut it down from the side that wants to initiate exit from select on the other side, if that makes sense
<mrvn> malc_: that's what it does now (as pasted). The parent calls destroy and the child (kernel) is supposed to come out of the select.
<malc_> mrvn: exception you citied clearly indicates that it's write that's throwing
<mrvn> malc_: that exception only comes when I shutdown the parent socket right after the fork. (not in the paste).
Algebr has joined #ocaml
<mrvn> then the kernel doesn't even get to the select
<malc_> mrvn: i'm a bit confused here... the only way that exception could happen if someone called unix_write (the C function in write.c)
<mrvn> malc_: the kernel does that
<mrvn> On startup it sends a "Hello" message and then goes into a select loop waiting for commands.
<malc_> mrvn: strace the thing, to clear things up, what happens when etc
divyanshu has quit [Quit: Computer has gone to sleep.]
<mrvn> malc_: Lines 167+170 show the parent shutting down the socket and line 182 is where the child is stuck.
vishesh has joined #ocaml
<malc_> mrvn: is it just me or your choice of 3 wasn't a particularly good one
<malc_> try something else
<mrvn> Same with 13: http://paste.debian.net/288230/
<mrvn> And the FDs for parent/child look OK to me: http://paste.debian.net/288231/
<mrvn> Added strace logs to the gist: https://gist.github.com/mrvn/870eef7fc6b4fc54862b
Algebr has quit [Remote host closed the connection]
<mrvn> malc_: here is a small (9 lines) testcase: https://gist.github.com/mrvn/d1bb352a0b32cbfeee4a
<malc_> mrvn: looking
<mrvn> Line 57 is the first interesting one in the strace
<mrvn> Back in 10m. Have to buy some milk before the shops close.
divyanshu has joined #ocaml
ggole has quit [Ping timeout: 255 seconds]
divyanshu has quit [Client Quit]
ollehar has joined #ocaml
zpe has quit [Remote host closed the connection]
divyanshu has joined #ocaml
swgillespie has joined #ocaml
QuanticPotato has quit [Quit: Leaving]
divyanshu has quit [Quit: Textual IRC Client: www.textualapp.com]
samrat has quit [Ping timeout: 256 seconds]
<mrvn> re
<mrvn> malc_: any idea that what I could try?
<malc_> mrvn: an observation: things do work with sock_stream even without shutdown..
<mrvn> as they should
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
BitPuffin|osx has joined #ocaml
samrat has joined #ocaml
<malc_> mrvn: let _ = Unix.send sock1 "" 0 0 [] insead of shutdown did the trick for me...
<mrvn> that sends a 0 byte datagram
<malc_> i suppose it does
GeorgeHahn has quit [Ping timeout: 240 seconds]
jprakash has quit [Ping timeout: 272 seconds]
jprakash has joined #ocaml
AlexRussia has quit [Ping timeout: 260 seconds]
nullcatxxx_ has joined #ocaml
jprakash has quit [Ping timeout: 252 seconds]
nullcatx_ has quit [Ping timeout: 265 seconds]
Nahra has joined #ocaml
GeorgeHahn has joined #ocaml
shinnya has joined #ocaml
badkins has quit []
Algebr has joined #ocaml
<Algebr> Drup: How do you cast a generic element from Dom_html.getElementById to like canvasElement?
jeffmo has quit [Quit: jeffmo]
<Algebr> Dom_html.getElementById "canvas" :> Dom_html.canvasElement doesn't work.
<Algebr>
<Algebr> maybe there is a downcast function somewhere
<Drup> Js.coerce
<Algebr> Oh I just found Dom_html.CoerceTo as well
samrat has quit [Ping timeout: 272 seconds]
nullcatx_ has joined #ocaml
nullcatxxx_ has quit [Ping timeout: 240 seconds]
Hannibal_Smith has quit [Quit: Leaving]
<mrvn> Back to the SOCK_DGRAM + select problem. DGRAM is always connectionless and only connection oriented sockets get an EOF. So SOCK_SEQPACKET needs to be used.
lordkryss has quit [Quit: Connection closed for inactivity]
grouzen has quit [Ping timeout: 240 seconds]
<malc_> mrvn: goodie.. it's not limited to select btw. read would also block
native_killer has joined #ocaml
<Algebr> Drup: the dom_html api is missing the navigator.getUserMedia. In cases like that I assume you're supposed to use Js.Unsafe.get/global?
<Drup> Algebr: read the bit about FFI
<Algebr> guessing you mean this one https://ocsigen.org/js_of_ocaml/2.5/manual/bindings
native_killer has quit [Ping timeout: 255 seconds]
<Drup> yes
jao has joined #ocaml
ollehar has quit [Ping timeout: 256 seconds]
jprakash has joined #ocaml
<Algebr> Drup: I want to create this JS object literal, {video:true, audio:true}. Is the jsoo equivalent indeed just Js.Unsafe.obj [|("video", Js.Unsafe.inject true); ("audio", Js.Unsafe.inject true)|]?
<Algebr> Or can I get there faster with just js_expr "{video:true; audio:true}";;
kakadu has quit [Remote host closed the connection]
<Drup> jsobject var video = true var audio = true end
<Drup> It was added when I added the ppx, it's documented in the ppx but apparently not in the camlp4 extension :/
<Algebr> how do you pick ppx or camlp4?
<Drup> js_of_ocaml.ppx
<Drup> (or .syntax)
<Algebr> Also, how do you even go about debugging this? I have this snippet, http://pastebin.com/7mzdxXwi which should work but nothing happens, no exceptions either
<Drup> that ... has not chance to ever work
<Algebr> why
<Drup> you don't bind methods that way
<Drup> method are not first class functions, you can't do foo##bar to get a function
<Algebr> So it needs to be all one line?
<Drup> that, and I'm not sure passing closures is going to work well
sp0on has quit [Ping timeout: 246 seconds]
<Algebr> okay...so why no exceptions or errors
<Drup> because you are using unsafe operations and violating the compiler assumptions ?
<Algebr> I meant at runtime
<Drup> it's generate the code that it assumes to be correct, but it's not, because you are using the Unsafe module wrong
<Algebr> What is the correct way?
<Drup> I don't know the API, haven't looked at it, so don't know
<Algebr> You were right, it needed to be one line and it did accept the anon funcs.
<Algebr> Why aren't methods first class I wonder.
<Drup> because they are not in javascript .. :)
<Algebr> what? I thought they were
<Algebr> a = {"hello":function (d){return 1}}, b = a.hello, b() -> 1 works fine
jprakash has quit [Ping timeout: 255 seconds]
<Drup> that's a variable that is a function
malc_ has quit [Quit: leaving]
mea-culp` has quit [Remote host closed the connection]
mea-culpa has joined #ocaml
madroach has quit [Ping timeout: 264 seconds]
madroach has joined #ocaml
jprakash has joined #ocaml
jprakash has quit [Ping timeout: 246 seconds]
<Algebr> Drup: jsoo is so awesome.