kakadu has quit [Remote host closed the connection]
Stalkr_ has quit [Quit: Leaving...]
antkong_ has joined #ocaml
tftio has joined #ocaml
ncthom91 has joined #ocaml
madroach has quit [Ping timeout: 246 seconds]
madroach has joined #ocaml
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tftio has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Pepe_ has quit [Ping timeout: 265 seconds]
shinnya has quit [Ping timeout: 246 seconds]
Pepe_ has joined #ocaml
exm has joined #ocaml
<Algebr``>
Is there a way to get TCP states in ocaml
Denommus has quit [Ping timeout: 264 seconds]
Enjolras has joined #ocaml
FreeBirdLjj has joined #ocaml
jeffmo has quit [Quit: jeffmo]
ollehar has quit [Quit: ollehar]
cody` has joined #ocaml
Algebr`` has quit [Remote host closed the connection]
psy_ has quit [Ping timeout: 260 seconds]
aphprentice has quit [Quit: Connection closed for inactivity]
ncthom91 has joined #ocaml
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
d0nn1e has quit [Ping timeout: 246 seconds]
d0nn1e has joined #ocaml
rpg has quit [Quit: rpg]
struk|desk|away is now known as struk|desk2
idegen has quit [Quit: Leaving.]
Algebr has joined #ocaml
manizzle has joined #ocaml
manizzle has quit [Read error: Connection reset by peer]
manizzle has joined #ocaml
Soni has joined #ocaml
<Soni>
is ocaml embeddable?
<Soni>
and sandboxable?
<Algebr>
you can run ocaml on android and raspberry pi
mac10688 has quit [Ping timeout: 260 seconds]
<please_help>
I think he's asking if one can expose code to a sandboxed ocaml runtime embedded in e.g. a C/C++ application; as one would commonly do with, for example, lua.
<Algebr>
yes, you can use ocaml as a library, call it from C
yallop has quit [Ping timeout: 240 seconds]
yallop has joined #ocaml
MercurialAlchemi has joined #ocaml
darkf has joined #ocaml
ygrek has quit [Ping timeout: 255 seconds]
JacobEdelman has quit [Quit: Connection closed for inactivity]
tmtwd has joined #ocaml
xyh has joined #ocaml
cody` has quit [Quit: Connection closed for inactivity]
Mercuria1Alchemi has joined #ocaml
govg has quit [Ping timeout: 265 seconds]
FreeBirdLjj has quit [Read error: Connection timed out]
pierpa has quit [Ping timeout: 260 seconds]
FreeBirdLjj has joined #ocaml
octachron has joined #ocaml
lokien_ has joined #ocaml
govg has joined #ocaml
sfri has quit [Ping timeout: 240 seconds]
sfri has joined #ocaml
tmtwd has quit [Ping timeout: 272 seconds]
struk|desk2 is now known as struk|desk|away
alpen- has quit [Ping timeout: 250 seconds]
freehck` has joined #ocaml
Haudegen has quit [Ping timeout: 245 seconds]
freehck` has quit [Remote host closed the connection]
freehck` has joined #ocaml
Haudegen has joined #ocaml
FreeBirdLjj has quit [Read error: Connection reset by peer]
alpen has joined #ocaml
FreeBirdLjj has joined #ocaml
zpe has joined #ocaml
rand has joined #ocaml
rand is now known as Guest72153
luz1e has joined #ocaml
zpe has quit [Remote host closed the connection]
Simn has joined #ocaml
Sorella has quit [Quit: Connection closed for inactivity]
ontologiae has joined #ocaml
xiaolin has quit [Ping timeout: 260 seconds]
xiaolin_ has joined #ocaml
sh0t has joined #ocaml
ollehar has joined #ocaml
lokien_ has quit [Quit: Connection closed for inactivity]
Mirry has quit [Ping timeout: 246 seconds]
kandu has quit [Ping timeout: 250 seconds]
larhat1 has quit [Quit: Leaving.]
Mirry has joined #ocaml
antkong_ has quit [Quit: antkong_]
damason has quit [Ping timeout: 255 seconds]
Mirry has quit [Ping timeout: 272 seconds]
jwatzman|work has joined #ocaml
Mirry has joined #ocaml
SkySkimmer has joined #ocaml
ollehar has quit [Ping timeout: 255 seconds]
<SkySkimmer>
Hi. Are anonymous recursive functions a thing in ocaml?
ollehar has joined #ocaml
<companion_cube>
no, they're not
<companion_cube>
unless you first introduce a "fix" combinator, but it's unusual
Mirry has quit [Ping timeout: 256 seconds]
djellemah has quit [Ping timeout: 240 seconds]
djellemah has joined #ocaml
Nahra``` has joined #ocaml
Nahra``` has quit [Changing host]
Bahman has joined #ocaml
Guest72153 has quit [Ping timeout: 245 seconds]
<SkySkimmer>
ok
SkySkimmer has quit [Quit: Leaving]
hannes` has joined #ocaml
hannes has quit [Read error: Connection reset by peer]
sepp2k has joined #ocaml
zpe has joined #ocaml
hannes` is now known as hannes
sh0t has quit [Ping timeout: 250 seconds]
govg has quit [Ping timeout: 272 seconds]
zpe has quit [Remote host closed the connection]
Mirry has joined #ocaml
ollehar has quit [Ping timeout: 255 seconds]
Haudegen has quit [Ping timeout: 250 seconds]
mahasamoot has quit [Ping timeout: 255 seconds]
sh0t has joined #ocaml
iorivur has joined #ocaml
mort___ has joined #ocaml
contempt has quit [Disconnected by services]
contempt has joined #ocaml
Haudegen has joined #ocaml
mort___1 has joined #ocaml
mort___ has quit [Ping timeout: 260 seconds]
mort___ has joined #ocaml
mort___1 has quit [Ping timeout: 240 seconds]
JacobEdelman has joined #ocaml
mort___1 has joined #ocaml
mort___1 has left #ocaml [#ocaml]
mort___ has quit [Ping timeout: 250 seconds]
b4283 has joined #ocaml
Haudegen has quit [Ping timeout: 264 seconds]
Haudegen has joined #ocaml
rand has joined #ocaml
Fleurety has quit [Remote host closed the connection]
rand is now known as Guest89890
<Drup>
(it's not very useful either :p)
<companion_cube>
yeah, unless the fix combinator adds some interesting behavior, like memoization
<Soni>
> It uses Unix rlimits to prevent infinite loops or using too much memory.
<flux>
and other tricks.
<Soni>
I'm guessing I can't use a custom allocator with OCaml?
<flux>
if by persisting you mean save state to disk and restore it, you may have three options.. 1) write two functions to your code: write and restore state to/from a file 2) use continuation passing code and Marshal.marshal the continuation to a file (but this can only be restored by the same ocaml program, enforced by md5) 3) use operating system facilities if available
<flux>
you "can", just modify ocaml to use your custom allocator.. :)
<Soni>
>.>
<Soni>
I mean like as part of the API >.>
<Drup>
not really, no
idegen has joined #ocaml
xyh is now known as hentai`
jwatzman|work has joined #ocaml
hentai` is now known as tmj
tmj is now known as xyh
FreeBirdLjj has quit [Remote host closed the connection]
Sorella has joined #ocaml
sh0t has quit [Ping timeout: 240 seconds]
idegen has quit [Quit: Leaving.]
jacquev6 has joined #ocaml
rpg has joined #ocaml
sepp2k has quit [Quit: Leaving.]
Fleurety has joined #ocaml
xm_ has joined #ocaml
<xm_>
hi guys, I have installed opam, and irmin library. after eval `opam config env`, I suppose I should be able to run irmin command, but I get the error `command not found`. Any suggestion?
tftio has joined #ocaml
<edwin>
xm_: the readme suggests installing irmin-unix, irmin alone probably doesn't build everything by default
tane has joined #ocaml
<xm_>
how I can install irmin-unix?
<Drup>
"opam install irmin-unix"
<xm_>
ah, thanks. some time ago, it wasn't in opam
slash^ has joined #ocaml
zpe has quit [Remote host closed the connection]
<haesbaert>
is there a popular idiom for the following:
<haesbaert>
foo list = [Bar [1; 2; 3; 4]; Bar [999; 1000; 84]]
<haesbaert>
I want it to become foo list = [Bar [1;2;3;4;999;1000;83]]
<Soni>
ok so 2 things: 1. does ocaml support debuggers? 2. is there any way to limit memory with the API?
<haesbaert>
ulimits ?
<companion_cube>
haesbaert: apart from writing the quite specific function that does only that, I don't think o
<haesbaert>
k
jeffmo has joined #ocaml
shinnya has joined #ocaml
<companion_cube>
I mean this sounds like a `group` function, but then you'd still have to merge the sublists together
<pippijn>
Soni: gdb works with ocaml
<pippijn>
native code
<pippijn>
valgrind also works well
<Soni>
pippijn, I mean a built-in debugging API
<companion_cube>
but... gdb doesn't know the symbols, does it?
<pippijn>
companion_cube: it does
<Soni>
like hooks
<companion_cube>
oh, neat
<pippijn>
Soni: there is an ocaml debugger
<pippijn>
byte-code only
<Soni>
like a thing that gets called for every opcode that runs
<pippijn>
I don't know about that
<pippijn>
but the ocaml debugger presumably does something like thta
<pippijn>
that
<Drup>
maybe you could hack the runtime
<Drup>
(and use bytecode only)
<Drup>
erk, not the runtime, ocamlrun
<Drup>
the bytecode interpreter
<haesbaert>
companion_cube: yep
<companion_cube>
haesbaert: writing the specialized function seems like the simpler way anyway
<haesbaert>
it could turn into 148 specialized functions, but I'll figure it out
<companion_cube>
:D
<companion_cube>
you have 148 such constructors?
<pippijn>
just generate them
<haesbaert>
I have a variant with now, 148 entries
<companion_cube>
sounds bad
<haesbaert>
yeah, not fun
<ggole>
haesbaert: so you have [X list1; X list2] for a bunch of constructors X?
<ggole>
And you want to transform to X (list1@list2)
<haesbaert>
yep
<pippijn>
haesbaert: there is a (small) limit for number of non-nullary type constructors in a non-polymorphic variants
<haesbaert>
pippijn: I know, I went over, it's 246
<pippijn>
right
<ggole>
Will X * list rather than X list work?
<companion_cube>
haesbaert: whatever you're doing, it's like, crazy, you know
<pippijn>
haesbaert: you probably want to do what ggole said
<ggole>
Because writing [(X,list1);(X,list2)] => [X,list1@list2] for nullary X would be quite easy.
<pippijn>
lift the list out of the constructors into a common type
<haesbaert>
ggole: hmm not without changing a log of code
<haesbaert>
*lot
<ggole>
Hmm
<haesbaert>
I'll have to do somehting with each of the 146 variants anyway
<ggole>
Maybe you can (blench) transform each value into int * list with ints corresponding to constructors and then compare on that
<ggole>
Would be a bit fragile though
<companion_cube>
I think having 148 consructors makes the code doomed already
<ggole>
(And I'm assuming the list types would match, which they may not.)
<haesbaert>
ggole: they do
<pippijn>
Obj.tag :)
<ggole>
string * list?
<haesbaert>
pippijn: nevah
<ggole>
Depending on how fast you don't care about being
<haesbaert>
ggole: leme reduce the problem a little, and then I can formualte a better question
<ggole>
k
<haesbaert>
ggole: your advice was gold, I think I see it now.
<ggole>
\o/
<hannes>
haesbaert: is it common to have multiple date values with the same key (common enough to actually implement it, and not regard some k/v if k was already present as an error)?
<haesbaert>
it's pretty common actually
contempt has quit [Disconnected by services]
<haesbaert>
I now see I shouldn't have used variants
<haesbaert>
but it's a bit late to go bakc
contempt has joined #ocaml
<hannes>
ok (reason I asked is that other protocols regard such things as errors (TLS when you provide an extension multiple times))
<hannes>
you can always go bad!
<hannes>
s/bad/back/
<haesbaert>
ack, actually I don't really need to do this, the protocol allows me to not care about it
<haesbaert>
but I'm sure some broken clients will handle it wrong
<fds>
Which protocol?
<haesbaert>
basically I dont want to have 2 Routers option in a dhcp packet
<haesbaert>
each option has a list of routers (so you can have multiple)
<hannes>
haesbaert: I never saw a useful use of having multiple routers in the router option..
<hannes>
fds: DHCP
Guest89890 has quit [Ping timeout: 264 seconds]
<haesbaert>
ack me neither, but think of multiple dns servers
<haesbaert>
and it's more about being correct than real I'd say
<hannes>
sure, but if it is a case you don't want to handle at a higher level anyways, you can already throw up while parsing
<ggole>
Or you could raise an exception.
<haesbaert>
it could be handled at higher levels, didn't rule that out yet
<companion_cube>
but even then, using integers seems like the correct way to do things, not variants
<hannes>
correctness is the lowest common denominator of the reality (== used implementations) in network protocols
<haesbaert>
hannes: agreed, but then it starts looking like dayjob
<haesbaert>
companion_cube: agreed
<haesbaert>
I might actually change everything to ints, fuck it
<hannes>
haesbaert: ack..
octachron has quit [Quit: Leaving]
<Guest19690>
Running strace on my Lwt code that has been running for a few hours now, there's a write call for 43, which succeeds with 43, then a "read(3, " at which point there nothing else
<Guest19690>
I don't understand why its stuck at this point
<Guest19690>
Code was running fine for many hours, then it gets stuck like this.
jeffmo has quit [Quit: jeffmo]
xyh has quit [Remote host closed the connection]
<edwin>
there are a number of worker threads in Lwt (quite large by default), when they run out it falls back to blocking I think. can strace tell you what the other threads (if any) are doing? I think strace -f would do that
<Guest19690>
-f doesn't seem to yield more info, same dump
ontologiae has quit [Ping timeout: 255 seconds]
badon has quit [Read error: Connection reset by peer]
zpe has joined #ocaml
badon has joined #ocaml
<Guest19690>
maybe was a mistake to use lwt, perhaps should have used core.
<edwin>
did you use Lwt functions everywhere for IO?
<edwin>
try gdb and see if it gives you any useful info on who calls that read ('attach <pid>' and 'thread apply all bt')
<Guest19690>
yes. The code worked for many hours, then does this.
<Guest19690>
Most annoying is that nothing has crashed, no exceptions anywhere, just stuck.
hay207 has joined #ocaml
<edwin>
what kind of file is FD 3? ls -l /proc/<pid>/fd/3, and how does your code that uses that file look like?
xyh has joined #ocaml
<Guest19690>
/proc/30609/fd/3 -> socket:[7277551], this is a daemon created with lwt's daemonize
<edwin>
timeout_stream' is shorter, but I think timeout_stream should be more efficient (but less accurate, Lwt_timeout only has ~1-2s second granularity)
<edwin>
it gets more tricky on how to actually cancel the original stream
<edwin>
if its a bounded_push you can #close it and have pushers fail, in some situations you can ignore it (if original stream isn't bound to a socket/file resource), but in some cases I think you just have to drain the original stream asynchronously with Lwt.junk* (I think cohttp does that)
<nullcatxxx_>
what property should a good lexer have? besides producing correct stream of tokens, it should associate token with perfectly precise location info? what else?
<nullcatxxx_>
(i find getting perfect location info is hard...)
<Algebr`>
edwin: will try yours, thank you
<edwin>
I think yours reads characters from ic, then after 10s it starts writing to oc
<edwin>
I'd use string Lwt_stream.t though
<edwin>
instead of pushing individual characters
<Algebr`>
Why?
ril[away] is now known as ril
<edwin>
there is some overhead with all the bufferring/streaming/wakeups, and if you try to push gigabytes it'll start to matter
<Algebr`>
I hate to say it but getting the feeling that will need to dig into lwt source code eventually =/
zpe has joined #ocaml
<Algebr`>
edwin: trying to incorporate your sample with let echo ic oc = Lwt_io.(write_chars oc (read_chars ic))
slash^ has quit [Read error: Connection reset by peer]
<nullcatxxx_>
and I can't find suggestion in manual
mahasamoot has quit [Ping timeout: 265 seconds]
<octachron>
With ocamldoc? By having a docstring (** doc *) just after the constructor
<Algebr`>
yea, pretty sure that (** *) gets picked up for constructors.
jacquev6 has quit [Quit: jacquev6]
zpe has joined #ocaml
mahasamoot has joined #ocaml
larhat1 has joined #ocaml
haesbaert has quit [Remote host closed the connection]
<nullcatxxx_>
what if i want to document each specific field
<nullcatxxx_>
say type t = A of xxxxx list * yyyyyy option * zzzz list * string * int * char option
<nullcatxxx_>
i would like to document each of the five fields
<nullcatxxx_>
and then document this constructor
<Algebr`>
oh each of the five fields of the constructor itself...I don't know about that, why not just put all that documentaiton in the constructor's doc stering?
<Algebr`>
string
<nullcatxxx_>
yeah... seems like this is the only way to do
<nullcatxxx_>
first field is... second field is...
<nullcatxxx_>
alright
<Drup>
nullcatxxx_: use a record, and document the fields ? ^^'
ddosia has quit [Quit: Connection closed for inactivity]
<octachron>
yes, I was thinking of inline records, but even without them you could define related records independently and use them as constructor arguments
antkong has joined #ocaml
lokien_ has joined #ocaml
mahasamoot has quit [Ping timeout: 276 seconds]
tane has quit [Quit: Verlassend]
manizzle has quit [Ping timeout: 272 seconds]
manizzle has joined #ocaml
yth has quit [Quit: WeeChat 0.3.8]
zpe has quit [Remote host closed the connection]
struk|desk2 is now known as struk|desk|away
struk|desk|away is now known as struk|desk2
Mirry has quit [Ping timeout: 240 seconds]
<Drup>
I suddenly want to apply the new dead_code_analyzer to the compiler code base
<Drup>
I'm not sure I should
<edwin>
can you apply the dead_code_analyzer to the dead_code_analyzer? :)
<Drup>
that too, but I hope they did that already
<octachron>
Drup, I don't know, dead code would be in quite good company with some zombies comments or documentations in the compiler
srcerer has joined #ocaml
<Algebr`>
I wonder if the new flambda improvements will directly translatae to $$$ because of faster code, ala at Jane Street, etc.
<Drup>
considering they are paying for it ...
AltGr has joined #ocaml
NingaLeaf has quit [Quit: Leaving]
<Algebr`>
How much faster will OCaml be on average then? any ball park metrics?
<Drup>
the number thrown around was 20% to 30% on "average programs"
<Drup>
which means both a lot and nothing :p
Denommus has joined #ocaml
<Algebr`>
wow
<Drup>
in practice, it's quite good for purely functional stuff, no improvements for C-code-as-OCaml (or numeric code)
<zozozo>
does it work well when you use a lot of functors ?
<Drup>
yeah
<Drup>
pierre said that the first time he tried mirage, flambda didn't terminate because it was trying to inline all the functors :D
<zozozo>
do you need to fine tune parameters for it to work well, or can one assume that default optimization levels will already do a decemtn amount ?
<Drup>
they spend a looong time fine tuning the parameters to work well in most cases
<Drup>
(there are -O flags too now, 1 2 and 3)
<zozozo>
yes, i saw the levels
<zozozo>
I suppose ocamlbuild will be updated accordingly ?
<Drup>
err, I hope ?
<zozozo>
last time I tried flambda I had to do dirty tricks to get my program to compile with -O3
<Drup>
pretty sure you should report that :)
<zozozo>
partly because even if you build a native executable, interfaces are compiled with ocamlc, which doesn't accept -O{1,2,3} options
<Drup>
ocamlbuild updates will be fast now anyway
Mirry has joined #ocaml
struk|desk2 is now known as struk|desk|away
<pierpa>
this will be in the next release, or farther in the future?