<smondet>
Algebr: I ended up with some ugly hacks to make sure Lwt_daemon is really the first thing called, not pretty.
<Algebr>
this is ridiculous, could you not find the root cause of problem.
<Algebr>
should have an lwt hackathon, like the compiler hackathons
<smondet>
also, it's interesting how a lot of feedback was "don't daemonize" :)
<smondet>
the root of the problem must some global variables used by Lwt I guess, maybe even in C code
<Algebr>
So there's an idea of how to fix it but no one is taking up the task i take it
Emmanuel`_ has quit [Quit: Konversation terminated!]
Emmanuel`_ has joined #ocaml
yunxing has quit [Remote host closed the connection]
yunxing has joined #ocaml
badon has joined #ocaml
ollehar has quit [Quit: ollehar]
yunxing has quit [Ping timeout: 250 seconds]
ygrek_ has joined #ocaml
ygrek has quit [Ping timeout: 250 seconds]
thegameg has quit [Ping timeout: 260 seconds]
thegameg has joined #ocaml
Emmanuel`_ has quit [Quit: Konversation terminated!]
Emmanuel`_ has joined #ocaml
manizzle has quit [Ping timeout: 276 seconds]
sh0t has joined #ocaml
Emmanuel`_ has quit [Quit: Konversation terminated!]
Emmanuel`_ has joined #ocaml
jeffmo_ has quit [Quit: jeffmo_]
tennix has quit [Ping timeout: 248 seconds]
newbie has quit [Ping timeout: 244 seconds]
tennix has joined #ocaml
dsheets has joined #ocaml
dsheets has quit [Ping timeout: 244 seconds]
Algebr` has joined #ocaml
tennix has quit [Ping timeout: 250 seconds]
Emmanuel`_ has quit [Quit: Konversation terminated!]
struk|desk|away is now known as struk|desk
Emmanuel`_ has joined #ocaml
yunxing has joined #ocaml
dsheets has joined #ocaml
dsheets has quit [Ping timeout: 260 seconds]
ygrek_ has quit [Ping timeout: 244 seconds]
Haudegen has quit [Ping timeout: 260 seconds]
Haudegen has joined #ocaml
Emmanuel`_ has quit [Quit: Konversation terminated!]
Emmanuel`_ has joined #ocaml
tennix has joined #ocaml
Emmanuel`_ has quit [Quit: Konversation terminated!]
Emmanuel`_ has joined #ocaml
sh0t has quit [Ping timeout: 268 seconds]
struk|desk is now known as struk|desk|away
therac25 has quit [Quit: therac25]
struk|desk|away is now known as struk|desk
teknozulu has joined #ocaml
<teknozulu>
I have a record type, http://pastebin.com/1kg4Uy6b . The compiler sees the variant on the bottom as "([> `Active | `New of 'input list Async.Std.Deferred.t ] as 'a)
<teknozulu>
", and tells me 'a is unbound. What's with this "as 'a" business?
<def`>
your bundler field has a polymorphic type: the variant is open, so it can be instantiated to many different types
<def`>
you have to explicitly bind the corresponding type variable
jeffmo has joined #ocaml
<def`>
put the as '@
<def`>
as 'a
<def`>
and either bind 'a in the declaration of the type
<def`>
type ('a, 'input, 'output) t = ...
<def`>
or in the method:
<def`>
; bundler : 'a . int -> ...
<def`>
last option: make it monomorphic, remove the > in the variant
<teknozulu>
I just wrote out a parametrized sum type for it because I precisely want it to be instantiated to the same 'input
<teknozulu>
thanks
<def`>
That's unrelated
<def`>
using 'input is fine, it is bound earlier soninside the record it is monomorphic
<def`>
the problem is thebopen variant.
<teknozulu>
Oh I see now
yunxing has quit [Remote host closed the connection]
yunxing has joined #ocaml
Emmanuel`_ has quit [Quit: Konversation terminated!]
yunxing has quit [Read error: Connection reset by peer]
Emmanuel`_ has joined #ocaml
seangrove has quit [Ping timeout: 268 seconds]
copy` has quit [Quit: Connection closed for inactivity]
Emmanuel`_ has quit [Quit: Konversation terminated!]
Emmanuel`_ has joined #ocaml
aantron has quit [Remote host closed the connection]
struk|desk has quit [Read error: Connection reset by peer]
nichola__ has joined #ocaml
nicholasf has quit [Ping timeout: 252 seconds]
ygrek_ has joined #ocaml
Emmanuel`_ has quit [Quit: Konversation terminated!]
Emmanuel`_ has joined #ocaml
struk|desk has joined #ocaml
Emmanuel`_ has quit [Quit: Konversation terminated!]
Emmanuel`_ has joined #ocaml
antkong has quit [Quit: antkong]
MercurialAlchemi has joined #ocaml
seangrove has joined #ocaml
Algebr` has quit [Remote host closed the connection]
johnf_ has joined #ocaml
johnf has quit [Ping timeout: 260 seconds]
nichola__ has quit [Read error: Connection reset by peer]
nicholasf has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 252 seconds]
nicholasf has quit [Ping timeout: 276 seconds]
MercurialAlchemi has joined #ocaml
cdidd has quit [Remote host closed the connection]
slicefd has joined #ocaml
struk|desk is now known as struk|desk|away
nicholasf has joined #ocaml
mettekou has joined #ocaml
mettekou has quit [Client Quit]
mettekou has joined #ocaml
ggole has joined #ocaml
Emmanuel`_ has quit [Quit: Konversation terminated!]
Emmanuel`_ has joined #ocaml
Emmanuel`_ has quit [Quit: Konversation terminated!]
Emmanuel`_ has joined #ocaml
nicholasf has quit [Ping timeout: 246 seconds]
nicholasf has joined #ocaml
AlexRussia has quit [Ping timeout: 260 seconds]
nicholasf has quit [Remote host closed the connection]
mettekou has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nicholasf has joined #ocaml
orbifx has quit [Ping timeout: 244 seconds]
therac25 has joined #ocaml
nicholasf has quit [Ping timeout: 264 seconds]
toolslive has quit [Ping timeout: 246 seconds]
kushal has joined #ocaml
butts_butts has joined #ocaml
butts_butts_ has joined #ocaml
butts_butts has quit [Ping timeout: 244 seconds]
Haudegen has quit [Ping timeout: 264 seconds]
toolslive has joined #ocaml
butts_butts_ has quit [Ping timeout: 244 seconds]
nicholasf has joined #ocaml
nicholasf has quit [Client Quit]
therac25 has quit [Quit: therac25]
therac25 has joined #ocaml
silver has joined #ocaml
larhat has joined #ocaml
larhat has quit [Remote host closed the connection]
sgnb has joined #ocaml
Haudegen has joined #ocaml
therac25 has quit [Quit: therac25]
therac25 has joined #ocaml
ygrek_ has quit [Ping timeout: 244 seconds]
mettekou has joined #ocaml
ontologiae has joined #ocaml
malc_ has joined #ocaml
Simn has joined #ocaml
cdidd has joined #ocaml
therac25 has quit [Quit: therac25]
therac25 has joined #ocaml
SIGILL has quit [Quit: update]
Vintila has joined #ocaml
tane has joined #ocaml
SIGILL has joined #ocaml
therac25 has quit [Quit: therac25]
therac25 has joined #ocaml
sepp2k has joined #ocaml
Emmanuel`_ has quit [Quit: Konversation terminated!]
Emmanuel`_ has joined #ocaml
mettekou has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Kakadu has joined #ocaml
therac25 has quit [Quit: therac25]
jwatzman|work has joined #ocaml
malc_ has left #ocaml ["ERC (IRC client for Emacs 25.0.50.2)"]
orbifx has joined #ocaml
ibor has joined #ocaml
pierpa has joined #ocaml
nicholasf has joined #ocaml
nicholasf has quit [Remote host closed the connection]
nicholasf has joined #ocaml
cdidd has quit [Remote host closed the connection]
cdidd has joined #ocaml
Emmanuel`_ has quit [Quit: Konversation terminated!]
Emmanuel`_ has joined #ocaml
darkf has quit [Quit: Leaving]
Emmanuel`_ has quit [Quit: Konversation terminated!]
Emmanuel`_ has joined #ocaml
mau has joined #ocaml
nicholasf has quit [Remote host closed the connection]
<mau>
Hi, is this the right place to ask about ctypes? Specifically, the cstub part
<mrvn>
you can ask
<mau>
I'm not really sure how I should phrase this, I'll try my best
<mau>
I was playing around with Tcl/Tk
<mau>
I tried to get Tk to work, so I produce the C part of the Tk bindings using Cstubs.Types.write_c
<mau>
If I did not add the Tk header (#include <tk.h>), it will compile, but it gives me warnings about implicit declaration of functions due to not adding the header
<mau>
But if I add the tk header,
copy` has joined #ocaml
<mau>
It asked me to include the X11 headers, and when I added that one, I got an error, saying that I had an error, "expected identifier Bool" from ctypes_primitives.h, and then it also points out that the X11 header defined Bool as int
<mau>
So, when I checked the file ctypes_primitives.h, I found out that it was defined as an enum
<mau>
And now, I'm stuck.
_andre has joined #ocaml
Emmanuel`_ has quit [Quit: Konversation terminated!]
Emmanuel`_ has joined #ocaml
kushal has quit [Quit: Leaving]
ibor has quit [Ping timeout: 244 seconds]
mrvn has quit [Ping timeout: 260 seconds]
mrvn has joined #ocaml
slicefd has quit [Quit: WeeChat 1.4]
<Drup>
mau: I think you should report that on the bug tracker
mrvn has quit [Ping timeout: 244 seconds]
mrvn has joined #ocaml
<mau>
Ah damn :(
<mau>
Alright, I'll report that. Thanks.
mrvn has quit [Ping timeout: 260 seconds]
ontologiae has quit [Ping timeout: 248 seconds]
mrvn has joined #ocaml
mrvn has quit [Ping timeout: 248 seconds]
djellemah has quit [Remote host closed the connection]
mrvn has joined #ocaml
mrvn has quit [Ping timeout: 260 seconds]
mrvn has joined #ocaml
mettekou has joined #ocaml
averell has quit [Ping timeout: 268 seconds]
<sgronblo>
I was trying to define a parser type like this: type 'a parser = Parser of (string -> ('a option, string))
<sgronblo>
But I am getting a syntax error
Haudegen has quit [Ping timeout: 250 seconds]
mrvn has quit [Ping timeout: 276 seconds]
mrvn has joined #ocaml
djellemah_ has joined #ocaml
<ggole>
sgronblo: * for tuples, not ,
<sgronblo>
ggole: aaargh, thanks
tobast has joined #ocaml
jeffmo has quit [Quit: jeffmo]
ontologiae has joined #ocaml
djellemah_ has quit [Quit: Leaving]
djellemah has joined #ocaml
averell has joined #ocaml
noddy has joined #ocaml
Haudegen has joined #ocaml
newbie has joined #ocaml
sh0t has joined #ocaml
emias has quit [Ping timeout: 244 seconds]
emias has joined #ocaml
tennix has quit [Ping timeout: 248 seconds]
rossberg has quit [Ping timeout: 264 seconds]
Vintila has quit [Ping timeout: 252 seconds]
kushal has joined #ocaml
AlexRussia has joined #ocaml
rossberg has joined #ocaml
djellemah has quit [Ping timeout: 244 seconds]
<companion_cube>
sgronblo: this sounds incredibly inefficient :)
<flux>
companion_cube, but elegant :(
<companion_cube>
you can do exactly the same with bigarrays
manizzle has joined #ocaml
<companion_cube>
and it would be far less inefficient
<companion_cube>
or by replacing string by `string * int`
aantron has joined #ocaml
th5 has joined #ocaml
jeffmo has joined #ocaml
tennix has joined #ocaml
<ggole>
Yeah. It could work in Haskell because strings are lazy lists of chars, but in OCaml it doesn't really fly.
<Drup>
yes and no. those strings in haskell are horribly inefficient too, and most people use Text or Bytestring ..
noddy has quit [Ping timeout: 260 seconds]
<ggole>
Not as inefficient as parsing a 10MB file by reading the first char and then allocating a 10MB - 1 string to represent the rest of the file, etc.
<companion_cube>
sure
<ggole>
But yes, there are better ways.
<companion_cube>
bigstrings are more efficient for this
<Maelan>
if i understood correctly, Nat is supposed to be internal and we should use Num instead?
<Maelan>
is the overhead neglectible?
BitPuffin has joined #ocaml
<Drup>
You should use non of them and use zarith
struk|desk|away is now known as struk|desk
<Drup>
none*
<Maelan>
between Nat and Num there is also Big_int but since it has no nice operators my guess is that Num is the preferred way again
<Maelan>
but Big_int has sqrt…
<ggole>
Big_int is documented and meant to be used, but you should just use zarith
<Maelan>
Big_int.add_int_big_int
<Maelan>
Drup, ggole, what are the advantages of zarith compared to Big_int?
<pierpa>
zarith is a wrapper around GMP
<Maelan>
performance? i see it is based on GMP. is Big_int only a naive implementation?
<Drup>
It's not "naive", but it's not fast
<Drup>
also, zarith is nicer to use
<Drup>
(nice operators and all that)
<Drup>
(zarith is not simply a wrapper around GMP, it also has a dual representation. It uses normal integers for small ints and gmp integers for big ints)
Emmanuel`_ has quit [Quit: Konversation terminated!]
Emmanuel`_ has joined #ocaml
<Maelan>
oops, opam-installing zarith apparently invites many packages to recompile
<Maelan>
hm nevermind, there were to be recompiled anyway (probably ocamlbuild being externalized)
freehck has quit [Remote host closed the connection]
jeffmo has quit [Quit: jeffmo]
struk|desk is now known as struk|desk|away
MercurialAlchemi has quit [Remote host closed the connection]
struk|desk|away is now known as struk|desk
<seangrove>
What's %! in Printf.printf "%s\n%!"?
<ggole>
flush. Do you have a copy of or a link to the manual?
nicholasf has quit [Remote host closed the connection]
nicholasf has joined #ocaml
d0nn1e has quit [Ping timeout: 260 seconds]
ontologiae has quit [Ping timeout: 264 seconds]
d0nn1e has joined #ocaml
slash^ has joined #ocaml
shinnya has joined #ocaml
Kakadu has quit [Quit: Page closed]
Kakadu has joined #ocaml
yunxing has joined #ocaml
mettekou has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
djellemah has joined #ocaml
johnf has joined #ocaml
johnf_ has quit [Ping timeout: 240 seconds]
johnf_ has joined #ocaml
johnf has quit [Ping timeout: 240 seconds]
<Algebr>
lwt daemonize has caused great great pain to me.
<seangrove>
Algebr: Oh? Can you expand?
mettekou has joined #ocaml
noddy has quit [Ping timeout: 240 seconds]
<Algebr>
causing all kinds of inconsistent crazy behavior, smondet talked about his pains yesterday too and has many github issues about it
<Algebr>
will verify my theory today
<flux>
just use systemd for making daemons!
<Algebr>
yes, I might end up doing that
<Algebr>
systemd is hassle and now have to learn more crap, but I guess more beneficial/correct in the long run
<flux>
no you didn't play this right, you should have been offended :(
<Algebr>
lol
orbifx has quit [Ping timeout: 240 seconds]
shinnya has quit [Ping timeout: 276 seconds]
<flux>
cool, ocaml-systemd -- OCaml module for native access to the systemd facilities
ygrek_ has quit [Ping timeout: 244 seconds]
<mrvn>
Algebr: now rewrite systemd in ocaml please so it is also correct code.
Kakadu has quit [*.net *.split]
<flux>
an init system with proofs to go with it would be pretty awesome
<flux>
sadly such an init would probably be nowhere as featureful as systemd
<companion_cube>
s/sadly/happily/
<flux>
well, if it were just as featureful as sysvinit, we would still remain in the world of sleep-based hacks (just grep -c sleep /etc/init.d/*) that work some time, some time don't ;)
<companion_cube>
meh, tracking dependencies shouldn't be that hard
<companion_cube>
it's all graphs ;)
ggole has quit []
<Algebr>
interesting, ocaml-systemd looks good
sepp2k has quit [Quit: Leaving.]
<Drup>
I'm having a module problem
<Drup>
I have this module which contains only type, and this functor which returns a module that uses those types
<Drup>
and I would like to add, inside the first module (let's call him T) a type which would depend on the functor
mettekou has quit [Read error: Connection reset by peer]
ygrek_ has joined #ocaml
ibor has joined #ocaml
<toolslive>
@Algebr : I also suffered from lwt daemonization. We first had the idea to do daemonization as late as possible, but you need to do it before you do anything else that's lwt related.
<Algebr>
yep, I'm moving it way back now. need to write in all bold on lwt page about this
nicholasf has quit [Remote host closed the connection]
Anarchos has joined #ocaml
djellemah_ has joined #ocaml
Emmanuel`_ has quit [Quit: Konversation terminated!]
Emmanuel`_ has joined #ocaml
tia has quit [Quit: Leaving]
Emmanuel`_ has quit [Quit: Konversation terminated!]
Emmanuel`_ has joined #ocaml
Haudegen has joined #ocaml
yunxing has quit [Remote host closed the connection]
ibor1 has joined #ocaml
slash^ has quit [Ping timeout: 260 seconds]
ibor has quit [Ping timeout: 240 seconds]
<Anarchos>
How to debug an oUnit test failing ?
therac25 has joined #ocaml
sh0t has joined #ocaml
<Algebr>
doesn't it tell you what's failing?
<Anarchos>
it just tells wich test is failing
seangrove has joined #ocaml
<zozozo>
try and reproduce the test in a top-level ?
orbifx has joined #ocaml
seliopou_ has quit [Ping timeout: 260 seconds]
jrslepak has quit [Ping timeout: 260 seconds]
zaltekk has quit [Ping timeout: 260 seconds]
<orbifx>
hello alll
zaltekk has joined #ocaml
jrslepak has joined #ocaml
<Anarchos>
zozozo i would prefer a solution with ocamldebug
seliopou has joined #ocaml
TheLemonMan has joined #ocaml
<Algebr>
ocamldebug would mean compiling for byte code with -g and then running under ocamldebug with a breakpoint
darkf has joined #ocaml
shinnya has joined #ocaml
dwillems has joined #ocaml
rand__ has joined #ocaml
BitPuffin has quit [Ping timeout: 276 seconds]
Emmanuel`_ has quit [Quit: Konversation terminated!]
Emmanuel`_ has joined #ocaml
Bobbejaantje has joined #ocaml
<Bobbejaantje>
Is there a way with compiling like a -dynamic flag to dynamically link against system libraries rather than statically?
<Bobbejaantje>
dynlink seems to be a module which is unusual.
<Algebr>
curious, what's your use-case/issue
<Bobbejaantje>
Algebr, well, I'm learning ocaml by re-implementing more or less daemontools which involves many small supervisor processes in how its architecture is designed which with static linking each seem tot ae 5MB of RAM which is pretty hefty
<Bobbejaantje>
I'm using Core for this which seems to take a lot of RAM, would be great if that could be loaded in a shared library
<Algebr>
ah, the statically linked binary is hefty with core i guess
<Bobbejaantje>
I guess that would be fine if you only had one process.
struk|desk is now known as struk|desk|away
<Bobbejaantje>
But the entire idea of daemontools' architecture is many small processes
<flux>
bobbejaantje, daemontools runs internally many small processes?
<Algebr>
flux: no looks like daemontools is a collections of small utilities
<flux>
ok, so many small programs. well, a practical alternative would be to provide a single multi-call binary, that branches off from the main function to those operations
<flux>
an impractical alternative might be to make Core dynloadable :)
<flux>
(or just not use Core if it's too big)
<Bobbejaantje>
flux, no, they run at the same time.
<flux>
I wonder though if Core really consumes a lot of memory or is it just virtual memory that's mapped from the hdd
<Bobbejaantje>
The way daemontools works is that it spawns a different supervision process for every service it monitors.
<flux>
..which might never be mapped in if some functions are not called
<flux>
bobbejaantje, well, you can use fork to just create a new process, in which case a lot of memory may remain shared with the parent
<flux>
(though due to the way garbage collection works, I have a feeling it might be a good idea to run a major collection before the fork)
<Bobbejaantje>
You can I suppose, but that seems like a hack, daemontools' design clearly wants fork-exec.
<adrien>
mfp's ld.ocaml is awesome but could enjoy some more love
<Bobbejaantje>
Basically there is an svscan process that continually monitors a directory which contains service descriptions, and if a new one appears in it then a new supervise process is started for that directory
<adrien>
s/but/and/
larhat has joined #ocaml
<Bobbejaantje>
So I take it there is no way for OCaml to be dynamically linked against the system libraries?
<flux>
seems an open Core Printf.printf "hello"-program takes 500k stripped, where as the Batteries version takes 2.3 megabytes, unless my test is flawed
<flux>
bobbejaantje, by system libraries you mean the operating system libraries? or ocaml libraries?
<flux>
because the former are dynamically linked in